/* @lastChanged: "1999-10-12"
 
 * @filename:   vxt07
 * @purpose:    "XT_page_display"
 * @release:    7.2.0.0
 * @see:        "-.-"
 *
 * @Copyright (c) 1999-2005 SAP AG"
 */
 
.tt 1 $SAP$LiveCache$VXT07$
.tt 3 $$XT_page_display$$2000-10-18$
 
.nf
 
 .nf
 
 .nf
 
    ========== licence begin  GPL
    Copyright (c) 1999-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
***********************************************************
 
Module  : XT_page_display
 
Define  :
 
        PROCEDURE
              x07AddFileAttrToEFiletype(
                    fileAttr     : integer;
                    eFiletypeSet : tgg00_ExtendedFiletypeSet);
 
        PROCEDURE
              x07AddTableAttrToEFiletype(
                    tableAttr    : integer;
                    eFiletypeSet : tgg00_ExtendedFiletypeSet);
 
        PROCEDURE
              x07logundo_node_display (VAR term : tut_terminal;
                    VAR protfile    : tut_vf_fileref;
                    scan            : tut_diag_scan;
                    VAR file_pos    : tut_file_pos;
                    trunc_buflength : tsp00_Int4;
                    VAR buf         : tsp00_MoveObj;
                    buf_size        : tsp00_Int4;
                    VAR pfkey       : tut_pfkey);
 
        PROCEDURE
              x07logredo_node_display (VAR term : tut_terminal;
                    VAR protfile    : tut_vf_fileref;
                    scan            : tut_diag_scan;
                    VAR file_pos    : tut_file_pos;
                    trunc_buflength : tsp00_Int4;
                    VAR buf         : tsp00_MoveObj;
                    buf_size        : tsp00_Int4;
                    VAR pfkey       : tut_pfkey);
 
        PROCEDURE
              x07history_node_display (VAR term : tut_terminal;
                    VAR protfile    : tut_vf_fileref;
                    scan            : tut_diag_scan;
                    VAR file_pos    : tut_file_pos;
                    trunc_buflength : tsp00_Int4;
                    VAR buf         : tsp00_MoveObj;
                    buf_size        : tsp00_Int4;
                    VAR pfkey       : tut_pfkey);
 
        PROCEDURE
              x07historydir_node_display (VAR term : tut_terminal;
                    VAR protfile    : tut_vf_fileref;
                    scan            : tut_diag_scan;
                    VAR file_pos    : tut_file_pos;
                    trunc_buflength : tsp00_Int4;
                    VAR buf         : tsp00_MoveObj;
                    buf_size        : tsp00_Int4;
                    VAR pfkey       : tut_pfkey);
 
        PROCEDURE
              x07opentrans_node_display (VAR term : tut_terminal;
                    VAR protfile    : tut_vf_fileref;
                    scan            : tut_diag_scan;
                    VAR file_pos    : tut_file_pos;
                    trunc_buflength : tsp00_Int4;
                    VAR buf         : tsp00_MoveObj;
                    buf_size        : tsp00_Int4;
                    VAR pfkey       : tut_pfkey);
 
        PROCEDURE
              x07convpage_display (VAR term : tut_terminal;
                    VAR protfile : tut_vf_fileref;
                    scan         : tut_diag_scan;
                    VAR file_pos : tut_file_pos;
                    VAR buf      : tsp00_MoveObj;
                    VAR pfkey    : tut_pfkey);
 
        PROCEDURE
              x07fdirpage_display (VAR term : tut_terminal;
                    VAR protfile : tut_vf_fileref;
                    scan         : tut_diag_scan;
                    VAR file_pos : tut_file_pos;
                    VAR buf      : tsp00_MoveObj;
                    buf_size     : tsp00_Int4;
                    VAR pfkey    : tut_pfkey);
 
        PROCEDURE
              x07debug_page (VAR term : tut_terminal;
                    VAR protfile      : tut_vf_fileref;
                    header_only       : boolean;
                    VAR file_pos      : tut_file_pos;
                    VAR buf           : tsp00_MoveObj;
                    buf_size          : tsp00_Int4;
                    VAR pfkey         : tut_pfkey);
 
        PROCEDURE
              x07edit_page (VAR term : tut_terminal;
                    VAR protfile     : tut_vf_fileref;
                    VAR file_pos     : tut_file_pos;
                    VAR buf          : tsp00_MoveObj;
                    buf_size         : tsp00_Int4;
                    VAR pfkey        : tut_pfkey);
 
        PROCEDURE
              x07get_next_pno (VAR buf : tsp00_MoveObj;
                    buf_size           : tsp00_Int4;
                    VAR aux_inv_leaf   : tbd_node;
                    VAR curr_down_pno  : tsp00_Int4;
                    VAR next_pno       : tsp00_Int4);
 
        PROCEDURE
              x07headlines_node (VAR term : tut_terminal;
                    VAR protfile    : tut_vf_fileref;
                    terminal_only   : boolean;
                    first_line_only : boolean;
                    VAR file_pos    : tut_file_pos;
                    VAR buf         : tsp00_MoveObj;
                    buf_size        : tsp00_Int4);
 
        FUNCTION
              x07is_fdir_leaf (VAR buf : tsp00_MoveObj): boolean;
 
        PROCEDURE
              x07keys_display (VAR term : tut_terminal;
                    VAR protfile : tut_vf_fileref;
                    VAR file_pos : tut_file_pos;
                    VAR buf      : tsp00_MoveObj;
                    buf_size     : tsp00_Int4;
                    VAR pfkey    : tut_pfkey);
 
        PROCEDURE
              x07node_display (VAR term : tut_terminal;
                    VAR protfile    : tut_vf_fileref;
                    scan            : tut_diag_scan;
                    VAR file_pos    : tut_file_pos;
                    trunc_buflength : tsp00_Int4;
                    VAR buf         : tsp00_MoveObj;
                    buf_size        : tsp00_Int4;
                    VAR pfkey       : tut_pfkey);
 
        PROCEDURE
              x07object_node_display (VAR term : tut_terminal;
                    VAR protfile    : tut_vf_fileref;
                    scan            : tut_diag_scan;
                    VAR file_pos    : tut_file_pos;
                    trunc_buflength : tsp00_Int4;
                    VAR buf         : tsp00_MoveObj;
                    buf_size        : tsp00_Int4;
                    VAR pfkey       : tut_pfkey);
 
.CM *-END-* define --------------------------------------
.sp;.cp 3
Use     :
 
        FROM
              pagestore : VBD10;
 
        PROCEDURE
              bd10GetConvEntry(
                    pPage         : tsp00_PageAddr;
                    EntryNo       : tsp00_Int4;
                    IsLeaf        : boolean;
                    VAR DevNo     : tsp00_Int4;
                    VAR BlockNo   : tsp00_Int4;
                    VAR IsMarked  : boolean;
                    VAR IsPending : boolean);
 
        PROCEDURE
              bd10GetPageHeader(
                    pPage            : tsp00_PageAddr;
                    VAR Version      : tsp00_Int4;
                    VAR DevNo        : tsp00_Int4;
                    VAR BlockNo      : tsp00_Int4;
                    VAR BaseNo       : tsp00_Int4;
                    VAR TotalCnt     : tsp00_Int4;
                    VAR ParentIndex  : tsp00_Int4;
                    VAR PageEntryNo  : tsp00_Int4;
                    VAR IsLeaf       : boolean;
                    VAR IsPerm       : boolean;
                    VAR IsDynamic    : boolean );
 
      ------------------------------ 
 
        FROM
              XT_logscan : VXT04;
 
        PROCEDURE
              x04logpage_display (VAR term : tut_terminal;
                    VAR protfile    : tut_vf_fileref;
                    scan            : tut_diag_scan;
                    VAR file_pos    : tut_file_pos;
                    VAR buf         : tsp00_MoveObj;
                    buf_size        : tsp00_Int4;
                    one_entryoffset : tsp00_Int4;
                    VAR pfkey       : tut_pfkey);
 
        PROCEDURE
              x04afterimagehead_display (VAR term : tut_terminal;
                    VAR protfile      : tut_vf_fileref;
                    scan              : tut_diag_scan;
                    VAR buf           : tsp00_MoveObj;
                    buf_size          : tsp00_Int4;
                    entry_offset      : tsp00_Int2;
                    entry_length      : tsp00_Int4;
                    currentIOSequence : tsp00_Int4;
                    VAR pfkey         : tut_pfkey;
                    VAR ln            : tsp00_Line;
                    VAR ln_len        : integer;
                    VAR err           : integer);
 
      ------------------------------ 
 
        FROM
              XT_auxiliary_procedures : VXT05;
 
        PROCEDURE
              x05blockno_to_line (VAR file_pos : tut_file_pos;
                    VAR ln_len : integer;
                    VAR ln     : tsp00_Line);
 
        PROCEDURE
              x05charwriteln (VAR term : tut_terminal;
                    VAR protfile    : tut_vf_fileref;
                    VAR buf         : tgg00_RecBody;
                    buf_size        : tsp00_Int4;
                    lwb             : tsp00_Int4;
                    upb             : tsp00_Int4;
                    new_line_offset : integer;
                    VAR ln_len      : integer;
                    VAR ln          : tsp00_Line;
                    ln_attr         : char);
 
        PROCEDURE
              x05helphexint (VAR term : tut_terminal;
                    VAR pfkey : tut_pfkey);
 
        PROCEDURE
              x05hexwriteln (VAR term : tut_terminal;
                    VAR protfile      : tut_vf_fileref;
                    with_td_buf       : boolean;
                    scan              : tut_diag_scan;
                    VAR buf           : tgg00_RecBody;
                    buf_size          : tsp00_Int4;
                    lwb               : tsp00_Int4;
                    upb               : tsp00_Int4;
                    new_line_offset   : integer;
                    VAR ln_len        : integer;
                    VAR ln            : tsp00_Line;
                    ln_attr           : char);
 
        PROCEDURE
              x05holdhexint (VAR term : tut_terminal;
                    VAR pfkey : tut_pfkey);
 
        FUNCTION
              x05ishex (VAR buf : tgg00_RecBody;
                    buf_size    : tsp00_Int4;
                    pos         : tsp00_Int4;
                    len         : tsp00_Int4): boolean;
 
        PROCEDURE
              x05pageno_to_line (pno : tsp00_Int4;
                    trim       : boolean;
                    VAR ln_len : integer;
                    VAR ln     : tsp00_Line);
 
      ------------------------------ 
 
        FROM
              XT_dump_display : VXT08;
 
        PROCEDURE
              x08fdir_rec_edit (VAR term : tut_terminal;
                    VAR prot   : tut_vf_fileref;
                    VAR buf    : tsp00_MoveObj;
                    buf_size   : tsp00_Int4;
                    buf_offset : tsp00_Int4;
                    is_edit    : boolean;
                    VAR pfkey  : tut_pfkey);
 
        PROCEDURE
              x08beforeimage_edit_display (VAR term : tut_terminal;
                    VAR prot   : tut_vf_fileref;
                    scan       : tut_diag_scan;
                    VAR buf    : tsp00_MoveObj;
                    buf_size   : tsp00_Int4;
                    buf_offset : tsp00_Int4;
                    VAR pfkey  : tut_pfkey);
 
        PROCEDURE
              x08node_edit_display (VAR term : tut_terminal;
                    VAR prot     : tut_vf_fileref;
                    scan         : tut_diag_scan;
                    VAR file_pos : tut_file_pos;
                    VAR buf      : tsp00_MoveObj;
                    buf_size     : tsp00_Int4;
                    VAR pfkey    : tut_pfkey);
 
        PROCEDURE
              x08logredo_edit_display (VAR term : tut_terminal;
                    VAR prot     : tut_vf_fileref;
                    scan         : tut_diag_scan;
                    VAR file_pos : tut_file_pos;
                    VAR buf      : tsp00_MoveObj;
                    buf_size     : tsp00_Int4;
                    VAR pfkey    : tut_pfkey);
 
        PROCEDURE
              x08logundo_edit_display (VAR term : tut_terminal;
                    VAR prot     : tut_vf_fileref;
                    scan         : tut_diag_scan;
                    VAR file_pos : tut_file_pos;
                    VAR buf      : tsp00_MoveObj;
                    buf_size     : tsp00_Int4;
                    VAR pfkey    : tut_pfkey);
 
        PROCEDURE
              x08history_edit_display (VAR term : tut_terminal;
                    VAR prot     : tut_vf_fileref;
                    scan         : tut_diag_scan;
                    VAR file_pos : tut_file_pos;
                    VAR buf      : tsp00_MoveObj;
                    buf_size     : tsp00_Int4;
                    VAR pfkey    : tut_pfkey);
 
        PROCEDURE
              x08historydir_edit_display (VAR term : tut_terminal;
                    VAR prot     : tut_vf_fileref;
                    scan         : tut_diag_scan;
                    VAR file_pos : tut_file_pos;
                    VAR buf      : tsp00_MoveObj;
                    buf_size     : tsp00_Int4;
                    VAR pfkey    : tut_pfkey);
 
        PROCEDURE
              x08opentrans_edit_display (VAR term : tut_terminal;
                    VAR prot     : tut_vf_fileref;
                    scan         : tut_diag_scan;
                    VAR file_pos : tut_file_pos;
                    VAR buf      : tsp00_MoveObj;
                    buf_size     : tsp00_Int4;
                    VAR pfkey    : tut_pfkey);
 
        PROCEDURE
              x08loginfo_display (VAR term : tut_terminal;
                    VAR prot     : tut_vf_fileref;
                    scan         : tut_diag_scan;
                    VAR file_pos : tut_file_pos;
                    VAR buf      : tsp00_MoveObj;
                    buf_size     : tsp00_Int4;
                    VAR pfkey    : tut_pfkey);
 
        PROCEDURE
              x08object_node_edit_display (VAR term : tut_terminal;
                    VAR prot     : tut_vf_fileref;
                    scan         : tut_diag_scan;
                    VAR file_pos : tut_file_pos;
                    VAR buf      : tsp00_MoveObj;
                    buf_size     : tsp00_Int4;
                    VAR pfkey    : tut_pfkey);
 
        PROCEDURE
              x08rec_edit (VAR term : tut_terminal;
                    VAR prot   : tut_vf_fileref;
                    VAR buf    : tsp00_MoveObj;
                    buf_size   : tsp00_Int4;
                    buf_offset : tsp00_Int4;
                    is_edit    : boolean;
                    is_catalog : boolean;
                    page_type2 : tgg00_PageType2;
                    VAR pfkey  : tut_pfkey);
 
        PROCEDURE
              x08restart_display (VAR term : tut_terminal;
                    VAR prot     : tut_vf_fileref;
                    scan         : tut_diag_scan;
                    VAR file_pos : tut_file_pos;
                    page_name    : tsp00_Sname;
                    VAR buf      : tsp00_MoveObj;
                    buf_size     : tsp00_Int4;
                    VAR pfkey    : tut_pfkey);
 
        PROCEDURE
              x08tree_index_rec_edit (VAR term : tut_terminal;
                    VAR prot   : tut_vf_fileref;
                    VAR buf    : tsp00_MoveObj;
                    buf_size   : tsp00_Int4;
                    buf_offset : tsp00_Int4;
                    is_edit    : boolean;
                    VAR pfkey  : tut_pfkey);
 
        PROCEDURE
              x08iomanpage_display (VAR term : tut_terminal;
                    VAR protfile : tut_vf_fileref;
                    scan         : tut_diag_scan;
                    VAR file_pos : tut_file_pos;
                    VAR buf      : tsp00_MoveObj;
                    buf_size     : tsp00_Int4;
                    VAR pfkey    : tut_pfkey);
 
      ------------------------------ 
 
        FROM
              GG_cpp_auxiliary_functions : VGG06;
 
        PROCEDURE
              gg06FileVersToLine (VAR FileVers : tgg91_FileVersion;
                    VAR LineLen : integer;
                    VAR Line    : tsp00_Line);
 
        PROCEDURE
              gg06GetObjHeaderParam (ObjHeaderBuf : tsp00_Addr;
                    VAR ObjTransInfo : tgg00_ObjTransInfo;
                    VAR NextFreeObj  : tgg00_ObjPagePos;
                    VAR ObjState     : tgg00_ObjState;
                    VAR ObjFrameVers : tgg00_ObjFrameVers);
 
        FUNCTION
              gg06Int4FromUint2 (Uint2 : tsp00_Uint2): tsp00_Int4;
 
        FUNCTION
              gg06PnoGet (VAR Cint4 : tgg90_Cint4): tsp00_Int4;
 
        PROCEDURE
              gg06TransToLine (VAR TransNo : tgg91_TransNo;
                    VAR LineLen : integer;
                    VAR Line    : tsp00_Line);
 
      ------------------------------ 
 
        FROM
              GG_edit_routines : VGG17;
 
        PROCEDURE
              g17surrogate_to_line (
                    VAR surrogate : tgg00_Surrogate;
                    VAR ln_len : integer;
                    VAR ln     : tsp00_Line);
 
        PROCEDURE
              g17bd_fstate_to_line (bd_fstate : tbd_file_state_set;
                    is_edit_mode : boolean;
                    VAR ln_len   : integer;
                    VAR ln       : tsp00_Line);
 
        PROCEDURE
              g17filename (nam      : tsp00_Sname;
                    VAR fn          : tgg00_Filename;
                    line_indent     : integer;
                    VAR first_ln    : tsp00_Line;
                    VAR second_ln   : tsp00_Line;
                    VAR third_ln    : tsp00_Line;
                    VAR is_third_ln : boolean);
 
        PROCEDURE
              g17fileno_to_line (
                    VAR fileNo : tgg00_Surrogate;
                    VAR ln_len : integer;
                    VAR ln     : tsp00_Line);
 
        PROCEDURE
              g17filetype_to_line (filetype : tgg00_FiletypeSet;
                    is_edit_mode : boolean;
                    VAR ln_len   : integer;
                    VAR ln       : tsp00_Line);
 
        PROCEDURE
              g17efiletype_to_line (
                    efiletype    : tgg00_ExtendedFiletypeSet;
                    is_edit_mode : boolean;
                    VAR ln_len   : integer;
                    VAR ln       : tsp00_Line);
 
        PROCEDURE
              g17hexto_line (c : char;
                    VAR ln_len : integer;
                    VAR ln     : tsp00_Line);
 
        PROCEDURE
              g17int4to_line (int : tsp00_Int4;
                    with_zero     : boolean;
                    int_len       : integer;
                    ln_pos        : integer;
                    VAR ln        : tsp00_Line);
 
        PROCEDURE
              g17nameto_line (n : tsp00_Name;
                    VAR ln_len  : integer;
                    VAR ln      : tsp00_Line);
 
        PROCEDURE
              g17obj_state_to_line (obj_state : tgg00_ObjState;
                    VAR ln_len : integer;
                    VAR ln     : tsp00_Line);
 
        PROCEDURE
              g17obj_transinfo_to_line (transinfo : tgg00_ObjTransInfo;
                    VAR ln_len : integer;
                    VAR ln     : tsp00_Line);
 
        PROCEDURE
              g17pagetype2_to_line (pagetype2 : tgg00_PageType2;
                    VAR ln_len : integer;
                    VAR ln     : tsp00_Line);
 
        PROCEDURE
              g17sname_to_line (n : tsp00_Sname;
                    VAR ln_len    : integer;
                    VAR ln        : tsp00_Line);
 
        PROCEDURE
              g17trimint4_to_line (int : tsp00_Int4;
                    VAR ln_len : integer;
                    VAR ln     : tsp00_Line);
 
      ------------------------------ 
 
        FROM
              GG_edit_routines_2 : VGG172;
 
        PROCEDURE
              g172fileno_to_line (
                    fileno : tsp00_C8;
                    VAR ln_pos : integer;
                    VAR ln     : tsp00_Line (*ptocSynonym char**));
 
        PROCEDURE
              g172Sequence_to_line (
                    high       : tbd00_LockRequestSeqNo;
                    low        : tbd00_LockRequestSeqNo;
                    VAR ln_pos : integer;
                    VAR ln     : tsp00_Line (*ptocSynonym char**));
 
        PROCEDURE
              g172Char8AsUint8_to_line (
                    Char8      : tsp00_C8;
                    VAR ln_pos : integer;
                    VAR ln     : tsp00_Line);
 
        PROCEDURE
              g172Char8AsInt8_to_line (
                    Char8      : tsp00_C8;
                    VAR ln_pos : integer;
                    VAR ln     : tsp00_Line (*ptocSynonym char**));
 
      ------------------------------ 
 
        FROM
              TA_terminal_IO : VTA09;
 
        PROCEDURE
              t09get1name (VAR term : tut_terminal;
                    msg             : tsp00_C20;
                    msg_attr        : char;
                    in_attr         : char;
                    in_len          : integer;
                    upper_case      : boolean;
                    VAR in_name     : tsp00_Name;
                    VAR pfkey       : tut_pfkey);
 
        PROCEDURE
              t09holding (VAR term : tut_terminal;
                    VAR pfkey      : tut_pfkey);
 
        FUNCTION
              t09is_empty_window (VAR term : tut_terminal): boolean;
 
        FUNCTION
              t09is_window_full (VAR term : tut_terminal;
                    wanted_lines: integer): boolean;
 
        PROCEDURE
              t09newscreen_page (VAR t09 : tut_terminal);
 
        PROCEDURE
              t09pfkeys (VAR term : tut_terminal; on : boolean);
 
        FUNCTION
              t09prot_linesize (VAR term : tut_terminal): integer;
 
        PROCEDURE
              t09put (VAR t09 : tut_terminal;
                    VAR text  : tsp00_Line;
                    text_attr : char);
 
        PROCEDURE
              t09put30 (VAR term : tut_terminal;
                    ln30         : tsp00_C30;
                    text_attr    : char);
 
        PROCEDURE
              t09setpf1 (VAR term : tut_terminal;  pfkey_label : tsp00_C8);
 
      ------------------------------ 
 
        FROM
              TA_write_protfile : VTA12;
 
        PROCEDURE
              t12write_prot (VAR fileref : tut_vf_fileref;
                    VAR ln    : tsp00_Line;
                    length    : integer;
                    VAR error : integer);
 
      ------------------------------ 
 
        FROM
              TA_buf_display : VTA14;
 
        PROCEDURE
              t14bufdimension (VAR term : tut_terminal;
                    scan                : tut_diag_scan;
                    VAR bytes_per_line  : integer;
                    VAR line_size       : integer;
                    VAR lines_per_buf   : integer);
 
        PROCEDURE
              t14bufdisplay (VAR term : tut_terminal;
                    VAR protfile      : tut_vf_fileref;
                    scan              : tut_diag_scan;
                    msg               : tsp00_C30;
                    VAR buf           : tsp00_MoveObj;
                    buf_size          : tsp00_Int4;
                    startpos          : tsp00_Int4;
                    endpos            : tsp00_Int4;
                    start_numbering   : tsp00_Int4;
                    VAR break_pos     : tsp00_Int4;
                    VAR pfkey         : tut_pfkey);
 
      ------------------------------ 
 
        FROM
              Kernel_move_and_fill : VGG101;
 
        PROCEDURE
              SAPDB_PascalForcedMove (
                    source_upb  : tsp00_Int4;
                    destin_upb  : tsp00_Int4;
                    source      : tsp00_MoveObjPtr;
                    source_pos  : tsp00_Int4;
                    destin      : tsp00_MoveObjPtr;
                    destin_pos  : tsp00_Int4;
                    length      : tsp00_Int4);
 
      ------------------------------ 
 
        FROM
              RTE-Extension-20 : VSP20;
 
        FUNCTION
              s20buf_to_int4 (VAR n : tbd_node;
                    pos : tsp00_Int4) : tsp00_Int4;
 
