.ad 8
.bm 8
.fm 4
.bt $Copyright (c) 2000-2005 SAP AG$$Page %$
.tm 12
.hm 6
.hs 3
.TT 1 $SQL$Project Distributed Database System$VAK46$
.tt 2 $$$
.TT 3 $ThomasA$Show_program_usage$1999-02-15$
***********************************************************
.nf
 
 .nf

    ========== licence begin  GPL
    Copyright (c) 2000-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
.nf
.sp
MODULE  : AK_Show_program_usage
=========
.sp
Purpose : Show Data For Domain and Show Values
.CM *-END-* purpose -------------------------------------
.sp
.cp 3
Define  :
 
        PROCEDURE
              a46execute (VAR acv : tak_all_command_glob;
                    VAR a41v : tak40_show_glob);
 
.CM *-END-* define --------------------------------------
.sp;.cp 3
Use     :
 
        FROM
              Scanner : VAK01;
 
        VAR
              a01defaultkey       : tgg00_SysInfoKey;
              a01_il_b_identifier : tsp00_KnlIdentifier;
 
      ------------------------------ 
 
        FROM
              AK_error_handling : VAK07;
 
        PROCEDURE
              a07_b_put_error (VAR acv : tak_all_command_glob;
                    b_err    : tgg00_BasisError;
                    err_code : tsp00_Int4);
 
      ------------------------------ 
 
        FROM
              Systeminfo_cache   : VAK10;
 
        PROCEDURE
              a10next_sysinfo (VAR acv : tak_all_command_glob;
                    VAR syskey    : tgg00_SysInfoKey;
                    stop_prefix   : integer;
                    dstate        : tak_directory_state;
                    rec_kind      : tsp00_C2;
                    VAR syspoint  : tak_sysbufferaddress;
                    VAR b_err     : tgg00_BasisError);
 
      ------------------------------ 
 
        FROM
              AK_universal_show_tools : VAK40;
 
        PROCEDURE
              a40get_catalog_table (VAR acv : tak_all_command_glob;
                    VAR a41v : tak40_show_glob);
 
        PROCEDURE
              a40move (VAR acv  : tak_all_command_glob;
                    VAR a41v    : tak40_show_glob;
                    moveobj_ptr : tsp00_MoveObjPtr;
                    move_len    : integer);
 
        PROCEDURE
              a40move_const (VAR acv  : tak_all_command_glob;
                    VAR a41v    : tak40_show_glob;
                    moveobj_ptr : tsp00_MoveObjPtr;
                    move_len    : integer);
 
      ------------------------------ 
 
        FROM
              filesysteminterface_1 : VBD01;
 
        PROCEDURE
              b01destroy_file (VAR t : tgg00_TransContext;
                    VAR file_id : tgg00_FileId);
 
      ------------------------------ 
 
        FROM
              filesysteminterface_2 : VBD07;
 
        PROCEDURE
              b07cnext_record (VAR t : tgg00_TransContext;
                    VAR file_id    : tgg00_FileId;
                    VAR rk         : tgg00_Lkey;
                    VAR set_result : tgg00_BdSetResultRecord;
                    VAR tree_pos   : tgg00_FilePos;
                    VAR b          : tsp00_MoveObj);
 
      ------------------------------ 
 
        FROM
              GG_edit_routines : VGG17;
 
        FUNCTION
              g17printable_char (c : char) : boolean;
 
.CM *-END-* use -----------------------------------------
.sp;.cp 3
Synonym :
 
.CM *-END-* synonym -------------------------------------
.sp;.cp 3
Author  : ThomasA
.sp
.cp 3
Created : 1985-10-01
.sp
.cp 3
.sp
.cp 3
Release :      Date : 1999-02-15
.sp
***********************************************************
.sp
.cp 10
.fo
.oc _/1
Specification:
 
Semantic of Show Data For Domain and
Show Values commands.
.sp 2
.CM *-END-* specification -------------------------------
.sp 2
***********************************************************
.sp
.cp 10
.fo
.oc _/1
.pb '@'
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    :
 
 
(*------------------------------*) 
 
