home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / PIBCAT.ZIP / PIBCAT.GLO < prev    next >
Encoding:
Text File  |  1987-01-30  |  8.4 KB  |  181 lines

  1. (*----------------------------------------------------------------------*)
  2. (*                   GLOBAL VARIABLE DEFINITIONS                        *)
  3. (*----------------------------------------------------------------------*)
  4.  
  5. CONST
  6.                    (* 8086/8088 hardware flags *)
  7.  
  8.    Carry_Flag     = 1;
  9.    Parity_Flag    = 4;
  10.    Aux_Carry_Flag = 16;
  11.    Zero_Flag      = 64;
  12.    Sign_Flag      = 128;
  13.  
  14. TYPE
  15.  
  16.    AnyStr   = STRING[255]  (* Matches any string for parameter passing *);
  17.  
  18.    String2  = STRING[2]    (* Two character string *);
  19.  
  20.    String3  = STRING[3]    (* Three character string *);
  21.  
  22.    String8  = STRING[8]    (* Eight character string *);
  23.  
  24.    FileStr  = STRING[65]   (* File name string *);
  25.  
  26.    RegPack  = RECORD       (* 8086/8088 registers                      *)
  27.                  CASE INTEGER OF
  28.                     1: ( Ax, Bx, Cx, Dx, Bp, Si, Di, Ds, Es, Flags : INTEGER );
  29.                     2: ( Al, Ah, Bl, Bh, Cl, Ch, Dl, Dh            : BYTE    );
  30.               END;
  31.  
  32.    Text_File = TEXT [4096]   (* General text file                 *);
  33.  
  34.    LongInt   = RECORD       (* 32 bit long INTEGER type *)
  35.                   Low  : INTEGER;
  36.                   High : INTEGER;
  37.                END;
  38.  
  39. (*----------------------------------------------------------------------*)
  40. (*                  Map of MsDos Directory Entry                        *)
  41. (*----------------------------------------------------------------------*)
  42.  
  43. TYPE
  44.  
  45.    Directory_Record = RECORD
  46.                          Filler    : ARRAY[1..21] Of BYTE;
  47.                          File_Attr : BYTE      (* File attributes *);
  48.                          File_Time : INTEGER   (* Creation time   *);
  49.                          File_Date : INTEGER   (* Creation date   *);
  50.                          File_Size : LongInt   (* Size in bytes   *);
  51.                          File_Name : ARRAY[1..80] Of CHAR (* Name *);
  52.                       END;
  53.  
  54. (*----------------------------------------------------------------------*)
  55. (*                 Map of Extended File Control Block                   *)
  56. (*----------------------------------------------------------------------*)
  57.  
  58.    Extended_FCB    = RECORD
  59.                         Fcb_Flag    : BYTE                 (* $FF = extended FCB *);
  60.                         Filler1     : ARRAY[1..5] OF BYTE;
  61.                         FCB_Attr    : BYTE                 (* File attribute *);
  62.                         FCB_Drive   : BYTE                 (* Drive *) ;
  63.                         FCB_FileName: ARRAY[1..11] OF CHAR (* File name *);
  64.                         FCB_BlockNo : INTEGER              (* Block # *);
  65.                         FCB_RecSize : INTEGER              (* Record size *);
  66.                         FCB_FileSize: Longint              (* File size *);
  67.                         FCB_Date    : INTEGER              (* File date *);
  68.                         FCB_Time    : INTEGER              (* File time *);
  69.                         Filler2     : ARRAY[1..33] OF BYTE (* Make 64 bytes *);
  70.                      END;
  71.                                    (* File attribute values *)
  72. CONST
  73.    Dir_Attr_Read_Only    =  1;
  74.    Dir_Attr_Hidden       =  2;
  75.    Dir_Attr_System       =  4;
  76.    Dir_Attr_Volume_Label =  8;
  77.    Dir_Attr_Subdirectory = 16;
  78.    Dir_Attr_Archive      = 32;
  79.  
  80.                                    (* File access modes *)
  81.    Access_Read_Mode           = 0;
  82.    Access_Write_Mode          = 1;
  83.    Access_Read_And_Write_Mode = 2;
  84.  
  85.                                    (* File attributes *)
  86.    Attribute_None             = 0;
  87.    Attribute_Read_Only        = 1;
  88.    Attribute_Hidden           = 2;
  89.    Attribute_System           = 4;
  90.    Attribute_Volume_Label     = 8;
  91.    Attribute_Subdirectory     = 16;
  92.    Attribute_Archive          = 32;
  93.  
  94. (*----------------------------------------------------------------------*)
  95. (*                  Error types for .ARC and .LBR files                 *)
  96. (*----------------------------------------------------------------------*)
  97.  
  98. CONST
  99.    Open_Error    = 1               (* Error when opening file    *);
  100.    Format_Error  = 2               (* .ARC/.LBR format bad       *);
  101.    End_Of_File   = 3               (* End of .ARC/.LBR directory *);
  102.  
  103. (*----------------------------------------------------------------------*)
  104. (*                    Global program variables                          *)
  105. (*----------------------------------------------------------------------*)
  106.  
  107. CONST
  108.    FF_Char               : CHAR = ^L        (* Form feed character      *);
  109.  
  110. VAR
  111.    Cat_Drive             : CHAR             (* Drive to catalog         *);
  112.    Output_File           : Text_File        (* File to receive output   *);
  113.    Output_File_Name      : AnyStr           (* Output file name         *);
  114.    Do_Printer_Format     : BOOLEAN          (* Format for printer       *);
  115.    Left_Margin           : INTEGER          (* Left margin              *);
  116.    Page_Size             : INTEGER          (* Page size for output     *);
  117.    Expand_Arcs           : BOOLEAN          (* TRUE to expand .ARC/.LBR *);
  118.    Expand_Arcs_In        : BOOLEAN          (* TRUE to expand .ARC/.LBR *)
  119.                                             (* in main catalog list     *);
  120.    Left_Margin_String    : AnyStr           (* Blanks for left margin   *);
  121.    ArcLbr_Indent         : INTEGER          (* Indent for .ARC/.LBR     *);
  122.    User_Break            : BOOLEAN          (* TRUE if ^C stops liting  *);
  123.    Find_Spec             : AnyStr           (* File spec for listing    *);
  124.    Entry_Spec            : AnyStr           (* Entry spec for listing   *);
  125.    Entry_Name            : AnyStr           (* Name portion, entry spec *);
  126.    Entry_Ext             : AnyStr           (* Extension, entry spec    *);
  127.    Use_Entry_Spec        : BOOLEAN          (* TRUE to use entry spec   *);
  128.    Total_Files           : REAL             (* Total files found        *);
  129.    Total_Space           : REAL             (* Total space used         *);
  130.    Total_Entries         : REAL             (* Total entries found      *);
  131.    Total_ESpace          : REAL             (* Total space used, entries*);
  132.    Total_Dirs            : REAL             (* Total dirs scanned       *);
  133.    Page_Number           : INTEGER          (* Current page number      *);
  134.    Lines_Left            : INTEGER          (* Lines left on cur. page  *);
  135.    Help_Only             : BOOLEAN          (* TRUE if doing help only  *);
  136.  
  137. (*----------------------------------------------------------------------*)
  138. (*                  Titles and subtitles for paginated listings         *)
  139. (*----------------------------------------------------------------------*)
  140.  
  141. VAR
  142.    Volume_Title : AnyStr           (* Main title for entire listing *);
  143.    Subdir_Title : AnyStr           (* Current subdirectory title    *);
  144.    File_Title   : AnyStr           (* Current .ARC/.LBR file if any *);
  145.  
  146. (*----------------------------------------------------------------------*)
  147. (*                  Saved file names from nested directories            *)
  148. (*----------------------------------------------------------------------*)
  149.  
  150. CONST
  151.    MaxFiles              = 2048             (* Maximum files handled    *);
  152.  
  153. TYPE
  154.  
  155.    Short_Dir_Record = RECORD
  156.                          File_Attr : BYTE        (* File attributes *);
  157.                          File_Time : INTEGER     (* Creation time   *);
  158.                          File_Date : INTEGER     (* Creation date   *);
  159.                          File_Size : LongInt     (* Size in bytes   *);
  160.                          File_Name : STRING[12]  (* File name       *);
  161.                       END;
  162.  
  163. VAR
  164.                                    (* List of files in current and all *)
  165.                                    (* previous directories along path  *)
  166.                                    (* back to root directory.          *)
  167.  
  168.    File_Stack : ARRAY[1..MaxFiles] OF Short_Dir_Record;
  169.  
  170.                                    (* # of files currently saved       *)
  171.    File_Count : INTEGER;
  172.  
  173. (*----------------------------------------------------------------------*)
  174. (*                  Names of the months for date conversions            *)
  175. (*----------------------------------------------------------------------*)
  176.  
  177. (* STRUCTURED *) CONST
  178.    Month_Names : ARRAY[1..12] OF STRING[3] =
  179.                  ('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
  180.                   'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec' );
  181.