.CM *-END-* use -----------------------------------------
.sp;.cp 3
Synonym :
 
        PROCEDURE
              t09put;
 
              tsp00_C80 tsp00_Line
 
        PROCEDURE
              x05charwriteln;
 
              tsp00_MoveObj tgg00_RecBody
 
        PROCEDURE
              x05hexwriteln;
 
              tsp00_MoveObj tgg00_RecBody
 
        FUNCTION
              x05ishex;
 
              tsp00_MoveObj tgg00_RecBody
 
        FUNCTION
              s20buf_to_int4;
 
              tsp00_MoveObj tbd_node
 
.CM *-END-* synonym -------------------------------------
.sp;.cp 3
Author  : JuergenA
.sp
.cp 3
Created : 1983-06-01
.sp
.cp 3
.sp
.cp 3
Release :      Date : 2000-10-18
.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
      c_pos_digits =   5;
      (* *)
      c_pt_pos     =   5;
      c_pt2_pos    =   6;
      (* *)
      c_edit       = true;
      c_on         = true;
      c_term_only  = true;
      c_first_only = true;
      c_trim       = true;
      c_upper_case = true;
      c_with_zero  = true;
 
 
(*------------------------------*) 
 
PROCEDURE
      x07convpage_display (
            VAR term     : tut_terminal;
            VAR protfile : tut_vf_fileref;
            scan         : tut_diag_scan;
            VAR file_pos : tut_file_pos;
            VAR buf      : tsp00_MoveObj;
            VAR pfkey    : tut_pfkey);
 
CONST
      c_num_len     = 10;
      c_type_length = 2;
 
VAR
      IsLeaf      : boolean;
      IsPerm      : boolean;
      IsDynamic   : boolean;
      IsMarked    : boolean;
      IsPending   : boolean;
      recMode     : tgg00_RecoveryMode;
      typeChar    : tsp00_Char;
      err         : integer;
      ln_len      : integer;
      ln_pos      : integer;
      ln          : tsp00_Line;
      Version     : tsp00_Int4;
      DevNo       : tsp00_Int4;
      BlockNo     : tsp00_Int4;
      BaseNo      : tsp00_Int4;
      TotalCnt    : tsp00_Int4;
      EntryNo     : tsp00_Int4;
      ParentIndex : tsp00_Int4;
      PageEntryNo : tsp00_Int4;
      n           : tsp00_Sname;
 
BEGIN
&ifdef SLOWCI
&else
pfkey    := pf_none;
ln       := term.blankline;
ln_len   := 0;
recMode  := rmNone_egg00;
(* *)
bd10GetPageHeader( @buf, Version, DevNo, BlockNo, BaseNo,
      TotalCnt, ParentIndex, PageEntryNo, IsLeaf, IsPerm, IsDynamic );
(* *)
(* --- P N O --- *)
IF  IsLeaf
THEN
    g17nameto_line ('CONVERTER LEAF    ', ln_len, ln)
ELSE
    g17nameto_line ('CONVERTER INDEX   ', ln_len, ln);
(*ENDIF*) 
ln_len := ln_len + 1;
(* --- CONVERTER_BLOCKADDRESS --- *)
IF  DevNo <> MAX_INT2_SP00
THEN
    BEGIN
    g17trimint4_to_line( DevNo, ln_len, ln );
    ln_len      := ln_len + 1;
    ln [ln_len] := '/';
    g17trimint4_to_line( BlockNo, ln_len, ln );
    ln_len := ln_len + 1
    END;
(* --- CONVERTER VERSION --- *)
(*ENDIF*) 
IF  Version <> -1
THEN
    BEGIN
    g17sname_to_line ('Version:    ', ln_len, ln);
    ln_len := ln_len + 1;
    g17trimint4_to_line (Version, ln_len, ln);
    ln_len := ln_len + 3;
    END;
(*ENDIF*) 
IF  NOT IsLeaf
THEN
    recMode := rmPerm_egg00
ELSE
    BEGIN
    IF  NOT IsPerm
    THEN
        BEGIN
        recMode := rmTemp_egg00;
        g17sname_to_line ('Temp        ', ln_len, ln)
        END
    ELSE
        BEGIN
        IF  IsDynamic
        THEN
            BEGIN
            recMode := rmPerm_egg00;
            g17sname_to_line ('Perm        ', ln_len, ln)
            END
        ELSE
            BEGIN
            recMode := rmStatic_egg00;
            g17sname_to_line ('Static      ', ln_len, ln);
            END;
        (*ENDIF*) 
        END;
    (*ENDIF*) 
    END;
(*ENDIF*) 
(* --- P A G E   C O U N T --- *)
x05blockno_to_line (file_pos, ln_len, ln);
t12write_prot (protfile, ln, ln_len, err);
t09put (term, ln, cut_bright_protected);
(* *)
IF  (utds_bd_full_info in scan)
THEN
    (* --- C O N V E R T E R  E N T R I E S --- *)
    BEGIN
    t09put (term, term.blankline, cut_protected);
    ln     := term.blankline;
    ln_len := 0;
    IF  IsLeaf
    THEN
        BEGIN
        (* --- B A S E  P N O --- *)
        g17sname_to_line ('BaseNo:     ', ln_len, ln);
        ln_len := ln_len + 1;
        g17trimint4_to_line (BaseNo, ln_len, ln);
        ln_len := ln_len + 1;
        END;
    (* --- P A R E N T  I N D E X --- *)
    (*ENDIF*) 
    IF  ParentIndex <> MAX_UINT2_SP00
    THEN
        BEGIN
        g17sname_to_line ('Index:      ', ln_len, ln);
        ln_len := ln_len + 1;
        g17trimint4_to_line (ParentIndex, ln_len, ln);
        ln_len := ln_len + 1;
        (* --- P A R E N T  P A G E  E N T R Y N O --- *)
        g17sname_to_line ('EntryNo:    ', ln_len, ln);
        ln_len := ln_len + 1;
        g17trimint4_to_line (PageEntryNo, ln_len, ln);
        ln_len := ln_len + 1;
        END;
    (*ENDIF*) 
    t12write_prot (protfile, ln, ln_len, err);
    t09put (term, ln, cut_bright_protected);
    EntryNo := 0;
    WHILE( EntryNo < TotalCnt ) AND ( pfkey = pf_none ) DO
        BEGIN
        bd10GetConvEntry( @buf, EntryNo, IsLeaf, DevNo, BlockNo, IsMarked, IsPending );
        IF  t09is_window_full (term, 2)
        THEN
            BEGIN
            x05holdhexint (term, pfkey);
            IF  pfkey = pf_none
            THEN
                t09newscreen_page (term)
            (*ENDIF*) 
            END;
        (*ENDIF*) 
        IF  pfkey = pf_none
        THEN
            BEGIN
            ln     := term.blankline;
            ln_pos := 1;
            (* *)
            (* DATA PNO *)
            (* *)
            IF  IsLeaf
            THEN
                g17int4to_line (BaseNo + EntryNo, false, c_num_len, ln_pos, ln)
            ELSE
                g17int4to_line (EntryNo, false, c_num_len, ln_pos, ln);
            (*ENDIF*) 
            ln_pos := ln_pos + c_num_len + 2;
            IF  DevNo = MAX_INT2_SP00
            THEN
                BEGIN
                ln_pos := ln_pos + 1 + 2 + c_type_length;
                n := 'nil         ';
                SAPDB_PascalForcedMove (sizeof (n), sizeof (ln), @n, 1, @ln, ln_pos, 4);
                END
            ELSE
                IF  DevNo = MAX_INT2_SP00 -1 (* Reserved *)
                THEN
                    BEGIN
                    ln_pos := ln_pos + 1 + 2 + c_type_length;
                    n := 'Reserved    ';
                    SAPDB_PascalForcedMove (sizeof (n), sizeof (ln), @n, 1, @ln, ln_pos, 10);
                    END
                ELSE
                    BEGIN
                    CASE recMode OF
                        rmTemp_egg00:
                            typeChar    := 'T';
                        rmPerm_egg00:
                            typeChar    := 'P';
                        rmStatic_egg00:
                            typeChar    := 'S';
                        OTHERWISE
                            typeChar    := 'U';
                        END;
                    (*ENDCASE*) 
                    ln [ln_pos]   := typeChar;
                    ln [ln_pos+1] := bsp_c1;
                    ln_pos        := ln_pos + c_type_length;
                    (* *)
                    (* BLOCK ADDRESS *)
                    (* *)
                    g17int4to_line (DevNo, false, 4, ln_pos, ln);
                    ln_pos      := ln_pos + 4;
                    ln [ln_pos] := '/';
                    ln_pos      := ln_pos + 1;
                    g17int4to_line (BlockNo, true, c_num_len, ln_pos, ln);
                    ln_pos := ln_pos + c_num_len + 2;
                    IF  IsMarked OR IsPending
                    THEN
                        BEGIN
                        n := 'SAVE PAGES: ';
                        SAPDB_PascalForcedMove (sizeof (n), sizeof (ln), @n, 1, @ln, ln_pos, 10);
                        ln_pos := ln_pos + 11;
                        IF  IsMarked
                        THEN
                            n         := 'REQ         '
                        ELSE
                            n         := '            ';
                        (*ENDIF*) 
                        SAPDB_PascalForcedMove (sizeof (n), sizeof (ln), @n, 1, @ln, ln_pos, 3);
                        ln_pos := ln_pos + 3;
                        IF  IsPending
                        THEN
                            BEGIN
                            IF  IsMarked
                            THEN
                                n         := '/DONE       '
                            ELSE
                                n         := ' DONE       '
                            (*ENDIF*) 
                            END
                        ELSE
                            n         := '            ';
                        (*ENDIF*) 
                        SAPDB_PascalForcedMove (sizeof (n), sizeof (ln), @n, 1, @ln, ln_pos, 5);
                        END
                    (*ENDIF*) 
                    END;
                (*ENDIF*) 
            (*ENDIF*) 
            xt07write_prot (protfile, ln);
            t09put (term, ln, cut_protected);
            EntryNo := EntryNo + 1;
            END
        (*ENDIF*) 
        END;
    (*ENDWHILE*) 
    END;
&endif
(*ENDIF*) 
END;
 
(*------------------------------*) 
 
PROCEDURE
      x07debug_page (VAR term : tut_terminal;
            VAR protfile      : tut_vf_fileref;
            header_only       : boolean;
            VAR file_pos      : tut_file_pos;
            VAR buf           : tsp00_MoveObj;
            buf_size          : tsp00_Int4;
            VAR pfkey         : tut_pfkey);
 
VAR
      pfkeys_used  : boolean;
      unknown      : boolean;
      scan         : tut_diag_scan;
      answer       : tsp00_Name;
 
      p : RECORD
            CASE boolean OF
                true:
                    (c : tsp00_C2);
                false:
                    (ptype  : tgg00_PageType);
                END;
            (*ENDCASE*) 
 
 
BEGIN
pfkeys_used := term.use_pfkeys;
IF  NOT pfkeys_used
THEN
    t09pfkeys (term, c_on);
(*ENDIF*) 
IF  ord (buf [c_pt_pos]) >= ord (ptLastPageType_egg00)
THEN
    unknown := true
ELSE
    BEGIN
    unknown := false;
    scan    := [utds_page_header, utds_display];
    p.c [1] := buf [c_pt_pos];
    IF  header_only
    THEN
        unknown :=  NOT (p.ptype in [
              ptData_egg00,
              ptLog_egg00,
              ptSave_egg00 ])
    ELSE
        CASE p.ptype OF
            ptData_egg00:
                BEGIN
                IF  (ord (buf [c_pt2_pos]) = ord (pt2UndoLog_egg00))
                    OR
                    (ord (buf [c_pt2_pos]) = ord (pt2RedoLog_egg00))
                THEN
                    BEGIN
                    t09put (term, term.blankline, cut_protected);
                    scan       := scan + [utds_logentry_header];
                    answer     := bsp_name;
                    answer [1] := 'y';
                    t09get1name (term, ' ENTRY HEADER ONLY ?',
                          cut_bright_protected, cut_unprotected,
                          2, c_upper_case, answer, pfkey);
                    IF  pfkey = pf_none
                    THEN
                        BEGIN
                        IF  answer [1] <> 'Y'
                        THEN
                            scan := scan + [utds_logentry_full_info]
                        (*ENDIF*) 
                        END
                    (*ENDIF*) 
                    END
                ELSE
                    IF  (ord (buf [c_pt2_pos]) = ord (pt2Usm_egg00))
                    THEN
                        scan := scan + [utds_bd_full_info]
                    ELSE
                        IF  (ord (buf [c_pt2_pos]) = ord (pt2Checkpt_egg00))
                        THEN
                            scan := scan + [utds_full_info]
                        ELSE
                            BEGIN
                            t09put (term, term.blankline, cut_protected);
                            scan       := scan + [utds_node, utds_key];
                            answer     := bsp_name;
                            answer [1] := 'n';
                            t09get1name (term, '   DISPLAY RECORDS ?',
                                  cut_bright_protected, cut_unprotected,
                                  2, c_upper_case, answer, pfkey);
                            IF  pfkey = pf_none
                            THEN
                                BEGIN
                                IF  answer [1] = 'Y'
                                THEN
                                    scan := scan + [utds_rec]
                                (*ENDIF*) 
                                END
                            (*ENDIF*) 
                            END
                        (*ENDIF*) 
                    (*ENDIF*) 
                (*ENDIF*) 
                END;
            ptLog_egg00, ptIOManInfo_egg00, ptConverter_egg00, ptLogInfo_egg00 :
                BEGIN
                (* do nothing *)
                END;
            OTHERWISE
                unknown := true
            END;
        (*ENDCASE*) 
    (*ENDIF*) 
    END;
(*ENDIF*) 
IF  pfkey = pf_none
THEN
    BEGIN
    IF  NOT unknown
    THEN
        BEGIN
        IF  NOT header_only
        THEN
            t09newscreen_page (term);
        (*ENDIF*) 
        xt07page_display (term, protfile, scan, file_pos, p.ptype,
              buf, buf_size, pfkey)
        END
    ELSE
        IF  NOT header_only
        THEN
            t09put30 (term, 'PAGE TYPE NOT SUPPORTED       ',
                  cut_bright_protected)
        (*ENDIF*) 
    (*ENDIF*) 
    END;
(*ENDIF*) 
IF  (pfkey = pf_none) AND NOT header_only
THEN
    t09holding (term, pfkey);
(*ENDIF*) 
IF  pfkey = pf_cancel
THEN
    pfkey := pf_end;
(*ENDIF*) 
IF  NOT pfkeys_used
THEN
    t09pfkeys (term, NOT c_on)
(*ENDIF*) 
END;
 
(*------------------------------*) 
 
PROCEDURE
      x07edit_page (VAR term : tut_terminal;
            VAR protfile     : tut_vf_fileref;
            VAR file_pos     : tut_file_pos;
            VAR buf          : tsp00_MoveObj;
            buf_size         : tsp00_Int4;
            VAR pfkey        : tut_pfkey);
 
VAR
      scan : tut_diag_scan;
 
      p : RECORD
            CASE boolean OF
                true:
                    (c : tsp00_C2);
                false:
                    (ptype  : tgg00_PageType);
                END;
            (*ENDCASE*) 
 
 
BEGIN
IF  ord (buf [c_pt_pos]) < ord (ptLastPageType_egg00)
THEN
    BEGIN
    scan    := [utds_display, utds_edit];
    p.c [1] := buf [c_pt_pos];
    CASE p.ptype OF
        ptData_egg00:
            IF  (ord (buf [c_pt2_pos]) = ord (pt2Checkpt_egg00))
            THEN
                scan := scan + [utds_page_header, utds_full_info]
            ELSE
                scan := scan + [utds_page_header];
            (*ENDIF*) 
        ptLog_egg00:
            scan := scan + [utds_page_header];
        ptLogInfo_egg00:
            scan := scan + [utds_page_header, utds_full_info];
        OTHERWISE
            ;
        END;
    (*ENDCASE*) 
    IF  utds_page_header in scan
    THEN
        xt07page_display (term, protfile, scan, file_pos, p.ptype,
              buf, buf_size, pfkey)
    (*ENDIF*) 
    END
(*ENDIF*) 
END;
 
(*------------------------------*) 
 
PROCEDURE
      x07get_next_pno (VAR buf : tsp00_MoveObj;
            buf_size           : tsp00_Int4;
            VAR aux_inv_leaf   : tbd_node;
            VAR curr_down_pno  : tsp00_Int4;
            VAR next_pno       : tsp00_Int4);
 