PROCEDURE
      a46execute (VAR acv : tak_all_command_glob;
            VAR a41v : tak40_show_glob);
 
BEGIN
CASE a41v.a4sh_kind OF
    sh_domain_data :
        ak46data_for_domain (acv, a41v);
    sh_mapset :
        ak46mapset  (acv, a41v);
    END;
(*ENDCASE*) 
END;
 
(*------------------------------*) 
 
PROCEDURE
      ak46mapset (VAR acv : tak_all_command_glob;
            VAR a41v : tak40_show_glob);
 
VAR
      b_err     : tgg00_BasisError;
      c2        : tsp00_C2;
      ix        : integer;
      jx        : integer;
      curr_col  : integer;
      map_ptr   : tak_sysbufferaddress;
      move_text : tsp00_C8;
      sysk      : tgg00_SysInfoKey;
 
BEGIN
WITH acv DO
    BEGIN
    IF  a_returncode = 0
    THEN
        BEGIN
        a41v.a4sh_kind := sh_mapset;
        a40get_catalog_table (acv, a41v);
        (*== get all mapset records ===========================*)
        sysk           := a01defaultkey;
        sysk.sentrytyp := cak_emapset;
        sysk.skeylen   := SURROGATE_MXGG00 + 2;
        REPEAT
            a10next_sysinfo (acv, sysk, SURROGATE_MXGG00 + 2, d_release,
                  cak_emapset, map_ptr, b_err);
            IF  b_err = e_ok
            THEN
                WITH a41v, map_ptr^.smapset DO
                    BEGIN
                    (* PTS 1120720 E.Z. *)
                    (*========= alphasetname =================*)
                    a40move (acv, a41v, @map_name, sizeof(map_name));
                    (*========= basic code ===================*)
                    IF  map_code = csp_ascii
                    THEN
                        move_text := 'ASCII   '
                    ELSE
                        IF  map_code = csp_unicode
                        THEN
                            move_text := 'UNICODE '
                        ELSE
                            move_text := 'ERROR   ';
                        (*ENDIF*) 
                    (*ENDIF*) 
                    a40move_const (acv,
                          a41v, @move_text, sizeof (move_text));
                    jx       := 1;
                    ix       := 1;
                    curr_col := a4pos;
                    WHILE (ix <= map_count) AND
                          (a_returncode = 0) DO
                        BEGIN
                        a4pos := curr_col;
                        IF  map_code = csp_unicode
                        THEN
                            BEGIN
                            a40move (acv, a41v, @map_set[jx  ], 2);
                            a40move (acv, a41v, @map_set[jx+2], 4);
                            IF  
                                (map_set[jx+2] = csp_unicode_mark) AND
                                g17printable_char(map_set[jx+3])   AND
                                (map_set[jx+4] = csp_unicode_mark) AND
                                g17printable_char(map_set[jx+5])
                            THEN
                                a40move (acv, a41v, @map_set[jx+2], 4)
                            ELSE
                                a40move (acv, a41v, @a01_il_b_identifier, 4);
                            (*ENDIF*) 
                            jx := jx + 6;
                            END
                        ELSE
                            BEGIN
                            a40move (acv, a41v, @map_set[jx  ], 1);
                            a40move (acv, a41v, @map_set[jx+1], 2);
                            c2[1] := map_set[jx+1];
                            c2[2] := map_set[jx+2];
                            IF  g17printable_char(c2[1]) AND
                                g17printable_char(c2[2])
                            THEN
                                a40move_const (acv, a41v, @c2[1], 2)
                            ELSE
                                BEGIN
                                c2 := '  ';
                                a40move_const (acv, a41v, @c2[1], 2);
                                END;
                            (*ENDIF*) 
                            jx := jx + 3;
                            END;
                        (*ENDIF*) 
                        ix := ix + 1
                        END;
                    (*ENDWHILE*) 
                    END;
                (*ENDWITH*) 
            (*ENDIF*) 
        UNTIL
            (b_err       <> e_ok) OR
            (a_returncode <> 0);
        (*ENDREPEAT*) 
        IF  b_err <> e_no_next_record
        THEN
            a07_b_put_error (acv, b_err,1);
        (*ENDIF*) 
        END;
    (*ENDIF*) 
    END;
