1 
  2 
  3 
  4 
  5 /*    *     *     *     *     *     *     *     *     *     *     *     *     *     *     *     *     *     *
  6    *
  7    *                  THIS  IS  THE  BEGINNING  OF  THE  LISTING TAPE   INCLUDE  FILE
  8    *                                    ( lts_tables.incl.pl1 )
  9    *
 10    *
 11    *
 12    *     All  listing tape procedures  follow the coding conventions specified below.
 13    *
 14    *     1.    All major or level 1 structures will have a name that begins with a
 15    *           capital  letter  and  will not contain any break characters.
 16    *
 17    *     2.    All variable references will use a fully qualified name.
 18    *
 19    *     3.    The following terms or suffixes have a consistent special meaning:
 20    *           a)    x     -  when it is the last letter of a variable name it denotes that
 21    *                          the variable is used as an  ** index ** of an array.
 22    *           b)    ptr   -  when these are the last letters of a variable name it denotes
 23    *                          that the variable is a ** pointer **.
 24    *           c)    PTr   -  this suffix not only denotes a pointer variable but also
 25    *                          denotes that the  pointer was declared by the  **based attribute **
 26    *                          in the declaration of a based variable.
 27    *           d)    num   -  this term denotes that the variable represents the
 28    *                          actual  allocated dimension of an array.
 29    *           e)    size  -  this term denotes that the variable is the size
 30    *                          of a structure in  ** 36 bit words **.
 31    *           f)    len   -  this suffix denotes that the variable specifies a length
 32    *                          in  9  bit  characters.
 33    *
 34    *     4.    In any fully qualified name containing an array the subscript will
 35    *           be  expressed immediately following the level which actually is an array.
 36    */
 37 
 38 
 39 
 40 
 41 /*    The  following  three  tables  are the most important  data bases  in the
 42    *     listing  tape  system.  An understanding of what these tables contain
 43    *     and how they are used is essential if one is to understand how  the  listing
 44    *     tape  system  is  implemented.
 45    */
 46 
 47 
 48 
 49 
 50 
 51 /*                        The  ALPHA  Table
 52    *
 53    *     The table  ** A ** which denotes  ALPHA  is the most important  lts
 54    *     table.    It is passed as an argument in every call to an external
 55    *     lts  procedure.  It contains pointers to all of the  DICTIONARY  and TAPE
 56    *     tables.  It is  A  which links these two types of tables together.
 57    *
 58    *     Note that the  error code variable  required by all  calls  is found
 59    *     in this table.
 60    */
 61 
 62 
 63 dcl  Atab_max_num fixed bin init (14) static;               /* Specifies the maximum size of the  A.tab
 64                                                              * array. It currently allows for 1 output
 65                                                              * tape, 2 input tapes, and 11 directories. */
 66 
 67 
 68 dcl 1 A,
 69 
 70     2 bufptr ptr,                                           /* It points to the work buffer segment.  */
 71     2 fileptr ptr,                                          /* Points to initiated listing file or user data file segment.  */
 72     2 SPtr ptr,                                             /* The main pointer to the   S  (Sort) table.  */
 73     2 x fixed bin,                                          /* It is a subscript to the  A.tab  array  */
 74     2 num fixed bin,                                        /* The actual number of A.tab entries used - except entry 0.  */
 75     2 code fixed bin,                                       /* Is used as the  error code  for all calls. */
 76     2 command char (8),                                     /* The name of the current command. */
 77     2 date char (16),                                       /* Today's  date.  */
 78     2 comd_line char (140),                                 /* The command line of this command. */
 79     2 printer_stream char (16),                             /* The stream name used to attach the  printer.  */
 80 
 81     2 tab (0:13),                                           /* This table has an entry for each  DICTIONARY table allocated.
 82                                                                *  Entry  ** 0**  is reserved for  output D and T tables.  */
 83       3 dir_name char (168) aligned,                        /* Pathname specified by -dn  or -directory_name parameter. */
 84       3 Dptr ptr,                                           /* Points to a  DICTIONARY  table.     */
 85       3 Tptr ptr,                                           /* Points to the  T  table related to the above D table.   */
 86       3 flag bit (1) aligned;                               /* This flag denotes whether or not the specified  DICTIONARY
 87                                                                was read from a  TAPE  or was built from a directory.
 88                                                                If it was built from a directory then Tptr will be null.  */
 89 
 90 
 91 
 92 
 93 
 94 
 95 /*                       The  DICITONARY  Table
 96    *
 97    *
 98    *     The sturcture  ** D **  which denotes  DICTIONARY   is in fact a
 99    *     dictionary of all the  listing  files  contained on  a  listing  tape.
100    *     A  DICTIONARY  table is allocated for each listing tape that is
101    *     attached by any  lts  command.   A  D  table is also  allocated when a
102    *     directory pathname is entered as a parameter to the  ltc  or  ltm  commands.
103    */
104 
105 
106 dcl  DPtr ptr,                                              /* The main pointer to the  DICTIONARY  table.  */
107      num_files fixed bin init (0);                          /* The dimension of  D.file when  D  is  allocated.  */
108 
109 
110 
111 dcl 1 D based (DPtr),
112     2 size fixed bin,                                       /* The  size in 36 bit words of the whole  D  table.  */
113     2 num fixed bin,                                        /* Actual number of entries allocated in the file array.  */
114     2 reel_seqx fixed bin,                                  /* Used to check that the tape reels are in sequence.  */
115     2 x fixed bin,                                          /* Used to  index  the  file  array.  */
116     2 date char (16),                                       /* The  date  the  tape  was made.  */
117 
118     2 file (num_files),                                     /* This table has an entry for each file
119                                                                referenced by this  dictionary.  */
120       3 uid bit (36),                                       /* Unique  ID  of  this file.  */
121       3 name char (32),                                     /* The  entry  name  of this file.  */
122       3 size fixed bin,                                     /* The  size  of this file in 36 bit words.  */
123       3 seg_count fixed bin,                                /* The number of segments needed to contain this file.
124                                                                If seg_count  =  1  then this is a single-segment
125                                                                file.  Otherwize it is the number of segments
126                                                                comprizing this  multi-segment  file.  */
127       3 area char (16),                                     /* For  example:  tools  or  hard_core.  */
128       3 sys_num char (16),                                  /* The  system from which this  listing file was compiled.  */
129       3 date_created char (16),                             /* The date the file was created.  */
130       3 date_dumped char (16),                              /* The date the file was  last  dumped.  */
131       3 Atabx fixed bin;                                    /* An index to the  A.tab  entry which relates to this  D  table.
132                                                                *  NOTE: This field is also used to mark this entry for some
133                                                                *  special  purpose  such as  deleting  or  printing.  */
134 
135 
136 dcl  marker_flag fixed bin init (100);                      /* A special code used to set and test the Atabx field of
137                                                                *  of a  D  table.  */
138 
139 dcl  block_size fixed bin (17) static internal init (65536);  /* Block size for reading and writing */
140 
141 
142 
143 
144 
145 /*                        The  TAPE  Table
146    *
147    *
148    *     The table  ** T **  which  denotes  TAPE  contains data relating to
149    *     an  lts  listing  tape.   Note,  throughout  all  Listing  Tape  System
150    *     documentation  a  listing  tape  is  always  a logical  tape which may consist
151    *     of  one  or  several  physical  reels.   There  is  one  TAPE  table allocated
152    *     for each  logical  listing tape  used by any  listing tape  system  command.
153    *     The  function  of   the  TAPE  table is to relate a logical  listing tape
154    *     to  its  physical  reels.   Note  that an  ** output **  listing  tape  is
155    *     always  associated  with  entry  zero  in  the  A.tab  array.
156    */
157 
158 
159 
160 
161 dcl  TPtr ptr,                                              /* The main pointer to a TAPE table.  */
162      num_reels fixed bin;                                   /* The  dimension of  T.reel  when  T  is  allocated.  */
163 
164 
165 
166 dcl 1 T based (TPtr),
167     2 x fixed bin,                                          /* Used to index  the   reel  array.  */
168     2 num fixed bin,                                        /* Actual number of entries in  T.reel when T is allocated.  */
169     2 reel (10) char (32);                                  /* This  array contains an entry for each  physical reel
170                                                                which comprises  this  logical  tape.
171                                                                Each entry is the external reel name of its
172                                                                associated reel.  */
173 
174 
175 
176 
177 
178 
179 
180 
181 /*    The following constants are used as  lts  defined  error codes.   These codes denote
182    *     error conditions that are discovered by  lts  itself.  All references to error codes
183    *     by  lts  procedures are thus done  symbolically.  The actual  values of these codes may be
184    *     changed without  disturbing any  lts  procedure.
185    */
186 
187 dcl (lts_code_arg_error fixed bin init (2),
188      lts_code_file_not_found fixed bin init (3),
189      lts_code_no_reel fixed bin init (4),
190      lts_code_reel_end fixed bin init (5),
191      lts_code_unknown_status fixed bin init (6),
192      lts_code_wrong_reel fixed bin init (7),
193      lts_code_unknown_sfile fixed bin init (8),
194      lts_code_user_file fixed bin init (9)) static;
195 
196 
197 
198 
199 /*    The  following  builtin  functions  are  used by  lts.       */
200 
201 
202 dcl (addr,
203      addrel,
204      bit,
205      divide,
206      fixed,
207      index,
208      length,
209      null,
210      size,
211      substr,
212      unspec) builtin;
213 
214 
215 /*
216    *
217    *
218    *
219    *                THIS  IS  THE  END  OF  THE   INCLUDE  FILE
220    *
221    *     *     *     *     *     *     *     *     *     *     *     *     *     *     *     *     *     *
222    */
223 
224 
225