VAR
      find_next_subtree : boolean;
      subroot           : tgg90_Cint4;
      node              : tbd_nodeptr;
      rec               : tgg00_RecPtr;
 
BEGIN
(* PTS 1104161 JA 1999-10-12 *)
next_pno := NIL_PAGE_NO_GG00;
IF  (ord (buf [c_pt_pos]) = ord (ptData_egg00))
    AND
    (sizeof (tbd_node) <= buf_size)
THEN
    BEGIN
    node := @buf;
    IF  (node^.nd_level > LEAF_LEVEL_BD00) AND (curr_down_pno = NIL_PAGE_NO_GG00)
    THEN
        BEGIN
        IF  (node^.nd_pt2 = pt2Tab_egg00       ) OR
            (node^.nd_pt2 = pt2Inv_egg00       ) OR
            (node^.nd_pt2 = pt2InvSubtree_egg00)
        THEN
            BEGIN
            IF  node^.nd_record_cnt > 0
            THEN
                BEGIN
                rec := @node^.nd_body [ node^.nd_pointer_list[MAX_POINTERINDEX_BD00] ];
                curr_down_pno := gg06PnoGet (rec^.recPno_gg00)
                END
            (*ENDIF*) 
            END
        ELSE
            IF  node^.nd_pt2 = pt2String_egg00
            THEN
                BEGIN
                IF  node^.nd_bottom > BODY_BEG_BD00
                THEN
                    curr_down_pno := node^.nd_pointer_list [1]
                (*ENDIF*) 
                END
            (*ENDIF*) 
        (*ENDIF*) 
        END;
    (*ENDIF*) 
    find_next_subtree := false;
    IF  (node^.nd_pt2   = pt2Inv_egg00   ) AND
        (node^.nd_level = LEAF_LEVEL_BD00)
    THEN
        BEGIN
        aux_inv_leaf         := node^;
        aux_inv_leaf.nd_last := 0;    (* nd_left refers to last invrec *)
        find_next_subtree    := true
        END
    ELSE
        BEGIN
        IF  node^.nd_right <> NIL_PAGE_NO_GG00
        THEN
            next_pno := node^.nd_right
        ELSE
            BEGIN
            next_pno      := curr_down_pno;
            curr_down_pno := NIL_PAGE_NO_GG00
            END;
        (*ENDIF*) 
        IF  (node^.nd_pt2 = pt2InvSubtree_egg00) AND (next_pno = NIL_PAGE_NO_GG00)
        THEN
            find_next_subtree := true
        (*ENDIF*) 
        END;
    (*ENDIF*) 
    IF  find_next_subtree
    THEN
        BEGIN
        (* nd_last refers to last invrec *)
        WHILE (aux_inv_leaf.nd_last + 1 < aux_inv_leaf.nd_record_cnt) AND
              (next_pno = NIL_PAGE_NO_GG00) DO
            BEGIN
            rec := @node^.nd_body
                  [ node^.nd_pointer_list [MAX_POINTERINDEX_BD00 - aux_inv_leaf.nd_last] ];
            IF  rec^.recInvListKind_gg00 = ilkSubTree_egg00
            THEN
                BEGIN
                subroot.ci4_gg00 [1] := rec^.recBody_gg00 [rec^.recKeyLen_gg00+1];
                subroot.ci4_gg00 [2] := rec^.recBody_gg00 [rec^.recKeyLen_gg00+2];
                subroot.ci4_gg00 [3] := rec^.recBody_gg00 [rec^.recKeyLen_gg00+3];
                subroot.ci4_gg00 [4] := rec^.recBody_gg00 [rec^.recKeyLen_gg00+4];
                next_pno := gg06PnoGet (subroot)
                END;
            (*ENDIF*) 
            aux_inv_leaf.nd_last := aux_inv_leaf.nd_last + 1
            END;
        (*ENDWHILE*) 
        IF  next_pno = NIL_PAGE_NO_GG00
        THEN
            next_pno := aux_inv_leaf.nd_right
        (*ENDIF*) 
        END
    (*ENDIF*) 
    END
(*ENDIF*) 
END;
 
(*------------------------------*) 
 
PROCEDURE
      x07headlines_node (VAR term : tut_terminal;
            VAR protfile    : tut_vf_fileref;
            terminal_only   : boolean;
            first_line_only : boolean;
            VAR file_pos    : tut_file_pos;
            VAR buf         : tsp00_MoveObj;
            buf_size        : tsp00_Int4);
 
CONST
      c_col2        = 26;
      c_col3        = 46;
      c_blockno_col = 44;
      mx_margin     =  5;
 
VAR
      is_root  : boolean;
      err      : integer;
      linesize : integer;
      ln_len   : integer;
      transid  : tgg91_TransNo;
      ln       : tsp00_Line;
      node     : tbd_nodeptr;
      fileno   : tsp00_C8;
      i        : integer;
 
BEGIN
node     := @buf;
ln       := term.blankline;
ln_len   := 0;
linesize := t09prot_linesize (term);
is_root  := (node^.nd_id = node^.nd_root);
(* --- P N O --- *)
IF  node^.nd_pt2 = pt2OpenTrans_egg00
THEN
    g17sname_to_line ('OPEN TRANS  ', ln_len, ln)
ELSE
    IF  node^.nd_pt2 = pt2HistoryDirectory_egg00
    THEN
        g17sname_to_line ('HISTORY DIR ', ln_len, ln)
    ELSE
        IF  node^.nd_pt2 = pt2History_egg00
        THEN
            g17sname_to_line ('HISTORY     ', ln_len, ln)
        ELSE
            IF  node^.nd_pt2 = pt2RedoLog_egg00
            THEN
                g17sname_to_line ('REDO LOG    ', ln_len, ln)
            ELSE
                IF  node^.nd_pt2 = pt2UndoLog_egg00
                THEN
                    g17sname_to_line ('UNDO LOG    ', ln_len, ln)
                ELSE
                    IF  node^.nd_pt2 = pt2String_egg00
                    THEN
                        BEGIN
                        g17sname_to_line ('STRING      ', ln_len, ln);
                        IF  is_root
                        THEN
                            g17sname_to_line (' ROOT       ', ln_len, ln)
                        (*ENDIF*) 
                        END
                    ELSE
                        IF  (node^.nd_pt2 = pt2Object_egg00      ) OR
                            (node^.nd_pt2 = pt2VarObject_egg00   ) OR
                            (node^.nd_pt2 = pt2ContObject_egg00  )
                        THEN
                            BEGIN
                            g17sname_to_line ('OBJ         ', ln_len, ln);
                            IF  is_root
                            THEN
                                g17sname_to_line (' ROOT       ', ln_len, ln)
                            (*ENDIF*) 
                            END
                        ELSE
                            IF  (node^.nd_pt2 = pt2Inv_egg00       ) OR
                                (node^.nd_pt2 = pt2InvSubtree_egg00)
                            THEN
                                BEGIN
                                IF  node^.nd_pt2 = pt2InvSubtree_egg00
                                THEN
                                    g17sname_to_line ('INV SUBTREE ', ln_len, ln)
                                ELSE
                                    g17sname_to_line ('INV         ', ln_len, ln);
                                (*ENDIF*) 
                                IF  is_root
                                THEN
                                    BEGIN
                                    IF  node^.nd_level = LEAF_LEVEL_BD00
                                    THEN
                                        g17sname_to_line (' ROOT/LEAF  ', ln_len, ln)
                                    ELSE
                                        g17sname_to_line (' ROOT       ', ln_len, ln)
                                    (*ENDIF*) 
                                    END
                                ELSE
                                    IF  node^.nd_level = LEAF_LEVEL_BD00
                                    THEN
                                        g17sname_to_line (' LEAF       ', ln_len, ln)
                                    (*ENDIF*) 
                                (*ENDIF*) 
                                END
                            ELSE
                                (* NODE *)
                                IF  is_root
                                THEN
                                    BEGIN
                                    IF  node^.nd_level = LEAF_LEVEL_BD00
                                    THEN
                                        g17sname_to_line ('ROOT/LEAF   ', ln_len, ln)
                                    ELSE
                                        g17sname_to_line ('ROOT        ', ln_len, ln)
                                    (*ENDIF*) 
                                    END
                                ELSE
                                    IF  node^.nd_level = LEAF_LEVEL_BD00
                                    THEN
                                        g17sname_to_line ('LEAF        ', ln_len, ln)
                                    ELSE
                                        g17sname_to_line ('NODE        ', ln_len, ln);
                                    (*ENDIF*) 
                                (*ENDIF*) 
                            (*ENDIF*) 
                        (*ENDIF*) 
                    (*ENDIF*) 
                (*ENDIF*) 
            (*ENDIF*) 
        (*ENDIF*) 
    (*ENDIF*) 
(*ENDIF*) 
ln_len := ln_len + 1;
x05pageno_to_line (node^.nd_id, c_trim, ln_len, ln);
ln_len := ln_len + 2;
IF  (node^.nd_pt2 = pt2OpenTrans_egg00)
    OR
    (node^.nd_pt2 = pt2History_egg00)
    OR
    (node^.nd_pt2 = pt2HistoryDirectory_egg00)
THEN
    BEGIN
    g17sname_to_line ('entries:    ', ln_len, ln);
    ln_len  := ln_len + 1;
    g17trimint4_to_line (node^.nd_record_cnt, ln_len, ln);
    END
ELSE
    IF  (node^.nd_pt2 = pt2UndoLog_egg00)
        OR
        (node^.nd_pt2 = pt2RedoLog_egg00)
    THEN
        BEGIN
        (* --- LOG:  T R A N S I D  --- *)
        g17sname_to_line ('T           ', ln_len, ln);
        transid := node^.nd_trans_id;
        gg06TransToLine (transid, ln_len, ln);
        IF  (node^.nd_pt2 = pt2UndoLog_egg00)
        THEN
            BEGIN
            ln_len  := ln_len + 1;
            g17sname_to_line ('lastSeq:    ', ln_len, ln);
            ln_len  := ln_len + 1;
            g17trimint4_to_line (node^.ndInvUsageCnt_bd00, ln_len, ln);
            IF  is_root
            THEN
                BEGIN
                ln_len  := ln_len + 1;
                g17sname_to_line ('pages:      ', ln_len, ln);
                ln_len  := ln_len + 1;
                g17trimint4_to_line (node^.ndLeafCount_bd00, ln_len, ln);
                END;
            (*ENDIF*) 
            END;
        (*ENDIF*) 
        END
    ELSE
        BEGIN
        IF  (node^.nd_pt2 = pt2Object_egg00      ) OR
            (node^.nd_pt2 = pt2VarObject_egg00   ) OR
            (node^.nd_pt2 = pt2ContObject_egg00  )
        THEN
            BEGIN
            IF  node^.nd_pt2 <> pt2Object_egg00
            THEN
                BEGIN
                g17pagetype2_to_line (node^.nd_pt2, ln_len, ln);
                ln_len := ln_len + 2
                END;
            (* ---  C L A S S I D --- *)
            (*ENDIF*) 
            g17sname_to_line ('classId     ', ln_len, ln);
            ln_len := ln_len + 1;
            FOR i:=1 TO sizeof(node^.nd_obj_file_no1) DO
                BEGIN
                fileno[i] := node^.nd_obj_file_no1[i];
                fileno[i+sizeof(node^.nd_obj_file_no1)] := node^.nd_obj_file_no2[i];
                END;
            (*ENDFOR*) 
            g172fileno_to_line (fileno, ln_len, ln);
            ln_len := ln_len + 1;
            IF  NOT is_root
            THEN
                BEGIN
                (* ---  O C C U P I E D   C O U N T --- *)
                IF  ln_len < c_col3
                THEN
                    ln_len := c_col3;
                (*ENDIF*) 
                g17sname_to_line ('occupied:   ', ln_len, ln);
                ln_len := ln_len + 1;
                g17trimint4_to_line (node^.nd_occ_obj_cnt, ln_len, ln);
                ln_len := ln_len + 2
                END
            (*ENDIF*) 
            END
        ELSE
            BEGIN
            (* ---  L E V E L --- *)
            IF  node^.nd_level > LEAF_LEVEL_BD00
            THEN
                BEGIN
                g17sname_to_line ('level       ', ln_len, ln);
                ln_len := ln_len + 1;
                g17trimint4_to_line (node^.nd_level, ln_len, ln);
                ln_len := ln_len + 2
                END;
            (* --- N O D E   T Y P E --- *)
            (*ENDIF*) 
            IF  node^.nd_pmode = [ ]
            THEN
                BEGIN
                g17sname_to_line ('perm        ', ln_len, ln);
                ln_len := ln_len + 2
                END
            ELSE
                BEGIN
                IF  pmTemp_egg00 in node^.nd_pmode
                THEN
                    BEGIN
                    g17sname_to_line ('temp        ', ln_len, ln);
                    ln_len := ln_len + 2
                    END;
                (*ENDIF*) 
                IF  pmCatalog_egg00 in node^.nd_pmode
                THEN
                    BEGIN
                    g17sname_to_line ('catalog     ', ln_len, ln);
                    ln_len := ln_len + 2
                    END;
                (*ENDIF*) 
                IF  pmFdir_egg00 in node^.nd_pmode
                THEN
                    BEGIN
                    g17sname_to_line ('fdir        ', ln_len, ln);
                    ln_len := ln_len + 2
                    END
                (*ENDIF*) 
                END
            (*ENDIF*) 
            END;
        (*ENDIF*) 
        IF  is_root AND (node^.nd_file_state <> [ ])
        THEN
            BEGIN
            g17bd_fstate_to_line (node^.nd_file_state,
                  NOT c_edit, ln_len, ln);
            ln_len := ln_len + 2;
            END;
        (*ENDIF*) 
        IF  (node^.nd_pt2 = pt2Tab_egg00       ) OR
            (node^.nd_pt2 = pt2Inv_egg00       ) OR
            (node^.nd_pt2 = pt2InvSubtree_egg00)
        THEN
            BEGIN
            IF  node^.nd_sorted
            THEN
                BEGIN
                g17sname_to_line ('sorted      ', ln_len, ln);
                ln_len := ln_len + 2
                END;
            (* --- E N T R Y   C O U N T --- *)
            (*ENDIF*) 
            IF  ln_len < c_col2
            THEN
                ln_len := c_col2;
            (*ENDIF*) 
            g17sname_to_line ('entries :   ', ln_len, ln);
            ln_len    := ln_len + 1;
            g17trimint4_to_line (node^.nd_record_cnt, ln_len, ln);
            ln_len := ln_len + 2
            END;
        (*ENDIF*) 
        END;
    (*ENDIF*) 
(*ENDIF*) 
(* --- P A G E   C O U N T --- *)
IF  ln_len < c_blockno_col
THEN
    ln_len := c_blockno_col
ELSE
    ln_len := ln_len - 2;
(*ENDIF*) 
x05blockno_to_line (file_pos, ln_len, ln);
t09put (term, ln, cut_bright_protected);
IF  NOT terminal_only
THEN
    t12write_prot (protfile, ln, ln_len, err);
