.CM  SCRIPT , Version - 1.1 , last edited by Manuela Rathmann
.ad 8
.bm 8
.fm 4
.bt $Copyright (c) 1998-2005 SAP AG$$Page %$
.tm 12
.hm 6
.hs 3
.TT 1 $SQL$Project Distributed Database System$VIN87$
.tt 2 $$$
.TT 3 $$XUSER_GET$1998-06-17$
***********************************************************
.nf

.nf

.nf

    ========== licence begin  GPL
    Copyright (c) 1998-2005 SAP AG

    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
    as published by the Free Software Foundation; either version 2
    of the License, or (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
    ========== licence end
.fo


.fo


.fo
.nf
.sp
MODULE  : XUSER_GET
=========
.sp
Purpose : Read all XUSER components
.CM *-END-* purpose -------------------------------------
.sp
.cp 3
Define  :
 
        PROCEDURE
              i87kgetuserkey (
                    VAR buf     : tin_screenline;
                    len         : tin_natural;
                    VAR userkey : tsp4_xuserkey);
 
        PROCEDURE
              i87ngetusername  (
                    VAR buf      : tin_screenline;
                    len          : tin_natural;
                    VAR username : tsp00_KnlIdentifier);
 
        PROCEDURE
              i87pgetpassword (
                    VAR buf      : tin_screenline;
                    len          : tin_natural;
                    VAR password : tsp00_CryptPw);
 
        PROCEDURE
              i87dgetserverdb (
                    VAR buf      : tin_screenline;
                    len          : tin_natural;
                    VAR serverdb : tsp00_DbName);
 
        PROCEDURE
              i87ngetservernode (
                    VAR buf        : tin_screenline;
                    len            : tin_natural;
                    VAR servernode : tsp00_NodeId);
 
        PROCEDURE
              i87mgetsqlmode (
                    VAR buf        : tin_screenline;
                    len            : tin_natural;
                    VAR sqlmode    : tsp4_sqlmode_name);
 
        PROCEDURE
              i87cgetcachelimit (
                    VAR buf        : tin_screenline;
                    len            : tin_natural;
                    VAR cachelimit : tsp00_Int4);
 
        PROCEDURE
              i87tgettimeout (
                    VAR buf        : tin_screenline;
                    len            : tin_natural;
                    VAR timeout    : tsp00_Int2);
 
        PROCEDURE
              i87igetisolation (
                    VAR buf        : tin_screenline;
                    len            : tin_natural;
                    VAR isolation  : tsp00_Int2);
 
        PROCEDURE
              i87lgetdblang (
                    VAR buf        : tin_screenline;
                    len            : tin_natural;
                    VAR dblang     : tsp00_KnlIdentifier);
 
        FUNCTION
              in8730 : tsp00_Int4;
 
.CM *-END-* define --------------------------------------
.sp;.cp 3
Use     :
 
        FROM
              Binary_String_Conversions: VIN35;
 
        FUNCTION
              i35ljstr_into_int (
                    VAR source_str : tsp00_C10;
                    source_len     : integer;
                    VAR overflow   : boolean) : tsp00_Int4;
 
      ------------------------------ 
 
        FROM
              Encrypting: VSP02;
 
        PROCEDURE
              s02applencrypt (
                    pw_clear     : tsp00_Pw;
                    VAR pw_crypt : tsp00_CryptPw);
 
.CM *-END-* use -----------------------------------------
.sp;.cp 3
Synonym :
 
        PROCEDURE
              s02applencrypt;
 
              tsp00_Name tsp00_Pw
 
        PROCEDURE
              m90buf;
 
              tsp00_Buf tin_screenline
 
.CM *-END-* synonym -------------------------------------
.sp;.cp 3
Author  : 
.sp
.cp 3
Created : 1992-03-16
.sp
.cp 3
Version : 1998-06-17
.sp
.cp 3
Release :      Date : 1998-06-17
.sp
***********************************************************
.sp
.cp 10
.fo
.oc _/1
Specification:
 
.CM *-END-* specification -------------------------------
.sp 2
***********************************************************
.sp
.cp 10
.fo
.oc _/1
Description:
 
.CM *-END-* description ---------------------------------
.sp 2
***********************************************************
.sp
.cp 10
.nf
.oc _/1
Structure:
 
.CM *-END-* structure -----------------------------------
.sp 2
**********************************************************
.sp
.cp 10
.nf
.oc _/1
.CM -lll-
Code    :
 
 
CONST
      cin87_asterisk10 = '**********';
 
 
(*------------------------------*) 
 
FUNCTION
      in8730 : tsp00_Int4;
 
BEGIN
(* linkcheck function *)
in8730 := 214820316;
END;
 
(*------------------------------*) 
 
PROCEDURE
      i87kgetuserkey (
            VAR buf     : tin_screenline;
            len         : tin_natural;
            VAR userkey : tsp4_xuserkey);
 
VAR
      i   : integer;
      pos : integer;
 
BEGIN
userkey := bsp_c18;
pos := 1;
WHILE  (buf  [ pos ] = ' ') AND  (pos < len) DO
    pos := pos + 1;
(*ENDWHILE*) 
FOR i := pos TO len DO
    IF  i - pos + 1 <= sizeof (userkey)
    THEN
        userkey  [ i - pos + 1 ] := buf [i];
    (*ENDIF*) 
(*ENDFOR*) 
END; (* i87kgetuserkey *)
 
(*------------------------------*) 
 
PROCEDURE
      i87ngetusername  (
            VAR buf      : tin_screenline;
            len          : tin_natural;
            VAR username : tsp00_KnlIdentifier);
 
VAR
      i   : integer;
      pos : integer;
 
BEGIN
username := bsp_c64;
pos := 1;
WHILE  (buf  [ pos ] = ' ') AND  (pos < len) DO
    pos := pos + 1;
(*ENDWHILE*) 
IF  buf  [ pos ] = '"'
THEN
    FOR i := pos + 1 TO len - 1 DO
        username  [ i - pos ] := buf   [i]
    (*ENDFOR*) 
ELSE
    FOR i := pos TO len DO
        IF  i - pos + 1 <= sizeof(username)
        THEN
            username  [ i - pos + 1 ] := in87upper (buf  [i] );
        (*ENDIF*) 
    (*ENDFOR*) 
(*ENDIF*) 
END; (* i87ngetusername *)
 
(*------------------------------*) 
 
PROCEDURE
      i87pgetpassword (
            VAR buf      : tin_screenline;
            len          : tin_natural;
            VAR password : tsp00_CryptPw);
 
VAR
      i               : integer;
      pos             : integer;
      local_name      : tsp00_Name;
 
BEGIN
local_name := bsp_name;
pos := 1;
WHILE  (buf  [ pos ] = ' ') AND  (pos < len) DO
    pos := pos + 1;
(*ENDWHILE*) 
IF  buf  [ pos ] = '"'
THEN
    FOR i := pos + 1 TO len - 1 DO
        local_name  [ i - pos ] := buf   [i]
    (*ENDFOR*) 
ELSE
    FOR i := pos TO len DO
        IF  i - pos + 1 <= mxsp_name
        THEN
            local_name [ i - pos + 1 ] := in87upper (buf  [i] );
        (*ENDIF*) 
    (*ENDFOR*) 
(*ENDIF*) 
s02applencrypt (local_name, password);
END; (* i87pgetpassword *)
 
(*------------------------------*) 
 
PROCEDURE
      i87dgetserverdb (
            VAR buf      : tin_screenline;
            len          : tin_natural;
            VAR serverdb : tsp00_DbName);
 
VAR
      i   : integer;
      pos : integer;
 
BEGIN
serverdb := bsp_dbname;
pos := 1;
WHILE  (buf  [ pos ] = ' ') AND  (pos < len) DO
    pos := pos + 1;
(*ENDWHILE*) 
FOR i := pos TO len DO
    IF  i - pos + 1 <= DBNAME_MXSP00
    THEN
        serverdb  [ i - pos + 1 ] := buf  [i];
    (*ENDIF*) 
(*ENDFOR*) 
END; (* i87dgetserverdb *)
 
(*------------------------------*) 
 
PROCEDURE
      i87ngetservernode (
            VAR buf        : tin_screenline;
            len            : tin_natural;
            VAR servernode : tsp00_NodeId);
 
VAR
      i   : integer;
      pos : integer;
 
BEGIN
servernode := bsp_nodeid;
pos := 1;
WHILE  (buf  [ pos ] = ' ') AND  (pos < len) DO
    pos := pos + 1;
(*ENDWHILE*) 
FOR i := pos TO len DO
    IF  i - pos + 1 <= NODEID_MXSP00
    THEN
        servernode  [ i - pos + 1 ] := buf [i];
    (*ENDIF*) 
(*ENDFOR*) 
END; (* i87ngetservernode *)
 
(*------------------------------*) 
 
PROCEDURE
      i87mgetsqlmode (
            VAR buf        : tin_screenline;
            len            : tin_natural;
            VAR sqlmode    : tsp4_sqlmode_name);
 
VAR
      i   : integer;
      pos : integer;
 
BEGIN
sqlmode := bsp_c8;
pos := 1;
WHILE  (buf [ pos ] = ' ') AND  (pos < len) DO
    pos := pos + 1;
(*ENDWHILE*) 
FOR i := pos TO len DO
    IF  i - pos + 1 <= sizeof (sqlmode)
    THEN
        sqlmode [ i - pos + 1 ] := in87upper (buf  [i] );
    (*ENDIF*) 
(*ENDFOR*) 
END; (* i87mgetsqlmode *)
 
(*------------------------------*) 
 
PROCEDURE
      i87cgetcachelimit (
            VAR buf        : tin_screenline;
            len            : tin_natural;
            VAR cachelimit : tsp00_Int4);
 
VAR
      i        : integer;
      pos      : integer;
      l        : integer;
      t10      : tsp00_C10;
      overflow : boolean;
 
BEGIN
t10 := bsp_c10;
pos := 1;
WHILE  (buf  [ pos ] = ' ') AND  (pos < len) DO
    pos := pos + 1;
(*ENDWHILE*) 
FOR i := pos TO len DO
    IF  i - pos + 1 <= mxsp_c10
    THEN
        t10 [ i - pos + 1 ] := buf  [i] ;
    (*ENDIF*) 
(*ENDFOR*) 
IF  (t10 = cin87_asterisk10) OR (t10 [1] = '-')
THEN
    cachelimit := -1
ELSE
    BEGIN
    l := len - pos + 1;
    cachelimit := i35ljstr_into_int ( t10, l, overflow );
    IF  overflow
    THEN
        cachelimit := -1;
    (*ENDIF*) 
    END;
(*ENDIF*) 
END; (* i87cgetcachelimit *)
 
(*------------------------------*) 
 
PROCEDURE
      i87tgettimeout (
            VAR buf        : tin_screenline;
            len            : tin_natural;
            VAR timeout    : tsp00_Int2);
 
VAR
      i        : integer;
      pos      : integer;
      l        : integer;
      t10      : tsp00_C10;
      overflow : boolean;
      help     : tsp00_Int4;
 
BEGIN
t10 := bsp_c10;
pos := 1;
WHILE  (buf  [ pos ] = ' ') AND  (pos < len) DO
    pos := pos + 1;
(*ENDWHILE*) 
FOR i := pos TO len DO
    IF  i - pos + 1 <= mxsp_c10
    THEN
        t10 [ i - pos + 1 ] := buf  [i] ;
    (*ENDIF*) 
(*ENDFOR*) 
IF  (t10 = cin87_asterisk10) OR (t10 [1] = '-')
THEN
    timeout := -1
ELSE
    BEGIN
    l := len - pos + 1;
    help := i35ljstr_into_int ( t10, l, overflow );
    IF  overflow OR (help > csp_maxint2)
    THEN
        timeout := -1
    ELSE
        timeout := help;
    (*ENDIF*) 
    END;
(*ENDIF*) 
END; (* i87tgettimeout *)
 
(*------------------------------*) 
 
PROCEDURE
      i87igetisolation (
            VAR buf        : tin_screenline;
            len            : tin_natural;
            VAR isolation  : tsp00_Int2);
 
VAR
      i        : integer;
      pos      : integer;
      l        : integer;
      t10      : tsp00_C10;
      overflow : boolean;
      help     : tsp00_Int4;
 
BEGIN
t10 := bsp_c10;
pos := 1;
WHILE  (buf  [ pos ] = ' ') AND  (pos < len) DO
    pos := pos + 1;
(*ENDWHILE*) 
FOR i := pos TO len DO
    IF  i - pos + 1 <= mxsp_c10
    THEN
        t10 [ i - pos + 1 ] := buf  [i] ;
    (*ENDIF*) 
(*ENDFOR*) 
IF  (t10 = cin87_asterisk10) OR (t10 [1] = '-')
THEN
    isolation := -1
ELSE
    BEGIN
    l := len - pos + 1;
    help := i35ljstr_into_int ( t10, l, overflow );
    IF  overflow OR (help > csp_maxint2)
    THEN
        isolation := csp_maxint2
    ELSE
        isolation := help;
    (*ENDIF*) 
    END;
(*ENDIF*) 
END; (* i87igetisolation *)
 
(*------------------------------*) 
 
PROCEDURE
      i87lgetdblang (
            VAR buf        : tin_screenline;
            len            : tin_natural;
            VAR dblang     : tsp00_KnlIdentifier);
 
VAR
      i   : integer;
      pos : integer;
 
BEGIN
dblang := bsp_c64;
pos := 1;
WHILE  (buf [ pos ] = ' ') AND  (pos < len) DO
    pos := pos + 1;
(*ENDWHILE*) 
FOR i := pos TO len DO
    IF  i - pos + 1 <= sizeof(dblang)
    THEN
        dblang [ i - pos + 1 ] := in87upper (buf  [i] );
    (*ENDIF*) 
(*ENDFOR*) 
END; (* i87lgetdblang *)
 
(*------------------------------*) 
 
FUNCTION
      in87upper (
            c : char) : char;
 
BEGIN
IF  c in  [ 'a'..'i', 'j'..'r', 's'..'z' ]
THEN
    in87upper := chr  (ord  (c) + ord  ('A') - ord  ('a'))
ELSE
    in87upper := c;
(*ENDIF*) 
END; (* in87upper *)
 
.CM *-END-* code ----------------------------------------
.SP 2 
***********************************************************
*-PRETTY-*  statements    :        114
*-PRETTY-*  lines of code :        393        PRETTYX 3.10 
*-PRETTY-*  lines in file :        605         1997-12-10 
.PA 