(*ENDWITH*) 
END;
 
(*------------------------------*) 
 
PROCEDURE
      ak46data_for_domain (VAR acv : tak_all_command_glob;
            VAR a41v : tak40_show_glob);
 
CONST
      c_paramColCount = 5;
 
VAR
      b_err        : tgg00_BasisError;
      rec_len      : tsp_int_map_c2;
      key_len      : tsp_int_map_c2;
      ix           : integer;
      pos          : integer;
      rec_pos      : integer;
      b_ptr        : tsp00_MoveObjPtr;
      set_result   : tgg00_BdSetResultRecord;
      tree_pos     : tgg00_FilePos;
      zerokey      : tgg00_Lkey;
      b            : ARRAY[1..8192] OF char;
 
BEGIN
IF  acv.a_returncode = 0
THEN
    BEGIN
    a41v.a4sh_kind := sh_domain_data;
    a40get_catalog_table (acv, a41v);
    END;
(*ENDIF*) 
IF  (acv.a_returncode = 0) AND
    (acv.a_ex_kind <> only_parsing)
THEN
    WITH acv, a41v DO
        BEGIN
        b_ptr := @b;
        WITH set_result DO
            BEGIN
            bd_key_check_len:= 0;
            bd_max_rec_cnt  := csp_maxint2;
            bd_max_fill_len := sizeof (b);
            bd_next         := false;
            END;
        (*ENDWITH*) 
        zerokey.len     := 0;
        tree_pos.tpsPno_gg00  := NIL_PAGE_NO_GG00;
        REPEAT
            b07cnext_record (a_transinf.tri_trans, a_usage_curr,
                  zerokey, set_result, tree_pos, b_ptr^);
            b_err := a_transinf.tri_trans.trError_gg00;
            IF  (b_err = e_ok) OR (b_err = e_key_not_found) OR
                (b_err = e_buffer_limit)
            THEN
                BEGIN
                rec_pos := 1;
                WHILE rec_pos < set_result.bd_fill_len DO
                    BEGIN
                    rec_len.map_c2[1] := b[rec_pos  ];
                    rec_len.map_c2[2] := b[rec_pos+1];
                    key_len.map_c2[1] := b[rec_pos+2];
                    key_len.map_c2[2] := b[rec_pos+3];
                    pos               := rec_pos +
                          cgg_rec_key_offset + key_len.map_int + 1;
                    FOR ix := 1 TO 2 DO
                        BEGIN
                        a40move_const (acv, a41v,
                              @b[pos], mxsp_c18);
                        pos := pos + 1 + mxsp_c18
                        END;
                    (*ENDFOR*) 
                    FOR ix := 3 TO 3 + c_paramColCount - 1 DO
                        BEGIN
                        a40move (acv, a41v,
                              @b[pos], sizeof (tsp00_KnlIdentifier));
                        pos := pos + 1 + sizeof (tsp00_KnlIdentifier)
                        END;
                    (*ENDFOR*) 
                    rec_pos := rec_pos + rec_len.map_int
                    END;
                (*ENDWHILE*) 
                IF  b_err = e_buffer_limit
                THEN
                    b_err := e_ok
                ELSE
                    b_err := e_no_next_record;
                (*ENDIF*) 
                END;
            (*ENDIF*) 
        UNTIL
            (b_err <> e_ok) OR (a_returncode <> 0);
        (*ENDREPEAT*) 
        b01destroy_file (a_transinf.tri_trans, a_usage_curr)
        END
    (*ENDWITH*) 
(*ENDIF*) 
END;
 
.CM *-END-* code ----------------------------------------
.SP 2 
***********************************************************
.PA 