(*ENDIF*) 
IF  NOT first_line_only AND NOT terminal_only
THEN
    BEGIN
    ln     := term.blankline;
    ln_len := mx_margin;
    IF  (node^.nd_pt2 = pt2Object_egg00      ) OR
        (node^.nd_pt2 = pt2VarObject_egg00   ) OR
        (node^.nd_pt2 = pt2ContObject_egg00  )
    THEN
        BEGIN
        (* --- M A X  O B J E C T   C N T  --- *)
        g17sname_to_line ('max_obj :   ', ln_len, ln);
        ln_len := ln_len + 1;
        g17trimint4_to_line (node^.nd_max_obj_cnt, ln_len, ln)
        END
    ELSE
        BEGIN
        (* --- B O T T O M --- *)
        g17sname_to_line ('bottom  :   ', ln_len, ln);
        ln_len := ln_len + 1;
        g17trimint4_to_line (node^.nd_bottom, ln_len, ln)
        END;
    (*ENDIF*) 
    ln_len := ln_len + 2;
    IF  NOT is_root
    THEN
        (* --- R O O T --- *)
        BEGIN
        IF  ln_len < c_col2
        THEN
            ln_len := c_col2;
        (*ENDIF*) 
        g17sname_to_line ('root    :   ', ln_len, ln);
        ln_len := ln_len + 1;
        x05pageno_to_line (node^.nd_root, c_trim, ln_len, ln);
        ln_len := ln_len + 2
        END;
    (*ENDIF*) 
    IF  is_root
        AND
        (node^.nd_pt2 <> pt2OpenTrans_egg00)
        AND
        (node^.nd_pt2 <> pt2History_egg00)
        AND
        (node^.nd_pt2 <> pt2HistoryDirectory_egg00)
        AND
        (node^.nd_pt2 <> pt2UndoLog_egg00)
        AND
        (node^.nd_pt2 <> pt2RedoLog_egg00)
    THEN
        BEGIN
        IF  ln_len < c_col2
        THEN
            ln_len := c_col2;
        (* --- F I L E   V E R S I O N --- *)
        (*ENDIF*) 
        g17sname_to_line ('filevers:   ', ln_len, ln);
        ln_len := ln_len + 1;
        gg06FileVersToLine (node^.nd_file_version, ln_len, ln);
        ln_len := ln_len + 2
        END;
    (*ENDIF*) 
    IF  ln_len < c_col3
    THEN
        ln_len := c_col3;
    (* --- C O N V   V E R S --- *)
    (*ENDIF*) 
    g17sname_to_line ('convvers:   ', ln_len, ln);
    ln_len := ln_len + 1;
    g17trimint4_to_line (node^.nd_conv_version, ln_len, ln);
    t09put (term, ln, cut_protected);
    IF  NOT terminal_only
    THEN
        t12write_prot (protfile, ln, ln_len, err);
    (*ENDIF*) 
    IF  (node^.nd_pt2 = pt2Object_egg00      ) OR
        (node^.nd_pt2 = pt2VarObject_egg00   ) OR
        (node^.nd_pt2 = pt2ContObject_egg00  )
    THEN
        BEGIN
        ln     := term.blankline;
        ln_len := mx_margin;
        (* --- F R A M E   L E N  --- *)
        IF  node^.nd_obj_key_len > 0
        THEN
            g17sname_to_line ('frame/key   ', ln_len, ln)
        ELSE
            g17sname_to_line ('framelen:   ', ln_len, ln);
        (*ENDIF*) 
        ln_len := ln_len + 1;
        g17trimint4_to_line (node^.nd_obj_frame_len, ln_len, ln);
        IF  node^.nd_obj_key_len > 0
        THEN
            BEGIN
            ln_len := ln_len + 1;
            ln [ln_len] := '/';
            g17trimint4_to_line (node^.nd_obj_key_len, ln_len, ln)
            END;
        (*ENDIF*) 
        ln_len := ln_len + 2;
        (* --- L O C K R E Q S E Q U E N C E --- *)
        IF  ln_len < c_col2
        THEN
            ln_len := c_col2;
        (*ENDIF*) 
        g17sname_to_line ('LockReqSeq: ', ln_len, ln);
        ln_len := ln_len + 1;
        g172Sequence_to_line ( node^.ndLockRequestSeqNoHigh_bd00,
              node^.ndLockRequestSeqNoLow_bd00, ln_len, ln );
        ln_len := ln_len + 1;
        t09put (term, ln, cut_protected);
        IF  NOT terminal_only
        THEN
            t12write_prot (protfile, ln, ln_len, err);
        (*ENDIF*) 
        ln     := term.blankline;
        ln_len := mx_margin;
        (* --- F R E E   O B J   C O U N T --- *)
        g17sname_to_line ('free_cnt:   ', ln_len, ln);
        ln_len := ln_len + 1;
        g17trimint4_to_line (node^.nd_free_obj_cnt, ln_len, ln);
        ln_len := ln_len + 2;
        IF  ln_len < c_col2
        THEN
            ln_len := c_col2;
        (* --- N E X T   F R E E  --- *)
        (*ENDIF*) 
        g17sname_to_line ('nextfree:   ', ln_len, ln);
        ln_len := ln_len + 1;
        x05pageno_to_line (node^.nd_next_free, c_trim, ln_len, ln);
        ln_len := ln_len + 2;
        IF  NOT is_root
        THEN
            BEGIN
            IF  ln_len < c_col3
            THEN
                ln_len := c_col3;
            (* --- R I G H T  --- *)
            (*ENDIF*) 
            g17sname_to_line ('right   :   ', ln_len, ln);
            ln_len := ln_len + 1;
            x05pageno_to_line (node^.nd_right, c_trim, ln_len, ln)
            END;
        (*ENDIF*) 
        t09put (term, ln, cut_protected);
        IF  NOT terminal_only
        THEN
            t12write_prot (protfile, ln, ln_len, err);
        (*ENDIF*) 
        ln     := term.blankline;
        ln_len := mx_margin;
        (* --- F R E E   E O T   O B J   C O U N T --- *)
        g17sname_to_line ('free_eot:   ', ln_len, ln);
        ln_len := ln_len + 1;
        g17trimint4_to_line (node^.nd_free_eot_obj_cnt, ln_len, ln);
        ln_len := ln_len + 2;
        (* --- L E F T --- *)
        IF  NOT is_root
        THEN
            BEGIN
            IF  ln_len < c_col2
            THEN
                ln_len := c_col2;
            (*ENDIF*) 
            g17sname_to_line ('left    :   ', ln_len, ln);
            ln_len := ln_len + 1;
            x05pageno_to_line (node^.nd_left, c_trim, ln_len, ln)
            END;
        (*ENDIF*) 
        t09put (term, ln, cut_protected);
        IF  NOT terminal_only
        THEN
            t12write_prot (protfile, ln, ln_len, err);
        (*ENDIF*) 
        END
    ELSE
        (* node, string *)
        BEGIN
        ln     := term.blankline;
        ln_len := mx_margin;
        IF  node^.nd_pt2 = pt2String_egg00
        THEN
            BEGIN
            (* --- F I L E S I Z E --- *)
            g17sname_to_line ('filesize:   ', ln_len, ln);
            ln_len := ln_len + 1;
            g17trimint4_to_line (node^.ndStrFileSize_bd00, ln_len, ln)
            END;
        (*ENDIF*) 
        IF  (node^.nd_pt2 = pt2UndoLog_egg00)
            OR
            (node^.nd_pt2 = pt2RedoLog_egg00)
            OR
            (node^.nd_pt2 = pt2History_egg00)
            OR
            (node^.nd_pt2 = pt2HistoryDirectory_egg00)
            OR
            (node^.nd_pt2 = pt2OpenTrans_egg00)
        THEN
            BEGIN
            (* --- L A S T  --- *)
            g17sname_to_line ('last    :   ', ln_len, ln);
            ln_len := ln_len + 1;
            x05pageno_to_line (node^.nd_last, c_trim, ln_len, ln)
            END;
        (*ENDIF*) 
        ln_len := ln_len + 2;
        IF  ln_len < c_col2
        THEN
            ln_len := c_col2;
        (*ENDIF*) 
        IF  NOT is_root
            OR
            (node^.nd_pt2 = pt2UndoLog_egg00)
            OR
            (node^.nd_pt2 = pt2RedoLog_egg00)
            OR
            (node^.nd_pt2 = pt2History_egg00)
            OR
            (node^.nd_pt2 = pt2HistoryDirectory_egg00)
            OR
            (node^.nd_pt2 = pt2OpenTrans_egg00)
            OR
            (node^.nd_pt2 = pt2String_egg00)
        THEN
            BEGIN
            (* --- R I G H T  /  N E X T  --- *)
            IF  (node^.nd_pt2 = pt2UndoLog_egg00)
                OR
                (node^.nd_pt2 = pt2RedoLog_egg00)
                OR
                (node^.nd_pt2 = pt2History_egg00)
                OR
                (node^.nd_pt2 = pt2HistoryDirectory_egg00)
                OR
                (node^.nd_pt2 = pt2OpenTrans_egg00)
            THEN
                g17sname_to_line ('next    :   ', ln_len, ln)
            ELSE
                g17sname_to_line ('right   :   ', ln_len, ln);
            (*ENDIF*) 
            ln_len := ln_len + 1;
            x05pageno_to_line (node^.nd_right, c_trim, ln_len, ln);
            ln_len := ln_len + 2
            END;
        (*ENDIF*) 
        IF  ln_len < c_col3
        THEN
            ln_len := c_col3;
        (*ENDIF*) 
        IF  (node^.nd_pt2 = pt2UndoLog_egg00)
            OR
            (node^.nd_pt2 = pt2RedoLog_egg00)
            OR
            (node^.nd_pt2 = pt2History_egg00)
            OR
            (node^.nd_pt2 = pt2HistoryDirectory_egg00)
            OR
            (node^.nd_pt2 = pt2OpenTrans_egg00)
        THEN
            BEGIN
            g17sname_to_line ('prev    :   ', ln_len, ln);
            ln_len := ln_len + 1;
            x05pageno_to_line (node^.nd_left, c_trim, ln_len, ln);
            END
        ELSE
            BEGIN
            g17sname_to_line ('writecnt:   ', ln_len, ln);
            ln_len := ln_len + 1;
            g17trimint4_to_line (node^.nd_write_cnt, ln_len, ln);
            END;
        (*ENDIF*) 
        t09put (term, ln, cut_protected);
        IF  NOT terminal_only
        THEN
            t12write_prot (protfile, ln, ln_len, err);
        (*ENDIF*) 
        IF  node^.nd_pt2 = pt2String_egg00
        THEN
            BEGIN
            ln     := term.blankline;
            ln_len := mx_margin;
            IF  is_root
            THEN
                BEGIN
                (* --- S T R   V E R S I O N --- *)
                g17sname_to_line ('str_vers:   ', ln_len, ln);
                ln_len := ln_len + 1;
                g17trimint4_to_line (node^.nd_str_version, ln_len, ln);
                ln_len := ln_len + 1;
                g17sname_to_line ('parentId:   ', ln_len, ln);
                ln_len := ln_len + 1;
                g17surrogate_to_line (node^.ndStrParentID_bd00, ln_len, ln);
                ln_len := ln_len + 1;
                END;
            (*ENDIF*) 
            IF  ln_len < c_col2
            THEN
                ln_len := c_col2;
            (* --- L E F T   --- *)
            (*ENDIF*) 
            IF  NOT is_root
            THEN
                BEGIN
                g17sname_to_line ('left   :    ', ln_len, ln);
                ln_len := ln_len + 1;
                x05pageno_to_line (node^.nd_left, c_trim, ln_len, ln);
                ln_len := ln_len + 2;
                END;
            (*ENDIF*) 
            t09put (term, ln, cut_protected);
            IF  NOT terminal_only
            THEN
                t12write_prot (protfile, ln, ln_len, err)
            (*ENDIF*) 
            END
        (*ENDIF*) 
        END
    (*ENDIF*) 
    END;
(*ENDIF*) 
IF  sizeof (node^) > buf_size
THEN
    xt07bad_size_msg (term, protfile, buf_size, sizeof (node^), 'node        ')
(*ENDIF*) 
END;
 
(*------------------------------*) 
 
FUNCTION
      x07is_fdir_leaf (VAR buf : tsp00_MoveObj): boolean;
 
VAR
      is_leaf : boolean;
      rec_pos : integer;
      rec_len : tsp00_IntMapC2;
      key_len : tsp00_IntMapC2;
      node    : tbd_nodeptr;
 
BEGIN
is_leaf := false;
IF  ord (buf [c_pt_pos]) = ord (ptData_egg00)
THEN
    BEGIN
    node := @buf;
    IF  (node^.nd_level    = 0) AND
        (node^.nd_record_cnt > 0)
    THEN
        BEGIN
        rec_pos := node^.nd_pointer_list [MAX_POINTERINDEX_BD00];
        rec_len.mapC2_sp00 [1] := buf [rec_pos  ];
        rec_len.mapC2_sp00 [2] := buf [rec_pos+1];
        key_len.mapC2_sp00 [1] := buf [rec_pos+2];
        key_len.mapC2_sp00 [2] := buf [rec_pos+3];
        is_leaf :=
              (key_len.mapInt_sp00 = sizeof (tgg00_Filename))
              AND
              ((rec_len.mapInt_sp00 = sizeof (tbd00_FDirEntry)) OR
              ( rec_len.mapInt_sp00 = STD_FDIRENTRY_MXBD00     ))
        END
    (*ENDIF*) 
    END;
(*ENDIF*) 
x07is_fdir_leaf := is_leaf
END;
 
(*------------------------------*) 
 
PROCEDURE
      x07keys_display (VAR term : tut_terminal;
            VAR protfile : tut_vf_fileref;
            VAR file_pos : tut_file_pos;
            VAR buf      : tsp00_MoveObj;
            buf_size     : tsp00_Int4;
            VAR pfkey    : tut_pfkey);
 
BEGIN
IF  ord (buf [c_pt_pos]) = ord (ptData_egg00)
THEN
    xt07page_display (term, protfile,
          [utds_page_header, utds_node, utds_key, utds_display],
          file_pos, ptData_egg00,
          buf, buf_size, pfkey)
ELSE
    t09put30 (term, 'INVALID PAGE TYPE             ',
          cut_bright_protected)
(*ENDIF*) 
END;
 
(*------------------------------*) 
 
PROCEDURE
      x07node_display (VAR term : tut_terminal;
            VAR protfile    : tut_vf_fileref;
            scan            : tut_diag_scan;
            VAR file_pos    : tut_file_pos;
            trunc_buflength : tsp00_Int4;
            VAR buf         : tsp00_MoveObj;
            buf_size        : tsp00_Int4;
            VAR pfkey       : tut_pfkey);
 
TYPE
 
      RecordListElement = RECORD
            CASE integer OF
                1:
                    (rlePos : tsp00_Int2;
                    rleLen  : tsp00_Int2);
                2:
                    (rlePosition : tsp00_Int4);
                END;
            (*ENDCASE*) 
 
 
VAR
      scan_records     : boolean;
      is_help          : boolean;
      ln_attr          : char;
      char_per_line    : integer;
      dummy_size       : integer;
      err              : integer;
      i                : integer;
      lines_per_tdline : integer;
      lines_tdbuf      : integer;
      ln_len           : integer;
      new_ln_offset    : integer;
      pointer_index    : integer;
      min_index        : tsp00_Int4;
      recordInfo       : RecordListElement;
      rec_pos          : tsp00_Int4;
      rec_len          : tsp00_Int4;
      pKey             : tsp00_KeyPtr;
      recBodyPtr       : ^tgg00_RecBody;
      break_pos        : tsp00_Int4;
      lwb              : tsp00_Int4;
      upb              : tsp00_Int4;
      ln               : tsp00_Line;
      rec_msg          : tsp00_C30;
      rec              : tgg00_RecPtr;
      node             : tbd_nodeptr;
      pLeafCount       : ^tbd00_SepLeafCount;
 
BEGIN
pfkey    := pf_none;
node     := @buf;
ln       := term.blankline;
ln_len   := 0;
t14bufdimension (term, scan, char_per_line, dummy_size, lines_per_tdline);
x07headlines_node (term, protfile, NOT c_term_only, NOT c_first_only, file_pos, buf, buf_size);
IF  utds_full_info in scan
THEN
    BEGIN
    t12write_prot (protfile, term.blankline, 1, err);
    IF  NOT t09is_window_full (term, 1)
    THEN
        t09put (term, term.blankline, cut_protected);
    (*ENDIF*) 
    x08node_edit_display (term, protfile, scan, file_pos, buf, buf_size, pfkey)
    END;
(*ENDIF*) 
IF  (pfkey = pf_none) AND (utds_node in scan)
THEN
    BEGIN
    t12write_prot (protfile, term.blankline, 1, err);
    IF  NOT t09is_window_full (term, 1)
    THEN
        t09put (term, term.blankline, cut_protected)
    (*ENDIF*) 
    END;
(*ENDIF*) 
IF  (pfkey = pf_none)
    AND
    (node^.nd_pt2 = pt2String_egg00)
    AND
    (node^.nd_level = LEAF_LEVEL_BD00)
    AND
    (node^.nd_bottom > NODE_HEADER_MXBD00 + 1)
    AND
    (utds_rec in scan)
THEN
    BEGIN
    lwb := NODE_HEADER_MXBD00 + 1;
    upb := node^.nd_bottom - 1;
    IF  NODE_HEADER_MXBD00 + trunc_buflength < upb
    THEN
        upb := NODE_HEADER_MXBD00 + trunc_buflength;
    (*ENDIF*) 
    lines_tdbuf := 2 + ((upb - NODE_HEADER_MXBD00 + char_per_line-1)
          DIV char_per_line) * lines_per_tdline;
    t09setpf1 (term, cut_pfkey_hexint);
    REPEAT
        is_help := false;
        t14bufdisplay (term, protfile,
              scan + [utds_double_numbering], bsp_c30,
              buf, sizeof (node^), lwb, upb, 1, break_pos, pfkey);
        IF  pfkey = pf_help
        THEN
            BEGIN
            lwb     := break_pos;
            is_help := true;
            x05helphexint (term, pfkey)
            END;
        (*ENDIF*) 
    UNTIL
        NOT is_help;
    (*ENDREPEAT*) 
    t09setpf1 (term, cut_pfkey_none)
    END;
(*ENDIF*) 
IF  (node^.nd_pt2 =  pt2String_egg00) OR
    (pfkey        <> pf_none        ) OR
    NOT (utds_node in scan)
THEN
    BEGIN
    IF  (node^.nd_pt2 =  pt2String_egg00) AND
        ((utds_rec IN scan) OR (utds_key IN scan))
    THEN
        xt07_DisplayLongColumnNode (term, protfile, node, pfkey);
    (*ENDIF*) 
    scan_records := false;
    END
ELSE
    scan_records := node^.nd_record_cnt > 0;
(*ENDIF*) 
IF  scan_records
THEN
    BEGIN
    IF  utds_rec in scan
    THEN
        ln_attr := cut_bright_protected
    ELSE
        ln_attr := cut_protected;
    (*ENDIF*) 
    pointer_index := MAX_POINTERINDEX_BD00;
    min_index     := MAX_POINTERINDEX_BD00 - node^.nd_record_cnt + 1;
    i             := 0;
    WHILE (pfkey = pf_none) AND (pointer_index >= min_index) DO
        BEGIN
        i := i + 1;
        IF  t09is_window_full (term, 1)
            OR
            (utds_rec in scan)
            OR
            (t09is_window_full (term, 2) AND (i MOD 10 = 0))
        THEN
            BEGIN
            x05holdhexint (term, pfkey);
            IF  pfkey = pf_none
            THEN
                t09newscreen_page (term)
            (*ENDIF*) 
            END;
        (*ENDIF*) 
        recordInfo.rlePosition := node^.nd_pointer_list [pointer_index];
        IF  node^.ndPageVersion_bd00 > 0
        THEN
            rec_pos := recordInfo.rlePos
        ELSE
            rec_pos := recordInfo.rlePosition;
        (*ENDIF*) 
        IF  (pfkey = pf_none) AND (rec_pos >= BODY_BEG_BD00) AND (rec_pos < BODY_END_BD00)
        THEN
            BEGIN
            IF  (i MOD 10 = 0)
                AND NOT (utds_rec in scan)
                AND     (utds_key in scan)
            THEN
                BEGIN
                t12write_prot (protfile, term.blankline, 1, err);
                IF  NOT t09is_empty_window (term)
                THEN
                    t09put (term, term.blankline, cut_protected)
                (*ENDIF*) 
                END;
            (*ENDIF*) 
            rec     := @buf [rec_pos];
            ln      := term.blankline;
            ln_len  := 0;
            g17int4to_line (i, NOT c_with_zero, 3, ln_len+1, ln);
            ln_len        := ln_len + 5;
            ln [ln_len-1] := ':';
            g17sname_to_line ('(pos        ', ln_len, ln);
            ln_len      := ln_len + 1 + c_pos_digits + 1;
            ln [ln_len] := ')';
            g17int4to_line (rec_pos, true, c_pos_digits, ln_len - c_pos_digits, ln);
            ln_len := ln_len + 1;
            IF  node^.nd_level > LEAF_LEVEL_BD00
            THEN
                BEGIN
                ln [ln_len+1] := '-';
                ln [ln_len+2] := '>';
                ln_len        := ln_len + 3;
                x05pageno_to_line (gg06PnoGet (rec^.recPno_gg00), c_trim, ln_len, ln);
                ln_len  := ln_len + 2;
                ln [ln_len] := '#';
                pLeafCount := @(rec^.recBody_gg00[rec^.recKeyLen_gg00+1]);
                g17trimint4_to_line(gg06PnoGet (pLeafCount^), ln_len, ln);
                ln_len  := ln_len + 1;
                END;
            (*ENDIF*) 
            IF  ((utds_key in scan) AND
                (      NOT (pmFdir_egg00 in node^.nd_pmode) OR (node^.nd_level > LEAF_LEVEL_BD00)))
                (*     keys are already displayed as filenames of filedirectory-entries *)
                OR
                (utds_key_buf in scan)
                OR
                ((utds_key_first_last in scan) AND
                (  (pointer_index = min_index)
                OR (pointer_index = MAX_POINTERINDEX_BD00)
                OR (node^.nd_level > LEAF_LEVEL_BD00)))
            THEN
                BEGIN
                new_ln_offset := ln_len;
                IF  node^.nd_level = LEAF_LEVEL_BD00
                THEN
                    BEGIN
                    IF  node^.ndPageVersion_bd00 > 0
                    THEN
                        rec_len := recordInfo.rleLen
                    ELSE
                        rec_len := rec^.recKeyLen_gg00;
                    (*ENDIF*) 
                    IF  rec_len  = 0
                    THEN
                        g17sname_to_line ('zerokey     ', ln_len, ln)
                    ELSE
                        BEGIN
                        g17sname_to_line   ('key(        ',      ln_len, ln);
                        IF  node^.ndPageVersion_bd00 > 0
                        THEN
                            g17trimint4_to_line(rec_len, ln_len, ln)
                        ELSE
                            g17trimint4_to_line(rec^.recKeyLen_gg00, ln_len, ln);
                        (*ENDIF*) 
                        g17sname_to_line   ('):          ',      ln_len, ln)
                        END
                    (*ENDIF*) 
                    END
                ELSE
                    BEGIN
                    g17sname_to_line    ('sep(        ',      ln_len, ln);
                    g17trimint4_to_line (rec^.recKeyLen_gg00, ln_len, ln);
                    ln_len      := ln_len + 1;
                    ln [ln_len] := ')';
                    IF  rec^.recKeyLen_gg00 <> 0
                    THEN
                        BEGIN
                        ln_len      := ln_len + 1;
                        ln [ln_len] := ':'
                        END
                    (*ENDIF*) 
                    END;
                (*ENDIF*) 
                IF  rec^.recKeyLen_gg00 > 0
                THEN
                    BEGIN
                    ln_len := ln_len + 1;
                    IF  node^.ndPageVersion_bd00 > 0
                    THEN
                        BEGIN
                        recBodyPtr := @rec^.recBuf_gg00[1];
                        IF  x05ishex (recBodyPtr^, buf_size - rec_pos + 1, 1, rec_len)
                            OR
                            (utds_key_buf in scan)
                        THEN
                            x05hexwriteln (term, protfile, utds_key_buf in scan, scan,
                                  recBodyPtr^, buf_size - rec_pos + 1,
                                  1, rec_len, new_ln_offset, ln_len, ln, ln_attr)
                        ELSE
                            x05charwriteln (term, protfile,
                                  recBodyPtr^, buf_size - rec_pos + 1,
                                  1, rec_len, new_ln_offset, ln_len, ln, ln_attr)
                        (*ENDIF*) 
                        END
                    ELSE
                        IF  x05ishex (rec^.recBody_gg00,
                            buf_size - rec_pos + 1 - sizeof (tgg00_HeaderRec), 1, rec^.recKeyLen_gg00)
                            OR
                            (utds_key_buf in scan)
                        THEN
                            x05hexwriteln (term, protfile,
                                  utds_key_buf in scan, scan,
                                  rec^.recBody_gg00, buf_size - rec_pos + 1 - sizeof (tgg00_HeaderRec),
                                  1, rec^.recKeyLen_gg00, new_ln_offset,
                                  ln_len, ln, ln_attr)
                        ELSE
                            x05charwriteln (term, protfile,
                                  rec^.recBody_gg00, buf_size - rec_pos + 1 - sizeof (tgg00_HeaderRec),
                                  1, rec^.recKeyLen_gg00, new_ln_offset,
                                  ln_len, ln, ln_attr);
                        (*ENDIF*) 
                    (*ENDIF*) 
                    END
                ELSE
                    BEGIN
                    t12write_prot (protfile, ln, ln_len, err);
                    t09put (term, ln, cut_protected)
                    END
                (*ENDIF*) 
                END
            ELSE
                IF  ((utds_key in scan) OR (utds_rec in scan))
                    AND
                    (node^.nd_level = LEAF_LEVEL_BD00)
                    AND
                    (pmFdir_egg00 in node^.nd_pmode)
                THEN
                    BEGIN
                    xt07fdir_key_to_line (buf, buf_size, rec_pos,
                          rec^.recLen_gg00, ln_len, ln);
                    t12write_prot (protfile, ln, ln_len, err);
                    t09put (term, ln,  cut_protected)
                    END
                ELSE
                    IF  utds_rec in scan
                    THEN
                        BEGIN
                        t12write_prot (protfile, ln, ln_len, err);
                        t09put (term, ln, cut_protected)
                        END;
                    (*ENDIF*) 
                (*ENDIF*) 
            (*ENDIF*) 
            IF  (utds_rec in scan)
                AND
                (node^.nd_level = LEAF_LEVEL_BD00)
                AND
                (pmFdir_egg00 in node^.nd_pmode)
            THEN
                x08fdir_rec_edit (term, protfile, buf, buf_size,
                      rec_pos - 1, NOT c_edit, pfkey)
            ELSE
                IF  (utds_rec in scan) AND (pfkey = pf_none)
	                AND
	                (node^.ndPageVersion_bd00 = 0)
                THEN
                    BEGIN
                    lwb := rec_pos;
                    upb := rec_pos + rec^.recLen_gg00 - 1;
                    IF  rec_pos + trunc_buflength - 1 < upb
                    THEN
                        upb := rec_pos + trunc_buflength - 1;
                    (*ENDIF*) 
                    lines_tdbuf := 2 + ((upb - rec_pos + 1
                          + char_per_line-1) DIV char_per_line)
                          * lines_per_tdline;
                    IF  node^.nd_level = LEAF_LEVEL_BD00
                    THEN
                        x08rec_edit (term, protfile, buf, buf_size, rec_pos-1, NOT c_edit,
                              (pmCatalog_egg00 in node^.nd_pmode), node^.nd_pt2, pfkey)
                    ELSE
                        x08tree_index_rec_edit (term, protfile, buf, buf_size, rec_pos-1,
                              NOT c_edit, pfkey);
                    (*ENDIF*) 
                    ln     := term.blankline;
                    ln_len := 5;
                    IF  node^.nd_level > LEAF_LEVEL_BD00
                    THEN
                        rec_msg := '     separator record         '
                    ELSE
                        IF  pmCatalog_egg00 in node^.nd_pmode
                        THEN
                            rec_msg := '     catalog record           '
                        ELSE
                            IF  node^.nd_pt2 = pt2Inv_egg00
                            THEN
                                rec_msg := '     inv entry                '
                            ELSE
                                IF  node^.nd_pt2 = pt2InvSubtree_egg00
                                THEN
                                    rec_msg := '     inv subtree entry        '
                                ELSE
                                    rec_msg := '     record                   ';
                                (*ENDIF*) 
                            (*ENDIF*) 
                        (*ENDIF*) 
                    (*ENDIF*) 
                    t09setpf1 (term, cut_pfkey_hexint);
                    REPEAT
                        is_help := false;
                        t14bufdisplay (term, protfile,
                              scan + [utds_double_numbering], rec_msg,
                              buf, buf_size, lwb, upb, 1,
                              break_pos, pfkey);
                        IF  pfkey = pf_help
                        THEN
                            BEGIN
                            lwb     := break_pos;
                            is_help := true;
                            x05helphexint (term, pfkey)
                            END;
                        (*ENDIF*) 
                    UNTIL
                        NOT is_help;
                    (*ENDREPEAT*) 
                    t09setpf1 (term, cut_pfkey_none)
                    END
                (*ENDIF*) 
            (*ENDIF*) 
            END;
        (*ENDIF*) 
        pointer_index := pointer_index - 1
        END
    (*ENDWHILE*) 
    END
