.CM  SCRIPT , Version - 1.1 , last edited by Manuela Rathmann
.ad 8
.bm 8
.fm 4
.bt $Copyright by   SAP AG, 1998$$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


    ========== licence begin LGPL
    Copyright (C) 2000 SAP AG

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

    This library 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
    Lesser General Public License for more details.

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

.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 : tsp_knl_identifier);
 
        PROCEDURE
              i87pgetpassword (
                    VAR buf      : tin_screenline;
                    len          : tin_natural;
                    VAR password : tsp_cryptpw);
 
        PROCEDURE
              i87dgetserverdb (
                    VAR buf      : tin_screenline;
                    len          : tin_natural;
                    VAR serverdb : tsp_dbname);
 
        PROCEDURE
              i87ngetservernode (
                    VAR buf        : tin_screenline;
                    len            : tin_natural;
                    VAR servernode : tsp_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 : tsp_int4);
 
        PROCEDURE
              i87tgettimeout (
                    VAR buf        : tin_screenline;
                    len            : tin_natural;
                    VAR timeout    : tsp_int2);
 
        PROCEDURE
              i87igetisolation (
                    VAR buf        : tin_screenline;
                    len            : tin_natural;
                    VAR isolation  : tsp_int2);
 
        PROCEDURE
              i87lgetdblang (
                    VAR buf        : tin_screenline;
                    len            : tin_natural;
                    VAR dblang     : tsp_knl_identifier);
 
        FUNCTION
              in8730 : tsp_int4;
 
.CM *-END-* define --------------------------------------
.sp;.cp 3
Use     :
 
        FROM
              Binary_String_Conversions: VIN35;
 
        FUNCTION
              i35ljstr_into_int (
                    VAR source_str : tsp_c10;
                    source_len     : integer;
                    VAR overflow   : boolean) : tsp_int4;
 
      ------------------------------ 
 
        FROM
              Encrypting: VSP02;
 
        PROCEDURE
              s02applencrypt (
                    pw_clear     : tsp_pw;
                    VAR pw_crypt : tsp_cryptpw);
&       ifdef trace
 
      ------------------------------ 
 
        FROM
              Test_Procedures: VMT90;
 
        PROCEDURE
              m90int4 (
                    layer : tsp_layer;
                    nam   : tsp_sname;
                    int   : tsp_int4);
 
        PROCEDURE
              m90bool (
                    layer     : tsp_layer;
                    nam       : tsp_sname;
                    curr_bool : boolean );
 
        PROCEDURE
              m90int (
                    layer : tsp_layer;
                    nam   : tsp_sname;
                    int   : integer);
 
        PROCEDURE
              m90buf (
                    layer   : tsp_layer;
                    VAR buf : tin_screenline;
                    pos_anf : integer;
                    pos_end : integer);
&       endif
 
.CM *-END-* use -----------------------------------------
.sp;.cp 3
Synonym :
 
        PROCEDURE
              s02applencrypt;
 
              tsp_name tsp_pw
 
        PROCEDURE
              m90buf;
 
              tsp_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 : tsp_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 : tsp_knl_identifier);
 
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 : tsp_cryptpw);
 
VAR
      i               : integer;
      pos             : integer;
      local_name      : tsp_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 : tsp_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 <= mxsp_dbname
    THEN
        serverdb  [ i - pos + 1 ] := buf  [i];
    (*ENDIF*) 
(*ENDFOR*) 
END; (* i87dgetserverdb *)
 
(*------------------------------*) 
 
PROCEDURE
      i87ngetservernode (
            VAR buf        : tin_screenline;
            len            : tin_natural;
            VAR servernode : tsp_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 <= mxsp_nodeid
    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] );
&   ifdef trace
    (*ENDIF*) 
(*ENDFOR*) 
m90buf (vin, buf, pos, len);
&endif
END; (* i87mgetsqlmode *)
 
(*------------------------------*) 
 
PROCEDURE
      i87cgetcachelimit (
            VAR buf        : tin_screenline;
            len            : tin_natural;
            VAR cachelimit : tsp_int4);
 
VAR
      i        : integer;
      pos      : integer;
      l        : integer;
      t10      : tsp_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] ;
&   ifdef trace
    (*ENDIF*) 
(*ENDFOR*) 
m90buf (vin, buf, pos, len);
&endif
IF  (t10 = cin87_asterisk10) OR (t10 [1] = '-')
THEN
    cachelimit := -1
ELSE
    BEGIN
    l := len - pos + 1;
&   ifdef trace
    m90int (vin, 'Klarschriftl', l);
&   endif
    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    : tsp_int2);
 
VAR
      i        : integer;
      pos      : integer;
      l        : integer;
      t10      : tsp_c10;
      overflow : boolean;
      help     : tsp_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] ;
&   ifdef trace
    (*ENDIF*) 
(*ENDFOR*) 
m90buf (vin, buf, pos, len);
&endif
IF  (t10 = cin87_asterisk10) OR (t10 [1] = '-')
THEN
    timeout := -1
ELSE
    BEGIN
    l := len - pos + 1;
&   ifdef trace
    m90int (vin, 'Klarschriftl', l);
&   endif
    help := i35ljstr_into_int ( t10, l, overflow );
&   ifdef trace
    m90int (vin, 'timeout-help', help);
    m90bool (vin, 'overflow    ', overflow);
&   endif
    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  : tsp_int2);
 
VAR
      i        : integer;
      pos      : integer;
      l        : integer;
      t10      : tsp_c10;
      overflow : boolean;
      help     : tsp_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] ;
&   ifdef trace
    (*ENDIF*) 
(*ENDFOR*) 
m90buf (vin, buf, pos, len);
&endif
IF  (t10 = cin87_asterisk10) OR (t10 [1] = '-')
THEN
    isolation := -1
ELSE
    BEGIN
    l := len - pos + 1;
&   ifdef trace
    m90int (vin, 'Klarschriftl', l);
&   endif
    help := i35ljstr_into_int ( t10, l, overflow );
&   ifdef trace
    m90int4 (vin, 'isolati-help', help);
    m90bool (vin, 'overflow    ', overflow);
&   endif
    IF  overflow OR (help > csp_maxint2)
    THEN
        isolation := csp_maxint2
    ELSE
        isolation := help;
    (*ENDIF*) 
    END;
(*ENDIF*) 
&ifdef trace
m90int (vin, 'isolation   ', isolation);
&endif
END; (* i87igetisolation *)
 
(*------------------------------*) 
 
PROCEDURE
      i87lgetdblang (
            VAR buf        : tin_screenline;
            len            : tin_natural;
            VAR dblang     : tsp_knl_identifier);
 
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] );
&   ifdef trace
    (*ENDIF*) 
(*ENDFOR*) 
m90buf (vin, buf, pos, len);
&endif
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 