(*ENDIF*) 
END;
 
(*------------------------------*) 
 
PROCEDURE
      x07object_node_display (VAR term : tut_terminal;
            VAR protfile    : tut_vf_fileref;
            scan            : tut_diag_scan;
            VAR file_pos    : tut_file_pos;
            trunc_buflength : tsp00_Int4;
            VAR buf         : tsp00_MoveObj;
            buf_size        : tsp00_Int4;
            VAR pfkey       : tut_pfkey);
 
CONST
&     ifdef BIT64
      alignment  = 8;
&     else
      alignment  = 4;
&     endif
 
VAR
      is_help           : boolean;
      is_root           : boolean;
      char_per_line     : integer;
      dummy_size        : integer;
      err               : integer;
      lines_per_tdline  : integer;
      lines_tdbuf       : integer;
      break_pos         : tsp00_Int4;
      count             : tsp00_Int4;
      ln_len            : tsp00_Int4;
      linesize          : tsp00_Int4;
      pos               : tsp00_Int4;
      lwb               : tsp00_Int4;
      upb               : tsp00_Int4;
      obj_frame_len     : tsp00_Int4;
      obj_distance      : tsp00_Int4;
      ObjTransInfo      : tgg00_ObjTransInfo;
      NextFreeObj       : tgg00_ObjPagePos;
      ObjState          : tgg00_ObjState;
      ObjFrameVers      : tgg00_ObjFrameVers;
      node              : tbd_nodeptr;
      rec_msg           : tsp00_C30;
      ln                : tsp00_Line;
 
BEGIN
pfkey       := pf_none;
node        := @buf;
is_root     := (node^.nd_id = node^.nd_root) OR (NIL_PAGE_NO_GG00 = node^.nd_root);
linesize    := t09prot_linesize (term);
t14bufdimension (term, scan, char_per_line, dummy_size,
      lines_per_tdline);
x07headlines_node (term, protfile, NOT c_term_only, NOT c_first_only,
      file_pos, buf, buf_size);
IF  utds_full_info in scan
THEN
    BEGIN
    t12write_prot (protfile, term.blankline, 1, err);
    IF  NOT t09is_window_full (term, 1)
    THEN
        t09put (term, term.blankline, cut_protected);
    (*ENDIF*) 
    x08object_node_edit_display (term, protfile, scan, file_pos,
          buf, buf_size, pfkey)
    END;
(*ENDIF*) 
IF  (pfkey = pf_none)
    AND
    ((utds_key in scan) OR (utds_rec in scan))
    AND
    (sizeof (node^) <= buf_size)
THEN
    BEGIN
    t12write_prot (protfile, term.blankline, 1, err);
    IF  NOT t09is_window_full (term, 1)
    THEN
        t09put (term, term.blankline, cut_protected);
    (* *)
    (* --- O B J E C T  C O N T A I N E R  H E A D E R --- *)
    (* *)
    (*ENDIF*) 
    count         := 1;
    pos           := gg06Int4FromUint2 (node^.nd_first_obj) + POS_OFF_DIFF_BD00;
    obj_frame_len := gg06Int4FromUint2 (node^.nd_obj_frame_len);
    obj_distance  := (((obj_frame_len-1) DIV alignment) + 1) * alignment;
    WHILE (count <= node^.nd_max_obj_cnt) AND (pfkey = pf_none) DO
        BEGIN
        ln           := term.blankline;
        ln_len       := 0;
        gg06GetObjHeaderParam (@node^.nd_body [pos],
              ObjTransInfo, NextFreeObj, ObjState, ObjFrameVers);
        (* *)
        g17int4to_line (count, NOT c_with_zero, 3, ln_len+1, ln);
        ln_len        := ln_len + 5;
        ln [ln_len-1] := ':';
        g17sname_to_line ('(pos        ', ln_len, ln);
        ln_len      := ln_len + 1 + c_pos_digits + 1;
        ln [ln_len] := ')';
        g17int4to_line (pos, true, c_pos_digits,
              ln_len - c_pos_digits, ln);
        ln_len        := ln_len + 1;
        IF  (utds_key in scan)
        THEN
            BEGIN
            (* *)
            (*--- E X C L L O C K I D ---*)
            (* *)
            (* g17sname_to_line (' LockId:    ', ln_len, ln);     PTS 1126294 FF 2003-DEC-15 *)
            (* ln_len := ln_len + 1;                              PTS 1126294 FF 2003-DEC-15 *)
            g17obj_transinfo_to_line (ObjTransInfo, ln_len, ln);
            (* *)
            (*--- N E X T   F R E E ---*)
            (* *)
            g17sname_to_line (' Next:      ', ln_len, ln);
            ln_len := ln_len + 1;
            IF  NextFreeObj = 0
            THEN
                g17sname_to_line (' nil        ', ln_len, ln)
            ELSE
                g17trimint4_to_line (NextFreeObj, ln_len, ln);
            (*ENDIF*) 
            (* *)
            (*--- S T A T E ---*)
            (* *)
            (* PTS 1126294 FF 2003-DEC-15 *)
            IF  ( sizeof(ln) - ln_len ) > 17
            THEN
                BEGIN
                g17sname_to_line (' Stat:      ', ln_len, ln);     (* PTS 1126294 FF 2003-DEC-15 *)
                ln_len := ln_len + 1;
                g17obj_state_to_line (ObjState, ln_len, ln);
                END;
            (* *)
            (*--- V E R S I O N ---*)
            (* *)
            (* PTS 1126294 FF 2003-DEC-15 *)
            (*ENDIF*) 
            IF  ( sizeof(ln) - ln_len ) > 8
            THEN
                BEGIN
                g17sname_to_line (' Vers:      ', ln_len, ln);    (* PTS 1126294 FF 2003-DEC-15 *)
                ln_len := ln_len + 1;
                g17int4to_line (ObjFrameVers, false, 3, ln_len, ln) (* PTS 1126294 FF 2003-DEC-15 *)
                END;
            (*ENDIF*) 
            END;
        (*ENDIF*) 
        xt07write_prot (protfile, ln);
        t09put (term, ln, cut_protected);
        IF  t09is_window_full (term, 1)
        THEN
            BEGIN
            x05holdhexint (term, pfkey);
            IF  pfkey = pf_none
            THEN
                t09newscreen_page (term)
            (*ENDIF*) 
            END;
        (*ENDIF*) 
        IF  (utds_rec in scan)
        THEN
            BEGIN
            lwb := pos;
            upb := pos + obj_frame_len - 1;
            IF  pos + trunc_buflength - 1 < upb
            THEN
                upb := pos + trunc_buflength - 1;
            (*ENDIF*) 
            lines_tdbuf := 2 + ((upb - pos + 1 + char_per_line - 1)
                  DIV char_per_line) * lines_per_tdline;
            ln     := term.blankline;
            ln_len := 5;
            g17nameto_line ('object length:    ', ln_len, ln);
            ln_len := ln_len + 1;
            g17trimint4_to_line (obj_frame_len, ln_len, ln);
            SAPDB_PascalForcedMove (sizeof (ln), sizeof (rec_msg),
                  @ln, 1, @rec_msg, 1, sizeof (rec_msg));
            t09setpf1 (term, cut_pfkey_hexint);
            REPEAT
                is_help := false;
                t14bufdisplay (term, protfile,
                      scan + [utds_double_numbering], rec_msg,
                      buf, buf_size, lwb, upb, 1, break_pos, pfkey);
                IF  pfkey = pf_help
                THEN
                    BEGIN
                    lwb     := break_pos;
                    is_help := true;
                    x05helphexint (term, pfkey)
                    END;
                (*ENDIF*) 
            UNTIL
                NOT is_help;
            (*ENDREPEAT*) 
            t09setpf1 (term, cut_pfkey_none)
            END;
        (* *)
        (*ENDIF*) 
        count := count + 1;
        pos   := pos + obj_distance;
        END
    (*ENDWHILE*) 
    END
(*ENDIF*) 
END;
 
(*------------------------------*) 
 
PROCEDURE
      xt07bad_size_msg (VAR term : tut_terminal;
            VAR protfile  : tut_vf_fileref;
            buf_size      : tsp00_Int4;
            wanted_size   : tsp00_Int4;
            page_typename : tsp00_Sname);
 
VAR
      err    : integer;
      ln_len : integer;
      ln     : tsp00_Line;
 
BEGIN
ln           := term.blankline;
ln_len       := 0;
(* --- P N O --- *)
g17nameto_line   ('*** TOO SHORT:    ', ln_len, ln);
g17sname_to_line (' input page ', ln_len, ln);
ln_len := ln_len + 1;
g17trimint4_to_line (buf_size, ln_len, ln);
ln [ln_len + 2] := '<';
ln_len := ln_len + 1;
g17sname_to_line (page_typename, ln_len, ln);
ln_len := ln_len + 1;
g17trimint4_to_line (wanted_size, ln_len, ln);
t12write_prot (protfile, ln, ln_len, err);
t09put (term, ln, cut_bright_protected)
END;
 
(*------------------------------*) 
 
PROCEDURE
      xt07fdir_key_to_line (VAR buf : tsp00_MoveObj;
            buf_size   : tsp00_Int4;
            rec_pos    : integer;
            rec_len    : integer;
            VAR ln_len : integer;
            VAR ln     : tsp00_Line);
 
VAR
      dummy_bool : boolean;
      len        : integer;
      offset     : integer;
      fn_ln      : tsp00_Line;
      dummy_ln2  : tsp00_Line;
      dummy_ln3  : tsp00_Line;
      fdir       : tbd00_FDirEntry;
 
BEGIN
IF  rec_len > sizeof (fdir)
THEN
    rec_len := sizeof (fdir);
(*ENDIF*) 
SAPDB_PascalForcedMove (buf_size, sizeof (fdir), @buf, rec_pos, @fdir, 1, rec_len);
g17sname_to_line ('root        ', ln_len, ln);
ln_len := ln_len + 1;
g17trimint4_to_line (fdir.fdirFileInfo_bd00.fi_root, ln_len, ln);
ln_len  := ln_len + 2;
IF  ord (fdir.fdirFileName_bd00 [1]) = ord (tfnAux_egg00)
THEN
    BEGIN
    g17sname_to_line ('tfnAux      ', ln_len, ln);
    ln_len := ln_len + 1;
    FOR len := 1 TO sizeof (fdir.fdirFileName_bd00) DO
        g17hexto_line (fdir.fdirFileName_bd00 [len], ln_len, ln)
    (*ENDFOR*) 
    END
ELSE
    BEGIN
    g17filename (bsp_sname, fdir.fdirFileName_bd00, 0, fn_ln, dummy_ln2, dummy_ln3, dummy_bool);
    offset  := sizeof (tsp00_Sname) + 3;
    len := sizeof (fn_ln);
    WHILE (len > offset) AND (fn_ln [len] = ' ') DO
        len := len - 1;
    (*ENDWHILE*) 
    len := len - offset;
    IF  len > sizeof (ln) - ln_len
    THEN
        len := sizeof (ln) - ln_len;
    (*ENDIF*) 
    SAPDB_PascalForcedMove (sizeof (fn_ln), sizeof (ln),
          @fn_ln, offset + 1, @ln, ln_len + 1, len);
    ln_len := ln_len + len
    END
(*ENDIF*) 
END;
 
(*------------------------------*) 
 
PROCEDURE
      xt07page_display (VAR term : tut_terminal;
            VAR protfile : tut_vf_fileref;
            scan         : tut_diag_scan;
            VAR file_pos : tut_file_pos;
            pagetype     : tgg00_PageType;
            VAR buf      : tsp00_MoveObj;
            buf_size     : tsp00_Int4;
            VAR pfkey    : tut_pfkey);
 
BEGIN
CASE pagetype OF
    ptData_egg00:
        BEGIN
        IF  ord (buf [c_pt2_pos]) = ord (pt2Usm_egg00)
        THEN
            BEGIN
            (* ignore USM pages *)
            END
        ELSE
            IF  ord (buf [c_pt2_pos]) = ord (pt2UndoLog_egg00)
            THEN
                x07logundo_node_display (term, protfile, scan,
                      file_pos, buf_size, buf, buf_size, pfkey)
            ELSE
                IF  ord (buf [c_pt2_pos]) = ord (pt2RedoLog_egg00)
                THEN
                    x07logredo_node_display (term, protfile, scan,
                          file_pos, buf_size, buf, buf_size, pfkey)
                ELSE
                    IF  ord (buf [c_pt2_pos]) = ord (pt2History_egg00)
                    THEN
                        x07history_node_display (term, protfile, scan,
                              file_pos, buf_size, buf, buf_size, pfkey)
                    ELSE
                        IF  ord (buf [c_pt2_pos]) = ord (pt2HistoryDirectory_egg00)
                        THEN
                            x07historydir_node_display (term, protfile, scan,
                                  file_pos, buf_size, buf, buf_size, pfkey)
                        ELSE
                            IF  ord (buf [c_pt2_pos]) = ord (pt2OpenTrans_egg00)
                            THEN
                                x07opentrans_node_display (term, protfile, scan,
                                      file_pos, buf_size, buf, buf_size, pfkey)
                            ELSE
                                IF  (ord (buf [c_pt2_pos]) = ord (pt2Object_egg00      )) OR
                                    (ord (buf [c_pt2_pos]) = ord (pt2VarObject_egg00   )) OR
                                    (ord (buf [c_pt2_pos]) = ord (pt2ContObject_egg00  ))
                                THEN
                                    x07object_node_display (term, protfile, scan,
                                          file_pos, buf_size, buf, buf_size, pfkey)
                                ELSE
                                    IF  ord (buf [c_pt2_pos]) = ord (pt2Checkpt_egg00)
                                    THEN
                                        x08restart_display (term, protfile, scan, file_pos,
                                              'RESTARTREC  ', buf, buf_size, pfkey)
                                    ELSE
                                        x07node_display (term, protfile, scan, file_pos,
                                              buf_size, buf, buf_size, pfkey);
                                    (*ENDIF*) 
                                (*ENDIF*) 
                            (*ENDIF*) 
                        (*ENDIF*) 
                    (*ENDIF*) 
                (*ENDIF*) 
            (*ENDIF*) 
        (*ENDIF*) 
        IF  (utds_edit in scan) AND (pfkey = pf_none)
        THEN
            BEGIN
            t09put (term, term.blankline, cut_protected);
            IF  (ord (buf [c_pt2_pos]) = ord (pt2Object_egg00      )) OR
                (ord (buf [c_pt2_pos]) = ord (pt2VarObject_egg00   )) OR
                (ord (buf [c_pt2_pos]) = ord (pt2ContObject_egg00  ))
            THEN
                x08object_node_edit_display (term, protfile,
                      scan + [utds_full_info], file_pos,
                      buf, buf_size, pfkey)
            ELSE
                IF  ord (buf [c_pt2_pos]) <> ord (pt2Checkpt_egg00)
                THEN
                    x08node_edit_display (term, protfile,
                          scan + [utds_full_info], file_pos,
                          buf, buf_size, pfkey)
                (*ENDIF*) 
            (*ENDIF*) 
            END
        (*ENDIF*) 
        END;
    ptLog_egg00:
        x04logpage_display (term, protfile, scan, file_pos,
              buf, buf_size, 0, pfkey);
    ptLogInfo_egg00:
        x08loginfo_display (term, protfile, scan, file_pos,
              buf, buf_size, pfkey);
    ptConverter_egg00:
        x07convpage_display (term, protfile, scan, file_pos, buf, pfkey);
    ptIOManInfo_egg00:
        x08iomanpage_display (term, protfile, scan, file_pos,
              buf, buf_size, pfkey);
    OTHERWISE ;
    END
(*ENDCASE*) 
END;
 
(*------------------------------*) 
 
PROCEDURE
      xt07write_prot (VAR protfile : tut_vf_fileref;
            VAR ln : tsp00_Line);
 
VAR
      len : integer;
      err : integer;
 
BEGIN
len := sizeof (ln);
WHILE (len > 1) AND (ln [len] = ' ') DO
    len := len - 1;
(*ENDWHILE*) 
t12write_prot (protfile, ln, len, err)
END;
 
(*------------------------------*) 
 
PROCEDURE
      x07logredo_node_display (VAR term : tut_terminal;
            VAR protfile    : tut_vf_fileref;
            scan            : tut_diag_scan;
            VAR file_pos    : tut_file_pos;
            trunc_buflength : tsp00_Int4;
            VAR buf         : tsp00_MoveObj;
            buf_size        : tsp00_Int4;
            VAR pfkey       : tut_pfkey);
 
TYPE
 
      t_entry = RECORD
            length     : tsp00_Int4;
            sequence   : tsp00_Int4;
            iosequence : tsp00_Int4;
      END;
 
 
CONST
      ALIGNMENT = 4;
 
VAR
      char_per_line    : integer;
      err              : integer;
      lines_per_tdline : integer;
      dummy_size       : integer;
      ln_len           : integer;
      entryLength      : tsp00_Int4;
      entryCount       : tsp00_Int4;
      currentEntryPos  : tsp00_Int2;
      pEntry           : ^t_entry;
      ln               : tsp00_Line;
      node             : tbd_nodeptr;
 
BEGIN
pfkey    := pf_none;
node     := @buf;
ln       := term.blankline;
ln_len   := 0;
t14bufdimension (term, scan, char_per_line, dummy_size, lines_per_tdline);
x07headlines_node (term, protfile, NOT c_term_only, NOT c_first_only, file_pos, buf, buf_size);
IF  utds_full_info in scan
THEN
    BEGIN
    t12write_prot (protfile, term.blankline, 1, err);
    IF  NOT t09is_window_full (term, 1)
    THEN
        t09put (term, term.blankline, cut_protected);
    (*ENDIF*) 
    x08logredo_edit_display (term, protfile, scan, file_pos, buf, buf_size, pfkey)
    END;
(*ENDIF*) 
IF  (pfkey = pf_none)
THEN
    BEGIN
    t12write_prot (protfile, term.blankline, 1, err);
    IF  NOT t09is_window_full (term, 1)
    THEN
        t09put (term, term.blankline, cut_protected)
    (*ENDIF*) 
    END;
(*ENDIF*) 
currentEntryPos := NODE_HEADER_MXBD00+1;
entryCount      := 1;
IF  utds_logentry_header in scan
THEN
    WHILE (pfkey = pf_none)
          AND
          (currentEntryPos < node^.nd_bottom) DO
        BEGIN
        IF  t09is_window_full (term, 1)
        THEN
            BEGIN
            x05holdhexint (term, pfkey);
            IF  pfkey = pf_none
            THEN
                t09newscreen_page (term)
            (*ENDIF*) 
            END;
        (*ENDIF*) 
        pEntry := @(buf[currentEntryPos]);
        entryLength := ((pEntry^.length + ALIGNMENT - 1) DIV ALIGNMENT) * ALIGNMENT;
        (**)
        ln      := term.blankline;
        ln_len  := 0;
        t12write_prot (protfile, term.blankline, 1, err);
        t09put (term, term.blankline, cut_protected);
        g17sname_to_line ('#           ', ln_len, ln);
        g17trimint4_to_line (entryCount, ln_len, ln);
        ln_len := ln_len + 1;
        g17sname_to_line ('(           ', ln_len, ln);
        g17trimint4_to_line (currentEntryPos, ln_len, ln);
        g17sname_to_line (')           ', ln_len, ln);
        ln_len := ln_len + 1;
        g17sname_to_line ('[           ', ln_len, ln);
        g17trimint4_to_line (pEntry^.length, ln_len, ln);
        g17sname_to_line (']           ', ln_len, ln);
        ln_len := ln_len + 1;
        (**)
        x04afterimagehead_display (term, protfile, scan,
              buf, buf_size,
              currentEntryPos-1  + sizeof(t_entry),
              entryLength, pEntry^.iosequence,
              pfkey, ln, ln_len, err);
        (**)
        currentEntryPos := currentEntryPos + entryLength;
        entryCount      := entryCount      + 1;
        END;
    (*ENDWHILE*) 
(*ENDIF*) 
END;
 
(*------------------------------*) 
 
PROCEDURE
      x07logundo_node_display (VAR term : tut_terminal;
            VAR protfile    : tut_vf_fileref;
            scan            : tut_diag_scan;
            VAR file_pos    : tut_file_pos;
            trunc_buflength : tsp00_Int4;
            VAR buf         : tsp00_MoveObj;
            buf_size        : tsp00_Int4;
            VAR pfkey       : tut_pfkey);
 
CONST
      ALIGNMENT = 4;
 
VAR
      char_per_line    : integer;
      err              : integer;
      lines_per_tdline : integer;
      dummy_size       : integer;
      ln_len           : integer;
      entryCount       : tsp00_Int4;
      currentEntryPos  : tsp00_Int2;
      pEntryLength     : ^tsp00_Int4;
      entryLength      : tsp00_Int4;
      ln               : tsp00_Line;
      node             : tbd_nodeptr;
 
BEGIN
pfkey    := pf_none;
node     := @buf;
ln       := term.blankline;
ln_len   := 0;
t14bufdimension (term, scan, char_per_line, dummy_size, lines_per_tdline);
x07headlines_node (term, protfile, NOT c_term_only, NOT c_first_only, file_pos, buf, buf_size);
IF  utds_full_info in scan
THEN
    BEGIN
    t12write_prot (protfile, term.blankline, 1, err);
    IF  NOT t09is_window_full (term, 1)
    THEN
        t09put (term, term.blankline, cut_protected);
    (*ENDIF*) 
    x08logundo_edit_display (term, protfile, scan, file_pos, buf, buf_size, pfkey)
    END;
(*ENDIF*) 
IF  (pfkey = pf_none)
THEN
    BEGIN
    t12write_prot (protfile, term.blankline, 1, err);
    IF  NOT t09is_window_full (term, 1)
    THEN
        t09put (term, term.blankline, cut_protected)
    (*ENDIF*) 
    END;
(*ENDIF*) 
currentEntryPos := node^.nd_bottom;
entryCount      := 1;
IF  utds_logentry_header in scan
THEN
    WHILE (pfkey = pf_none)
          AND
          (currentEntryPos > NODE_HEADER_MXBD00+1) DO
        BEGIN
        IF  t09is_window_full (term, 1)
        THEN
            BEGIN
            x05holdhexint (term, pfkey);
            IF  pfkey = pf_none
            THEN
                t09newscreen_page (term)
            (*ENDIF*) 
            END;
        (*ENDIF*) 
        pEntryLength := @(buf[currentEntryPos-sizeof(tsp00_Int4)]);
        entryLength  := ((pEntryLength^ + ALIGNMENT - 1) DIV ALIGNMENT) * ALIGNMENT;
        (**)
        ln      := term.blankline;
        ln_len  := 0;
        t12write_prot (protfile, term.blankline, 1, err);
        t09put (term, term.blankline, cut_protected);
        g17sname_to_line ('#           ', ln_len, ln);
        g17trimint4_to_line (entryCount, ln_len, ln);
        ln_len := ln_len + 1;
        g17sname_to_line ('(           ', ln_len, ln);
        g17trimint4_to_line (currentEntryPos, ln_len, ln);
        g17sname_to_line (')           ', ln_len, ln);
        ln_len := ln_len + 1;
        g17sname_to_line ('[           ', ln_len, ln);
        g17trimint4_to_line (pEntryLength^, ln_len, ln);
        g17sname_to_line (']           ', ln_len, ln);
        ln_len := ln_len + 1;
        (**)
        IF  NODE_HEADER_MXBD00+1 + entryLength > currentEntryPos
        THEN
            BEGIN
            g17sname_to_line ('truncated   ', ln_len, ln);
            t12write_prot (protfile, ln, ln_len, err);
            t09put (term, ln, cut_protected);
            END
        ELSE
            BEGIN
            t12write_prot (protfile, ln, ln_len, err);
            t09put (term, ln, cut_protected);
            x08beforeimage_edit_display (term, protfile, scan, buf, buf_size,
                  currentEntryPos - pEntryLength^ - 1, pfkey);
            END;
        (*ENDIF*) 
        currentEntryPos := currentEntryPos - entryLength;
        entryCount      := entryCount      + 1;
        END;
    (*ENDWHILE*) 
(*ENDIF*) 
END;
 
(*------------------------------*) 
 
PROCEDURE
      x07history_node_display (VAR term : tut_terminal;
            VAR protfile    : tut_vf_fileref;
            scan            : tut_diag_scan;
            VAR file_pos    : tut_file_pos;
            trunc_buflength : tsp00_Int4;
            VAR buf         : tsp00_MoveObj;
            buf_size        : tsp00_Int4;
            VAR pfkey       : tut_pfkey);
 
TYPE
 
      t_entry = RECORD
            root      : tsp00_Int4;
            last      : tsp00_Int4;
            transno   : tgg91_TransNo;
            pagecount : tsp00_Uint2
      END;
 
 
VAR
      char_per_line    : integer;
      err              : integer;
      lines_per_tdline : integer;
      dummy_size       : integer;
      ln_len           : integer;
      current_entry    : tsp00_Int4;
      ln               : tsp00_Line;
      node             : tbd_nodeptr;
      pEntry           : ^t_entry;
 
BEGIN
pfkey    := pf_none;
node     := @buf;
ln       := term.blankline;
ln_len   := 0;
t14bufdimension (term, scan, char_per_line, dummy_size, lines_per_tdline);
x07headlines_node (term, protfile, NOT c_term_only, NOT c_first_only, file_pos, buf, buf_size);
IF  utds_full_info in scan
THEN
    BEGIN
    t12write_prot (protfile, term.blankline, 1, err);
    IF  NOT t09is_window_full (term, 1)
    THEN
        t09put (term, term.blankline, cut_protected);
    (*ENDIF*) 
    x08history_edit_display (term, protfile, scan, file_pos, buf, buf_size, pfkey)
    END;
(*ENDIF*) 
IF  (pfkey = pf_none)
THEN
    BEGIN
    t12write_prot (protfile, term.blankline, 1, err);
    IF  NOT t09is_window_full (term, 1)
    THEN
        t09put (term, term.blankline, cut_protected)
    (*ENDIF*) 
    END;
(*ENDIF*) 
IF  (node^.nd_record_cnt > 0)
    AND
    (pfkey = pf_none)
THEN
    BEGIN
    current_entry := 1;
    WHILE (pfkey = pf_none)
          AND
          (* PTS 1117728 UH 2002-09-06 *)
          (NODE_HEADER_MXBD00+1+((current_entry-1)*node^.ndPageFixSizeSpace_bd00.fixRecordLength) < node^.nd_bottom) DO
        BEGIN
        IF  t09is_window_full (term, 1)
        THEN
            BEGIN
            x05holdhexint (term, pfkey);
            IF  pfkey = pf_none
            THEN
                t09newscreen_page (term)
            (*ENDIF*) 
            END;
        (*ENDIF*) 
        pEntry := @(buf[NODE_HEADER_MXBD00+1+((current_entry-1) * node^.ndPageFixSizeSpace_bd00.fixRecordLength)]);
        (* *)
        ln      := term.blankline;
        ln_len  := 0;
        g17sname_to_line ('#           ', ln_len, ln);
        g17trimint4_to_line (current_entry, ln_len, ln);
        ln_len := ln_len + 1;
        g17sname_to_line ('T           ', ln_len, ln);
        gg06TransToLine (pEntry^.transno, ln_len, ln);
        ln_len := ln_len + 1;
        g17sname_to_line ('UndoFile:   ', ln_len, ln);
        ln_len := ln_len + 1;
        g17sname_to_line ('root:       ', ln_len, ln);
        ln_len := ln_len + 1;
        x05pageno_to_line (pEntry^.root, c_trim, ln_len, ln);
        ln_len := ln_len + 1;
        g17sname_to_line ('last:       ', ln_len, ln);
        ln_len := ln_len + 1;
        x05pageno_to_line (pEntry^.last, c_trim, ln_len, ln);
        ln_len := ln_len + 1;
        g17sname_to_line ('pagecount:  ', ln_len, ln);
        g17trimint4_to_line (gg06Int4FromUint2(pEntry^.pagecount), ln_len, ln);
        t12write_prot (protfile, ln, ln_len, err);
        t09put (term, ln, cut_bright_protected);
        (* *)
        t12write_prot (protfile, term.blankline, 1, err);
        t09put (term, term.blankline, cut_protected);
        current_entry := current_entry + 1;
        END;
    (*ENDWHILE*) 
    END;
(*ENDIF*) 
END;
 
(*------------------------------*) 
 
PROCEDURE
      x07historydir_node_display (VAR term : tut_terminal;
            VAR protfile    : tut_vf_fileref;
            scan            : tut_diag_scan;
            VAR file_pos    : tut_file_pos;
            trunc_buflength : tsp00_Int4;
            VAR buf         : tsp00_MoveObj;
            buf_size        : tsp00_Int4;
            VAR pfkey       : tut_pfkey);
 
TYPE
 
      t_entry = RECORD
            root            : tsp00_Int4;
            last            : tsp00_Int4;
            oldesttransno   : tgg91_TransNo;
            youngesttransno : tgg91_TransNo;
      END;
 
 
VAR
      char_per_line    : integer;
      err              : integer;
      lines_per_tdline : integer;
      dummy_size       : integer;
      ln_len           : integer;
      current_entry    : tsp00_Int4;
      ln               : tsp00_Line;
      node             : tbd_nodeptr;
      pEntry           : ^t_entry;
 
BEGIN
pfkey    := pf_none;
node     := @buf;
ln       := term.blankline;
ln_len   := 0;
t14bufdimension (term, scan, char_per_line, dummy_size, lines_per_tdline);
x07headlines_node (term, protfile, NOT c_term_only, NOT c_first_only, file_pos, buf, buf_size);
IF  utds_full_info in scan
THEN
    BEGIN
    t12write_prot (protfile, term.blankline, 1, err);
    IF  NOT t09is_window_full (term, 1)
    THEN
        t09put (term, term.blankline, cut_protected);
    (*ENDIF*) 
    x08historydir_edit_display (term, protfile, scan, file_pos, buf, buf_size, pfkey)
    END;
(*ENDIF*) 
IF  (pfkey = pf_none)
THEN
    BEGIN
    t12write_prot (protfile, term.blankline, 1, err);
    IF  NOT t09is_window_full (term, 1)
    THEN
        t09put (term, term.blankline, cut_protected)
    (*ENDIF*) 
    END;
(*ENDIF*) 
IF  (node^.nd_record_cnt > 0)
    AND
    (pfkey = pf_none)
THEN
    BEGIN
    current_entry := 1;
    WHILE (pfkey = pf_none)
          AND
          (* PTS 1117728 UH 2002-09-06 *)
          (NODE_HEADER_MXBD00+1+((current_entry-1)*node^.ndPageFixSizeSpace_bd00.fixRecordLength) < node^.nd_bottom) DO
        BEGIN
        IF  t09is_window_full (term, 1)
        THEN
            BEGIN
            x05holdhexint (term, pfkey);
            IF  pfkey = pf_none
            THEN
                t09newscreen_page (term)
            (*ENDIF*) 
            END;
        (*ENDIF*) 
        pEntry := @(buf[NODE_HEADER_MXBD00+1+((current_entry-1) * node^.ndPageFixSizeSpace_bd00.fixRecordLength)]);
        (* *)
        ln      := term.blankline;
        ln_len  := 0;
        g17sname_to_line ('#           ', ln_len, ln);
        g17trimint4_to_line (current_entry, ln_len, ln);
        ln_len := ln_len + 1;
        g17sname_to_line ('oldest T    ', ln_len, ln);
        gg06TransToLine (pEntry^.oldesttransno, ln_len, ln);
        ln_len := ln_len + 1;
        g17sname_to_line ('youngest T  ', ln_len, ln);
        gg06TransToLine (pEntry^.youngesttransno, ln_len, ln);
        ln_len := ln_len + 1;
        g17sname_to_line ('HistoryFile:', ln_len, ln);
        ln_len := ln_len + 1;
        g17sname_to_line ('root:       ', ln_len, ln);
        ln_len := ln_len + 1;
        x05pageno_to_line (pEntry^.root, c_trim, ln_len, ln);
        ln_len := ln_len + 1;
        g17sname_to_line ('last:       ', ln_len, ln);
        ln_len := ln_len + 1;
        x05pageno_to_line (pEntry^.last, c_trim, ln_len, ln);
        ln_len := ln_len + 1;
        t12write_prot (protfile, ln, ln_len, err);
        t09put (term, ln, cut_bright_protected);
        (* *)
        t12write_prot (protfile, term.blankline, 1, err);
        t09put (term, term.blankline, cut_protected);
        (* *)
        current_entry := current_entry + 1;
        END;
    (*ENDWHILE*) 
    END;
(*ENDIF*) 
END;
 
(*------------------------------*) 
 
PROCEDURE
      x07opentrans_node_display (VAR term : tut_terminal;
            VAR protfile    : tut_vf_fileref;
            scan            : tut_diag_scan;
            VAR file_pos    : tut_file_pos;
            trunc_buflength : tsp00_Int4;
            VAR buf         : tsp00_MoveObj;
            buf_size        : tsp00_Int4;
            VAR pfkey       : tut_pfkey);
 
TYPE
 
      t_PersistentTrans = RECORD
            transno                : tgg91_TransNo;
            state                  : tsp00_Uint1;
            filler1                : boolean;
            lastUndoSequence       : tsp00_Int4;
            lastRedoSequence       : tsp00_Int4;
            lastCopiedRedoSequence : tsp00_Int4;
            undoroot               : tsp00_Int4;
            undolast               : tsp00_Int4;
            redoroot               : tsp00_Int4;
            redolast               : tsp00_Int4;
            eotsequence            : tsp00_Int4;
            queueId                : tsp00_Int2;
            lastEntryIscomplete    : boolean;
            filler2                : boolean;
      END;
 
 
VAR
      ln_attr          : char;
      char_per_line    : integer;
      err              : integer;
      lines_per_tdline : integer;
      dummy_size       : integer;
      ln_len           : integer;
      current_entry    : tsp00_Int4;
      ln               : tsp00_Line;
      node             : tbd_nodeptr;
      pTransEntry      : ^t_PersistentTrans;
      queueIdInt4      : tsp00_Int4;
 
BEGIN
pfkey    := pf_none;
node     := @buf;
ln       := term.blankline;
ln_len   := 0;
t14bufdimension (term, scan, char_per_line, dummy_size, lines_per_tdline);
x07headlines_node (term, protfile, NOT c_term_only, NOT c_first_only, file_pos, buf, buf_size);
IF  utds_full_info in scan
THEN
    BEGIN
    t12write_prot (protfile, term.blankline, 1, err);
    IF  NOT t09is_window_full (term, 1)
    THEN
        t09put (term, term.blankline, cut_protected);
    (*ENDIF*) 
    x08opentrans_edit_display (term, protfile, scan, file_pos, buf, buf_size, pfkey)
    END;
(*ENDIF*) 
IF  (pfkey = pf_none)
THEN
    BEGIN
    t12write_prot (protfile, term.blankline, 1, err);
    IF  NOT t09is_window_full (term, 1)
    THEN
        t09put (term, term.blankline, cut_protected)
    (*ENDIF*) 
    END;
(*ENDIF*) 
IF  (node^.nd_record_cnt > 0)
    AND
    (pfkey = pf_none)
THEN
    BEGIN
    ln_attr := cut_bright_protected;
    current_entry := 1;
    WHILE (pfkey = pf_none)
          AND
          (current_entry <= node^.nd_record_cnt)
          AND
          (current_entry * node^.ndPageFixSizeSpace_bd00.fixRecordLength < node^.nd_bottom) DO
        BEGIN
        IF  t09is_window_full (term, 1)
        THEN
            BEGIN
            x05holdhexint (term, pfkey);
            IF  pfkey = pf_none
            THEN
                t09newscreen_page (term)
            (*ENDIF*) 
            END;
        (*ENDIF*) 
        pTransEntry := @(buf[NODE_HEADER_MXBD00+1+((current_entry-1) * node^.ndPageFixSizeSpace_bd00.fixRecordLength)]);
        (* *)
        ln      := term.blankline;
        ln_len  := 0;
        g17sname_to_line ('#           ', ln_len, ln);
        g17trimint4_to_line (current_entry, ln_len, ln);
        ln_len := ln_len + 1;
        g17sname_to_line ('T           ', ln_len, ln);
        gg06TransToLine (pTransEntry^.transno, ln_len, ln);
        ln_len := ln_len + 1;
        CASE pTransEntry^.state OF
            0:
                g17sname_to_line ('opened      ', ln_len, ln);
            1:
                g17sname_to_line ('committed   ', ln_len, ln);
            2:
                g17sname_to_line ('rollbacked  ', ln_len, ln);
            OTHERWISE:
                g17sname_to_line ('***unknown  ', ln_len, ln);
            END;
        (*ENDCASE*) 
        ln_len := ln_len + 1;
        g17sname_to_line ('EOTSeq:     ', ln_len, ln);
        ln_len := ln_len + 1;
        g17trimint4_to_line (pTransEntry^.eotsequence, ln_len, ln);
        queueIdInt4 := pTransEntry^.queueId;
        ln_len := ln_len + 1;
        g17sname_to_line ('queueId     ', ln_len, ln);
        ln_len := ln_len + 1;
        g17trimint4_to_line (queueIdInt4, ln_len, ln);
        ln_len := ln_len + 1;
        IF  pTransEntry^.lastEntryIscomplete
        THEN
            g17sname_to_line ('completeEntr', ln_len, ln)
        ELSE
            g17sname_to_line ('incompleteEn', ln_len, ln);
        (*ENDIF*) 
        t12write_prot (protfile, ln, ln_len, err);
        t09put (term, ln, cut_bright_protected);
        (* *)
        ln      := term.blankline;
        ln_len  := 0;
        g17sname_to_line ('UndoFile:   ', ln_len, ln);
        ln_len := ln_len + 1;
        g17sname_to_line ('root:       ', ln_len, ln);
        ln_len := ln_len + 1;
        x05pageno_to_line (pTransEntry^.undoroot, c_trim, ln_len, ln);
        ln_len := ln_len + 1;
        g17sname_to_line ('last:       ', ln_len, ln);
        ln_len := ln_len + 1;
        x05pageno_to_line (pTransEntry^.undolast, c_trim, ln_len, ln);
        ln_len := ln_len + 1;
        g17sname_to_line ('lastseq:    ', ln_len, ln);
        ln_len := ln_len + 1;
        x05pageno_to_line (pTransEntry^.lastUndoSequence, c_trim, ln_len, ln);
        ln_len := ln_len + 1;
        t12write_prot (protfile, ln, ln_len, err);
        t09put (term, ln, cut_protected);
        (* *)
        ln      := term.blankline;
        ln_len  := 0;
        g17sname_to_line ('RedoFile:   ', ln_len, ln);
        ln_len := ln_len + 1;
        g17sname_to_line ('root:       ', ln_len, ln);
        ln_len := ln_len + 1;
        x05pageno_to_line (pTransEntry^.redoroot, c_trim, ln_len, ln);
        ln_len := ln_len + 1;
        g17sname_to_line ('last:       ', ln_len, ln);
        ln_len := ln_len + 1;
        x05pageno_to_line (pTransEntry^.redolast, c_trim, ln_len, ln);
        ln_len := ln_len + 1;
        g17sname_to_line ('lastseq:    ', ln_len, ln);
        ln_len := ln_len + 1;
        x05pageno_to_line (pTransEntry^.lastRedoSequence, c_trim, ln_len, ln);
        ln_len := ln_len + 1;
        g17sname_to_line ('lastcopied: ', ln_len, ln);
        ln_len := ln_len + 1;
        x05pageno_to_line (pTransEntry^.lastCopiedRedoSequence, c_trim, ln_len, ln);
        t12write_prot (protfile, ln, ln_len, err);
        t09put (term, ln, cut_protected);
        (* *)
        t12write_prot (protfile, term.blankline, 1, err);
        t09put (term, term.blankline, cut_protected);
        current_entry := current_entry + 1;
        END;
    (*ENDWHILE*) 
    END;
(*ENDIF*) 
END;
 
(*------------------------------*) 
 
PROCEDURE
      x07fdirpage_display (VAR term : tut_terminal;
            VAR protfile : tut_vf_fileref;
            scan         : tut_diag_scan;
            VAR file_pos : tut_file_pos;
            VAR buf      : tsp00_MoveObj;
            buf_size     : tsp00_Int4;
            VAR pfkey    : tut_pfkey);
 
VAR
      node             : tbd_nodeptr;
 
BEGIN
node      := @buf;
IF  node^.nd_level = 0
THEN
    x07fdirindexpage_display (term, protfile, scan, file_pos,
          buf, buf_size, pfkey)
ELSE
    x07fdirdatapage_display (term, protfile, scan, file_pos,
          buf, buf_size, pfkey)
(*ENDIF*) 
END;
 
(*------------------------------*) 
 
PROCEDURE
      x07fdirindexpage_display (VAR term : tut_terminal;
            VAR protfile : tut_vf_fileref;
            scan         : tut_diag_scan;
            VAR file_pos : tut_file_pos;
            VAR buf      : tsp00_MoveObj;
            buf_size     : tsp00_Int4;
            VAR pfkey    : tut_pfkey);
 
CONST
      pageHeaderSize  = 80;
      pageTrailerSize = 16;
 
VAR
      buf_pos          : integer;
      char_per_line    : integer;
      err              : integer;
      lines_per_tdline : integer;
      dummy_size       : integer;
      ln_len           : integer;
      current_entry    : tsp00_Int4;
      entryPtr         : ^tsp00_Int4;
      ln               : tsp00_Line;
      node             : tbd_nodeptr;
 
BEGIN
pfkey     := pf_none;
node      := @buf;
ln        := term.blankline;
ln_len    := 0;
t14bufdimension (term, scan, char_per_line, dummy_size, lines_per_tdline);
g17sname_to_line ('FILEDIR INDX', ln_len, ln);
ln_len := ln_len + 1;
x05pageno_to_line (node^.nd_id, NOT c_trim, ln_len, ln);
ln_len := ln_len + 4;
g17sname_to_line ('ConvVers:   ', ln_len, ln);
ln_len := ln_len + 1;
g17int4to_line (node^.nd_conv_version, NOT c_with_zero, 5, ln_len, ln);
ln_len := ln_len + 6;
g17sname_to_line ('EntryCount: ', ln_len, ln);
ln_len := ln_len + 1;
g17int4to_line (node^.nd_record_cnt, NOT c_with_zero, 5, ln_len, ln);
ln_len := ln_len + 6;
g17sname_to_line ('NextPage:   ', ln_len, ln);
ln_len := ln_len + 1;
x05pageno_to_line (node^.nd_right, c_trim, ln_len, ln);
t09put (term, ln, cut_bright_protected);
t12write_prot (protfile, ln, ln_len, err);
(* *)
ln_len   := 0;
ln       := term.blankline;
t12write_prot (protfile, ln, ln_len, err);
t09put (term, ln, cut_protected);
(* *)
buf_pos       := pageHeaderSize + 1;
current_entry := 0;
WHILE (current_entry < node^.nd_record_cnt)  AND
      (buf_pos < (buf_size - pageTrailerSize)) AND
      (utds_bd_full_info in scan) DO
    BEGIN
    entryPtr := @buf[ buf_pos ];
    g17sname_to_line ('Offset:     ', ln_len, ln);
    ln_len := ln_len + 2;
    g17int4to_line (buf_pos-1, c_with_zero, 5, ln_len, ln);
    ln_len := ln_len + 10;
    g17sname_to_line ('PageNo:     ', ln_len, ln);
    ln_len := ln_len + 1;
    x05pageno_to_line (entryPtr^, c_trim, ln_len, ln);
    (* *)
    current_entry := succ (current_entry);
    buf_pos       := buf_pos + sizeof(entryPtr^);
    t12write_prot (protfile, ln, ln_len, err);
    t09put (term, ln, cut_protected);
    ln_len   := 0;
    ln       := term.blankline;
    END;
(*ENDWHILE*) 
(* *)
t12write_prot (protfile, ln, ln_len, err);
t09put (term, ln, cut_protected);
IF  utds_bd_full_info in scan
THEN
    BEGIN
    ln_len   := 0;
    ln       := term.blankline;
    t12write_prot (protfile, ln, ln_len, err);
    t09put (term, ln, cut_protected);
    t12write_prot (protfile, ln, ln_len, err);
    t09put (term, ln, cut_protected);
    END;
(*ENDIF*) 
END;
 
(*------------------------------*) 
 
PROCEDURE
      x07fdirdatapage_display (VAR term : tut_terminal;
            VAR protfile : tut_vf_fileref;
            scan         : tut_diag_scan;
            VAR file_pos : tut_file_pos;
            VAR buf      : tsp00_MoveObj;
            buf_size     : tsp00_Int4;
            VAR pfkey    : tut_pfkey);
 
CONST
      pageHeaderSize  = 80;
      pageTrailerSize = 16;
      (* *)
      (* copy of Data_FileType: *)
      d_TableFile           = 6;
      d_IndexFile           = 7;
      d_OmsFile             = 8;
      d_OmsFixedFile        = 9;
      d_OmsKeyFile          = 10;
      d_OmsKeyPartitionFile = 11;
      d_OmsVarFile          = 12;
      d_OmsUnused           = 13;
      d_ShortColumnFile     = 14;
      (* *)
      (* copy of Data_FileState *)
      d_FileOk            = 0;
      d_FileDeleted       = 1;
      d_FileNotAccessible = 2;
      d_FileUnloaded      = 3;
      d_FileReadOnly      = 4;
      d_FileBad           = 5;
      (* *)
      c_tab_stop          = 2;
 
TYPE
 
      FDirPageEntry = RECORD
            len         : tsp00_Int2;
            isValid     : tsp00_Char;
            lazyDelete  : tsp00_Char;
            hasBackref  : tsp00_Char;
            filler      : tsp00_Char;
            filler1     : tsp00_Int2;
            convVersion : tsp00_Int4;
            fileType    : tsp00_Uint1;
            fileState   : tsp00_Uint1;
            fileAttr    : tsp00_Uint1;
            pdFiller    : tsp00_Char;
            fileNo      : tgg00_Surrogate;
            root        : tsp00_PageNo;
            pdFiller1   : tsp00_Int4;
            entryCount  : tsp00_C8;
            lPageCount  : tsp00_Int4;
            iPageCount  : tsp00_Int4;
      END;
 
 
      FDirTableEntry = RECORD
            blobColCount : tsp00_Int2;
            fileVersion  : tgg91_FileVersion;
            fileTypeSet  : tgg00_FiletypeSet;
            tableAttr    : tsp00_Uint1;
            filler       : tsp00_Int2;
            lobPageCount : tsp00_C8;
      END;
 
 
      FDirIndexEntry = RECORD
            parentFileNo : tgg00_Surrogate;
            indexId      : tsp00_Int2;
            fileTypeSet  : tgg00_FiletypeSet;
            indexAttr    : tsp00_Uint1;
            usageCount   : tsp00_Int4; (* should be uint4 *)
      END;
 
 
      FDirSColEntry = RECORD
            parentFileNo : tgg00_Surrogate;
            fileVersion  : tgg91_FileVersion;
            filler       : tsp00_Int2;
            fileTypeSet  : tsp00_Int4;
      END;
 
 
      FDirOmsEntry = RECORD
            chainCount       : tsp00_Uint2;
            objBodySize      : tsp00_Uint2;
            objPerPageCount  : tsp00_Uint2;
            partitionCounter : tsp00_Uint2;
            maxPageSeqNo     : tsp00_C8;
      END;
 
 
      FDirOmsKeyPartitionEntry = RECORD
            parentFileNo : tgg00_Surrogate;
            partitionNo  : tsp00_Uint2;
            filler       : tsp00_Int2;
            filler1      : tsp00_Int4;
      END;
 
 
VAR
      fileTypeSet      : tgg00_FiletypeSet;
      eFiletypeSet     : tgg00_ExtendedFiletypeSet;
      i                : integer;
      buf_pos          : integer;
      char_per_line    : integer;
      err              : integer;
      lines_per_tdline : integer;
      dummy_size       : integer;
      ln_len           : integer;
      entryPtr         : ^FDirPageEntry;
      tablePtr         : ^FDirTableEntry;
      indexPtr         : ^FDirIndexEntry;
      omsPtr           : ^FDirOmsEntry;
      omsKeyPartPtr    : ^FDirOmsKeyPartitionEntry;
      sColPtr          : ^FDirSColEntry;
      surrogatePtr     : ^tgg00_Surrogate;
      uint2Ptr         : ^tsp00_Uint2;
      int4Ptr          : ^tsp00_Int4;
      ln               : tsp00_Line;
      node             : tbd_nodeptr;
 
BEGIN
pfkey     := pf_none;
node      := @buf;
ln        := term.blankline;
ln_len    := 0;
t14bufdimension (term, scan, char_per_line, dummy_size, lines_per_tdline);
g17sname_to_line ('FILEDIR DATA', ln_len, ln);
ln_len := ln_len + 1;
x05pageno_to_line (node^.nd_id, NOT c_trim, ln_len, ln);
ln_len := ln_len + 4;
g17sname_to_line ('ConvVers:   ', ln_len, ln);
ln_len := ln_len + 1;
g17int4to_line (node^.nd_conv_version, NOT c_with_zero, 5, ln_len, ln);
ln_len := ln_len + 8;
g17sname_to_line ('EntryCount: ', ln_len, ln);
ln_len := ln_len + 1;
g17int4to_line (node^.nd_record_cnt, NOT c_with_zero, 5, ln_len, ln);
ln_len := ln_len + 8;
t09put (term, ln, cut_bright_protected);
t12write_prot (protfile, ln, ln_len, err);
(* *)
buf_pos  := pageHeaderSize + 1;
WHILE (buf_pos < (buf_size - pageTrailerSize)) AND
      (utds_bd_full_info in scan) DO
    BEGIN
    ln_len   := 0;
    ln       := term.blankline;
    t12write_prot (protfile, ln, ln_len, err);
    t09put (term, ln, cut_protected);
    (* *)
    entryPtr := @buf[ buf_pos ];
    g17sname_to_line ('Offset:     ', ln_len, ln);
    ln_len := ln_len + 2;
    g17int4to_line (buf_pos-1, c_with_zero, 4, ln_len, ln);
    ln_len := ln_len + 6;
    g17sname_to_line ('Len:        ', ln_len, ln);
    ln_len := ln_len + 1;
    g17int4to_line (ord (entryPtr^.len), NOT c_with_zero, 5, ln_len, ln);
    ln_len := ln_len + 5;
    g17sname_to_line ('Type:       ', ln_len, ln);
    ln_len := ln_len + 1;
    IF  ord(entryPtr^.isValid) <> 0
    THEN
        BEGIN
        CASE entryPtr^.fileType OF
            d_TableFile:
                BEGIN
                g17sname_to_line ('Table       ', ln_len, ln);
                ln_len := ln_len + 7
                END;
            d_IndexFile:
                BEGIN
                g17sname_to_line ('Index       ', ln_len, ln);
                ln_len := ln_len + 7
                END;
            d_ShortColumnFile:
                BEGIN
                g17sname_to_line ('ShortColumn ', ln_len, ln);
                ln_len := ln_len + 1
                END;
            d_OmsFile:
                BEGIN
                g17sname_to_line ('Oms         ', ln_len, ln);
                ln_len := ln_len + 9
                END;
            d_OmsFixedFile:
                BEGIN
                g17sname_to_line ('OmsFixed    ', ln_len, ln);
                ln_len := ln_len + 4
                END;
            d_OmsKeyFile:
                BEGIN
                g17sname_to_line ('OmsKey      ', ln_len, ln);
                ln_len := ln_len + 6
                END;
            d_OmsKeyPartitionFile:
                BEGIN
                g17sname_to_line ('OmsKeyPartit', ln_len, ln);
                ln_len := ln_len
                END;
            d_OmsVarFile:
                BEGIN
                g17sname_to_line ('OmsVar      ', ln_len, ln);
                ln_len := ln_len + 6
                END;
            OTHERWISE
                BEGIN
                g17sname_to_line ('unknown     ', ln_len, ln);
                ln_len := ln_len + 2;
                END;
            END;
        (*ENDCASE*) 
        eFiletypeSet := [];
        x07AddFileAttrToEFiletype (entryPtr^.fileAttr,
              eFiletypeSet);
        END
    ELSE
        BEGIN
        g17sname_to_line ('free block  ', ln_len, ln);
        ln_len := ln_len + 2;
        END;
    (*ENDIF*) 
    ln_len := ln_len + 4;
    g17sname_to_line ('IsValid:    ', ln_len, ln);
    ln_len := ln_len + 1;
    g17trimint4_to_line (ord (entryPtr^.isValid), ln_len, ln);
    ln_len := ln_len + 4;
    g17sname_to_line ('LazyDelete: ', ln_len, ln);
    ln_len := ln_len + 1;
    g17trimint4_to_line (ord (entryPtr^.lazyDelete), ln_len, ln);
    t12write_prot (protfile, ln, ln_len, err);
    t09put (term, ln, cut_bright_protected);
    (* *)
    IF  ord(entryPtr^.isValid) <> 0
    THEN
        BEGIN
        ln_len := c_tab_stop;
        ln     := term.blankline;
        g17sname_to_line ('HasBackRef :', ln_len, ln);
        ln_len := ln_len + 1;
        IF  ord (entryPtr^.hasBackref) <> 0
        THEN
            BEGIN
            g17sname_to_line ('True        ', ln_len, ln);
            ln_len := ln_len + 4;
            END
        ELSE
            BEGIN
            g17sname_to_line ('False       ', ln_len, ln);
            ln_len := ln_len + 5;
            END;
        (*ENDIF*) 
        t12write_prot (protfile, ln, ln_len, err);
        t09put (term, ln, cut_protected);
        (* *)
        ln_len := c_tab_stop;
        ln     := term.blankline;
        g17sname_to_line ('ConvVersion:', ln_len, ln);
        ln_len := ln_len + 1;
        g17trimint4_to_line (entryPtr^.convVersion, ln_len, ln);
        ln_len := ln_len + 4;
        t12write_prot (protfile, ln, ln_len, err);
        t09put (term, ln, cut_protected);
        (* *)
        ln_len := c_tab_stop;
        ln     := term.blankline;
        g17sname_to_line ('FileNo     :', ln_len, ln);
        ln_len := ln_len + 1;
        g17fileno_to_line (entryPtr^.fileNo, ln_len, ln);
        ln_len := ln_len + 4;
        t12write_prot (protfile, ln, ln_len, err);
        t09put (term, ln, cut_protected);
        (* *)
        ln_len := c_tab_stop;
        ln     := term.blankline;
        g17sname_to_line ('RootPage   :', ln_len, ln);
        ln_len := ln_len + 1;
        x05pageno_to_line (entryPtr^.root, c_trim, ln_len, ln);
        t12write_prot (protfile, ln, ln_len, err);
        t09put (term, ln, cut_protected);
        (* *)
        ln_len := c_tab_stop;
        ln     := term.blankline;
        g17sname_to_line ('State      :', ln_len, ln);
        ln_len := ln_len + 1;
        CASE entryPtr^.fileState OF
            d_FileOk:
                BEGIN
                g17sname_to_line ('Ok          ', ln_len, ln);
                ln_len := ln_len + 12
                END;
            d_FileDeleted:
                BEGIN
                g17sname_to_line ('Deleted     ', ln_len, ln);
                ln_len := ln_len + 7
                END;
            d_FileNotAccessible:
                BEGIN
                g17sname_to_line ('NotAccessibl', ln_len, ln);
                ln_len := ln_len + 2
                END;
            d_FileUnloaded:
                BEGIN
                g17sname_to_line ('Unloaded    ', ln_len, ln);
                ln_len := ln_len + 6
                END;
            d_FileReadOnly:
                BEGIN
                g17sname_to_line ('ReadOnly    ', ln_len, ln);
                ln_len := ln_len + 6
                END;
            d_FileBad:
                BEGIN
                g17sname_to_line ('Bad         ', ln_len, ln);
                ln_len := ln_len + 6
                END;
            OTHERWISE
                BEGIN
                g17sname_to_line ('Unknown     ', ln_len, ln);
                ln_len := ln_len + 7
                END;
            END;
        (*ENDCASE*) 
        t12write_prot (protfile, ln, ln_len, err);
        t09put (term, ln, cut_protected);
        (* *)
        ln_len := c_tab_stop;
        ln     := term.blankline;
        g17sname_to_line ('entryCnt   :', ln_len, ln);
        ln_len := ln_len + 2;
        g172Char8AsUint8_to_line (entryPtr^.entryCount, ln_len, ln);
        ln_len := ln_len + 8;
        t12write_prot (protfile, ln, ln_len, err);
        t09put (term, ln, cut_protected);
        (* *)
        ln_len := c_tab_stop;
        ln     := term.blankline;
        IF  entryPtr^.fileType in [ d_OmsFixedFile, d_OmsVarFile, d_OmsKeyFile ]
        THEN
            g17sname_to_line ('freePageCnt:', ln_len, ln)
        ELSE
            g17sname_to_line ('indxPageCnt:', ln_len, ln);
        (*ENDIF*) 
        ln_len := ln_len + 2;
        g17int4to_line (entryPtr^.iPageCount, NOT c_with_zero, 5,
              ln_len, ln);
        ln_len := ln_len + 8;
        t12write_prot (protfile, ln, ln_len, err);
        t09put (term, ln, cut_protected);
        (* *)
        ln_len := c_tab_stop;
        ln     := term.blankline;
        g17sname_to_line ('leafPageCnt:', ln_len, ln);
        ln_len := ln_len + 2;
        g17int4to_line (entryPtr^.lPageCount, NOT c_with_zero, 5,
              ln_len, ln);
        ln_len := ln_len + 8;
        t12write_prot (protfile, ln, ln_len, err);
        t09put (term, ln, cut_protected);
        (* *)
        buf_pos := buf_pos + sizeof (FDirPageEntry);
        ln_len := c_tab_stop;
        ln     := term.blankline;
        CASE entryPtr^.fileType OF
            d_TableFile:
                BEGIN
                tablePtr := @buf[ buf_pos ];
                buf_pos  := buf_pos + sizeof (FDirTableEntry);
                x07AddTableAttrToEFiletype (tablePtr^.tableAttr,
                      eFiletypeSet);
                g17sname_to_line ('BlobColCnt :', ln_len, ln);
                ln_len := ln_len + 2;
                g17int4to_line (tablePtr^.blobColCount, c_with_zero, 5,
                      ln_len, ln);
                ln_len := ln_len + 5;
                t12write_prot (protfile, ln, ln_len, err);
                t09put (term, ln, cut_protected);
                (* *)
                ln_len := c_tab_stop;
                ln     := term.blankline;
                g17sname_to_line ('fileVersion:', ln_len, ln);
                ln_len := ln_len + 1;
                gg06FileVersToLine (tablePtr^.fileVersion,ln_len, ln);
                t12write_prot (protfile, ln, ln_len, err);
                t09put (term, ln, cut_protected);
                (* *)
                ln_len := c_tab_stop;
                ln     := term.blankline;
                g17sname_to_line ('fileType   :', ln_len, ln);
                ln_len := ln_len + 1;
                fileTypeSet := tablePtr^.fileTypeSet;
                g17filetype_to_line (fileTypeSet, false,
                      ln_len, ln);
                t12write_prot (protfile, ln, ln_len, err);
                t09put (term, ln, cut_protected);
                (* *)
                ln_len := c_tab_stop;
                ln     := term.blankline;
                g17sname_to_line ('exFileType :', ln_len, ln);
                ln_len := ln_len + 1;
                g17efiletype_to_line (eFiletypeSet, false,
                      ln_len, ln);
                t12write_prot (protfile, ln, ln_len, err);
                t09put (term, ln, cut_protected);
                (* *)
                ln_len := c_tab_stop;
                ln     := term.blankline;
                g17sname_to_line ('lobPageCnt: ', ln_len, ln);
                ln_len := ln_len + 1;
                g172Char8AsInt8_to_line (tablePtr^.lobPageCount, ln_len, ln);
                t12write_prot (protfile, ln, ln_len, err);
                t09put (term, ln, cut_protected);
                (* *)
                END;
            d_IndexFile:
                BEGIN
                indexPtr := @buf[ buf_pos ];
                buf_pos  := buf_pos + sizeof (FDirIndexEntry);
                g17sname_to_line ('pFileNo    :', ln_len, ln);
                ln_len := ln_len + 1;
                g17fileno_to_line (indexPtr^.parentFileNo, ln_len, ln);
                t12write_prot (protfile, ln, ln_len, err);
                t09put (term, ln, cut_protected);
                (* *)
                ln_len := c_tab_stop;
                ln     := term.blankline;
                g17sname_to_line ('indexId    :', ln_len, ln);
                ln_len := ln_len + 2;
                g17int4to_line (indexPtr^.indexId, NOT c_with_zero, 5,
                      ln_len, ln);
                ln_len := ln_len + 5;
                t12write_prot (protfile, ln, ln_len, err);
                t09put (term, ln, cut_protected);
                (* *)
                ln_len := c_tab_stop;
                ln     := term.blankline;
                g17sname_to_line ('fileType   :', ln_len, ln);
                ln_len := ln_len + 1;
                fileTypeSet := indexPtr^.fileTypeSet;
                g17filetype_to_line (fileTypeSet, false,
                      ln_len, ln);
                t12write_prot (protfile, ln, ln_len, err);
                t09put (term, ln, cut_protected);
                (* *)
                ln_len := c_tab_stop;
                ln     := term.blankline;
                g17sname_to_line ('usageCount :', ln_len, ln);
                ln_len := ln_len + 1;
                g17int4to_line (gg06Int4FromUint2 (indexPtr^.usageCount),
                      NOT c_with_zero, 5, ln_len, ln);
                ln_len := ln_len + 8;
                t12write_prot (protfile, ln, ln_len, err);
                t09put (term, ln, cut_protected);
                (* *)
                END;
            d_ShortColumnFile:
                BEGIN
                sColPtr := @buf[ buf_pos ];
                buf_pos := buf_pos + sizeof (FDirSColEntry);
                g17sname_to_line ('pFileNo    :', ln_len, ln);
                ln_len := ln_len + 1;
                g17fileno_to_line (sColPtr^.parentFileNo, ln_len, ln);
                t12write_prot (protfile, ln, ln_len, err);
                t09put (term, ln, cut_protected);
                (* *)
                ln_len := c_tab_stop;
                ln     := term.blankline;
                g17sname_to_line ('fileVersion:', ln_len, ln);
                ln_len := ln_len + 1;
                gg06FileVersToLine (sColPtr^.fileVersion,ln_len, ln);
                t12write_prot (protfile, ln, ln_len, err);
                t09put (term, ln, cut_protected);
                (* *)
                ln_len := c_tab_stop;
                ln     := term.blankline;
                xt07put_int4_as_filetype('fileType   :',
                      sColPtr^.fileTypeSet,ln_len, ln);
                t12write_prot (protfile, ln, ln_len, err);
                t09put (term, ln, cut_protected);
                (* *)
                END;
            d_OmsFixedFile,
            d_OmsKeyFile,
            d_OmsVarFile:
                BEGIN
                omsPtr := @buf[ buf_pos ];
                buf_pos  := buf_pos + sizeof (FDirOmsEntry);
                g17sname_to_line ('chainCount :', ln_len, ln);
                ln_len := ln_len + 2;
                g17int4to_line (gg06Int4FromUint2 (omsPtr^.chainCount),
                      NOT c_with_zero, 5, ln_len, ln);
                ln_len := ln_len + 5;
                t12write_prot (protfile, ln, ln_len, err);
                t09put (term, ln, cut_protected);
                (* *)
                ln_len := c_tab_stop;
                ln     := term.blankline;
                g17sname_to_line ('objBodySize:', ln_len, ln);
                ln_len := ln_len + 2;
                g17int4to_line (gg06Int4FromUint2 (omsPtr^.objBodySize),
                      NOT c_with_zero, 5, ln_len, ln);
                ln_len := ln_len + 5;
                t12write_prot (protfile, ln, ln_len, err);
                t09put (term, ln, cut_protected);
                (* *)
                ln_len := c_tab_stop;
                ln     := term.blankline;
                g17sname_to_line ('objPPageCnt:', ln_len, ln);
                ln_len := ln_len + 2;
                g17int4to_line (gg06Int4FromUint2 (omsPtr^.objPerPageCount),
                      NOT c_with_zero, 5, ln_len, ln);
                ln_len := ln_len + 5;
                t12write_prot (protfile, ln, ln_len, err);
                t09put (term, ln, cut_protected);
                (* *)
                ln_len := c_tab_stop;
                ln     := term.blankline;
                g17sname_to_line ('objPartCnt :', ln_len, ln);
                ln_len := ln_len + 2;
                g17int4to_line (gg06Int4FromUint2 (omsPtr^.partitionCounter),
                      NOT c_with_zero, 5, ln_len, ln);
                ln_len := ln_len + 5;
                t12write_prot (protfile, ln, ln_len, err);
                t09put (term, ln, cut_protected);
                (* *)
                ln_len := c_tab_stop;
                ln     := term.blankline;
                g17sname_to_line ('maxPageSeqN:', ln_len, ln);
                ln_len := ln_len + 1;
                g172Char8AsUint8_to_line (omsPtr^.maxPageSeqNo, ln_len, ln);
                t12write_prot (protfile, ln, ln_len, err);
                t09put (term, ln, cut_protected);
                (* *)
                CASE entryPtr^.fileType OF
                    d_OmsKeyFile:
                        BEGIN
                        FOR i := 1 TO omsPtr^.partitionCounter DO
                            BEGIN
                            surrogatePtr := @buf[ buf_pos ];
                            ln_len := c_tab_stop;
                            ln     := term.blankline;
                            g17sname_to_line ('partFileNo :', ln_len, ln);
                            ln_len := ln_len + 1;
                            g17fileno_to_line (surrogatePtr^, ln_len, ln);
                            t12write_prot (protfile, ln, ln_len, err);
                            t09put (term, ln, cut_protected);
                            (* *)
                            buf_pos := buf_pos + sizeof(tgg00_Surrogate);
                            END;
                        (*ENDFOR*) 
                        END;
                    d_OmsVarFile:
                        BEGIN
                        FOR i := 1 TO omsPtr^.partitionCounter DO
                            BEGIN
                            uint2Ptr := @buf[ buf_pos ];
                            ln_len := c_tab_stop;
                            ln     := term.blankline;
                            g17sname_to_line ('partObjSize:', ln_len, ln);
                            ln_len := ln_len + 1;
                            g17int4to_line (gg06Int4FromUint2 (uint2Ptr^),
                                  NOT c_with_zero, 5, ln_len, ln);
                            ln_len := ln_len + 5;
                            t12write_prot (protfile, ln, ln_len, err);
                            t09put (term, ln, cut_protected);
                            (* *)
                            buf_pos := buf_pos + sizeof(tsp00_Uint2);
                            END;
                        (*ENDFOR*) 
                        FOR i := 1 TO omsPtr^.partitionCounter DO
                            BEGIN
                            int4Ptr := @buf[ buf_pos ];
                            ln_len := c_tab_stop;
                            ln     := term.blankline;
                            g17sname_to_line ('contPrtRoot:', ln_len, ln);
                            ln_len := ln_len + 1;
                            x05pageno_to_line (int4Ptr^, c_trim, ln_len, ln);
                            t12write_prot (protfile, ln, ln_len, err);
                            t09put (term, ln, cut_protected);
                            (* *)
                            buf_pos := buf_pos + sizeof(tsp00_Int4);
                            END;
                        (*ENDFOR*) 
                        buf_pos := buf_pos + sizeof (tsp00_Int4); (* filler *)
                        END;
                    d_OmsFixedFile:
                        BEGIN
                        ;
                        END;
                    END;
                (*ENDCASE*) 
                END;
            d_OmsKeyPartitionFile:
                BEGIN
                omsKeyPartPtr := @buf[ buf_pos ];
                buf_pos  := buf_pos + sizeof (FDirOmsKeyPartitionEntry);
                (* *)
                g17sname_to_line ('pFileNo    :', ln_len, ln);
                ln_len := ln_len + 1;
                g17fileno_to_line (omsKeyPartPtr^.parentFileNo, ln_len, ln);
                t12write_prot (protfile, ln, ln_len, err);
                t09put (term, ln, cut_protected);
                (* *)
                ln_len := c_tab_stop;
                ln     := term.blankline;
                g17sname_to_line ('partNo     :', ln_len, ln);
                ln_len := ln_len + 2;
                g17int4to_line (gg06Int4FromUint2 (omsKeyPartPtr^.partitionNo),
                      NOT c_with_zero, 5, ln_len, ln);
                ln_len := ln_len + 5;
                t12write_prot (protfile, ln, ln_len, err);
                t09put (term, ln, cut_protected);
                (* *)
                END;
            OTHERWISE
                BEGIN
                ;
                END;
            END;
        (*ENDCASE*) 
        (* *)
        IF  ord (entryPtr^.hasBackref) <> 0
        THEN
            buf_pos := buf_pos + entryPtr^.len; (* FIXME *)
        (*ENDIF*) 
        END
    ELSE
        buf_pos := buf_pos + entryPtr^.len;
    (*ENDIF*) 
    END;
(*ENDWHILE*) 
(* *)
IF  utds_bd_full_info in scan
THEN
    BEGIN
    ln_len   := 0;
    ln       := term.blankline;
    t12write_prot (protfile, ln, ln_len, err);
    t09put (term, ln, cut_protected);
    t12write_prot (protfile, ln, ln_len, err);
    t09put (term, ln, cut_protected);
    END;
(*ENDIF*) 
END;
 
(*------------------------------*) 
 
PROCEDURE
      xt07put_int4_as_filetype(
            msg              : tsp00_Sname;
            intVal : tsp00_Int4;
            VAR ln_len   : integer;
            VAR ln       : tsp00_Line);
 
TYPE
 
      FileTypeSet = RECORD
            CASE integer OF
                1:
                    (carr : tsp00_C4);
                2:
                    (intVal : tsp00_Int4);
                3:
                    (fset1  : tgg00_FiletypeSet;
                    filler1 : boolean;
                    filler2 : boolean;
                    fset2   : tgg00_FiletypeSet);
                END;
            (*ENDCASE*) 
 
 
VAR
      fileType         : tgg00_FiletypeSet;
      fileTypeInfo     : FileTypeSet;
 
BEGIN
g17sname_to_line (msg, ln_len, ln);
fileTypeInfo.intVal := intVal;
IF  ord(fileTypeInfo.carr[1]) <> 0
THEN (* take care if byte-swap *)
    fileType := fileTypeInfo.fset1
ELSE
    fileType := fileTypeInfo.fset2;
(*ENDIF*) 
g17filetype_to_line (fileType, NOT c_edit, ln_len, ln);
END;
 
(*------------------------------*) 
 
PROCEDURE
      xt07_DisplayLongColumnNode(
            VAR term     : tut_terminal;
            VAR protFile : tut_vf_fileref;
            VAR pNode    : tbd_nodeptr;
            VAR pfkey    : tut_pfkey );
 
VAR
      dummyError    : integer;
      currPageNoPos : tsp00_Int4;
      maxPageNoPos  : tsp00_Int4;
      entryCount    : tsp00_Int4;
      lineLength    : tsp00_Int4;
      childPageNo   : tsp00_PageNo;
      line          : tsp00_Line;
 
BEGIN
entryCount := 0;
IF  pNode^.nd_level > LEAF_LEVEL_BD00
THEN
    currPageNoPos := BODY_BEG_BD00
ELSE
    currPageNoPos := pNode^.nd_bottom; (* noop *)
(*ENDIF*) 
maxPageNoPos := pNode^.nd_bottom;
WHILE (pfkey = pf_none) AND (currPageNoPos < maxPageNoPos) DO
    BEGIN
    entryCount := entryCount + 1;
    IF  t09is_window_full (term, 1)
        OR
        (t09is_window_full (term, 2) AND (entryCount MOD 10 = 0))
    THEN
        BEGIN
        x05holdhexint (term, pfkey);
        IF  pfkey = pf_none
        THEN
            t09newscreen_page (term)
        (*ENDIF*) 
        END;
    (*ENDIF*) 
    IF  (pfkey = pf_none)
    THEN
        BEGIN
        line       := term.blankline;
        lineLength := 0;
        (* *)
        g17int4to_line (entryCount, NOT c_with_zero, 4, lineLength+1, line);
        lineLength          := lineLength + 6;
        line [lineLength-1] := ':';
        (* *)
        g17sname_to_line ('(pos        ', lineLength, line);
        lineLength        := lineLength + 1 + c_pos_digits + 1;
        line [lineLength] := ')';
        g17int4to_line (currPageNoPos, true, c_pos_digits, lineLength - c_pos_digits, line);
        lineLength        := lineLength + 1;
        (* *)
        IF  pNode^.nd_level = FIRST_INDEX_LEVEL_BD00
        THEN
            g17sname_to_line ('leaf        ', lineLength, line)
        ELSE
            g17sname_to_line ('index       ', lineLength, line);
        (*ENDIF*) 
        lineLength := lineLength + 1;
        (* *)
        childPageNo := s20buf_to_int4 (pNode^, currPageNoPos);
        g17trimint4_to_line (childPageNo, lineLength, line);
        lineLength  := lineLength + 2;
        (* *)
        t12write_prot (protFile, line, lineLength, dummyError);
        t09put (term, line,  cut_protected);
        IF  entryCount MOD 10 = 0
        THEN
            BEGIN
            t12write_prot (protFile, term.blankline, 1, dummyError);
            IF  NOT t09is_empty_window (term)
            THEN
                t09put (term, term.blankline, cut_protected)
            (*ENDIF*) 
            END;
        (* *)
        (*ENDIF*) 
        currPageNoPos := currPageNoPos + sizeof(tsp00_PageNo);
        END
    (*ENDIF*) 
    END
(*ENDWHILE*) 
END;
 
(*------------------------------*) 
 
PROCEDURE
      x07AddFileAttrToEFiletype(
            fileAttr     : integer;
            eFiletypeSet : tgg00_ExtendedFiletypeSet);
 
CONST
      cClustered = 1;
 
BEGIN
IF  (fileAttr AND cClustered) <> 0
THEN
    eFiletypeSet := eFiletypeSet + [ eftsClustered_egg00 ];
(*ENDIF*) 
END;
 
(*------------------------------*) 
 
PROCEDURE
      x07AddTableAttrToEFiletype(
            tableAttr    : integer;
            eFiletypeSet : tgg00_ExtendedFiletypeSet);
 
CONST
      cRecordsPacked = 1;
 
BEGIN
IF  (tableAttr AND cRecordsPacked) <> 0
THEN
    eFiletypeSet := eFiletypeSet + [ eftsRecordsPacked_egg00 ];
(*ENDIF*) 
END;
 
.CM *-END-* code ----------------------------------------
.SP 2 
***********************************************************
.PA 
