1 /*  BEGIN:   fs_star_.incl.pl1                                  *  *  *  *  *  *  *  *  *  *  *  *   */
  2 
  3 /****^  HISTORY COMMENTS:
  4   1) change(88-07-15,GDixon), approve(88-09-20,MCR7987),
  5      audit(88-10-03,Beattie), install(88-10-06,MR12.2-1139):
  6      Initial version corresponding to MTB781-00.
  7   2) change(88-08-25,GDixon), approve(88-09-20,MCR7987),
  8      audit(88-10-03,Beattie), install(88-10-06,MR12.2-1139):
  9      Modifications corresponding to MTB781-01 correcting minor problems
 10      found during the review of the earlier MTB.
 11   3) change(88-09-19,GDixon), approve(88-09-20,MCR8007),
 12      audit(88-10-03,Beattie), install(88-10-06,MR12.2-1139):
 13      Final changes reflecting MTB781-02.  This is the MR12.2 version.
 14                                                    END HISTORY COMMENTS */
 15 
 16 /*  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *   */
 17 /*                                                                                                   */
 18 /* This include file declares structures and named constants used when calling the fs_star_          */
 19 /* subroutine.                                                                                       */
 20 /*                                                                                                   */
 21 /* star_options:                                                                                     */
 22 /*   defines star matching, selection and sorting criteria.                                          */
 23 /*                                                                                                   */
 24 /*  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *   */
 25 
 26 dcl  1 star_options                     aligned based (star_optionsP),
 27        2 version                        char(8),            /* = STAR_OPTIONS_VERSION_1              */
 28 
 29        2 caller,
 30          3 ssu_sciP                     ptr,                /* subsystem sci_ptr, used to get        */
 31                                                             /*  areas & temp segs, report errors.    */
 32                                                             /*  null => use other elements as below  */
 33          3 fs_star_dataP                ptr,                /* ptr to fs_star_ internal data.        */
 34 
 35        2 selection,
 36          3 star_pathsP                  ptr,                /* ptr to input pathname array.          */
 37                                                             /*  Starred paths select starting ents.  */
 38          3 path_allow                   bit(36) aligned,    /* type of paths allowed in star_paths   */
 39                                                             /*  See PATH_ALLOW_xxx constants below.  */
 40          3 entry_type,                                      /* selection/expansion of standard       */
 41            4 (                                              /*  entry types.  See ENTRY_xxx          */
 42              links,                                         /*  constants below.                     */
 43              segs,
 44              dirs,
 45              msfs,
 46              msf_comps,
 47              dm_files,
 48              archives,
 49              arch_comps,
 50              extended_entries)          bit(36) aligned,
 51          3 extended_entry_typesP        ptr,                /* ptr to entry type selection array.    */
 52                                                             /*  ^=null => only paths matching one    */
 53                                                             /*            extended entry type are    */
 54                                                             /*            selected.                  */
 55          3 match_namesP                 ptr,                /* ptr to added starname match array.    */
 56                                                             /*  ^=null => only paths matching one    */
 57                                                             /*            or more matchnames are     */
 58                                                             /*            selected.                  */
 59          3 exclude_namesP               ptr,                /* ptr to starname exclusion array.      */
 60                                                             /*  ^=null => selected paths matching    */
 61                                                             /*            one or more excludenames   */
 62                                                             /*            are de-selected.           */
 63 
 64        2 per_entry,                                         /* For each selected entry:              */
 65          3 sorting                      (6),                /* major/minor sort keys, by locator     */
 66            4 (                                              /*   within selected subtree.            */
 67              dirs,                                          /*  Sorting of dirs in selected subtree  */
 68              dir_ents,                                      /*  Sorting of ents in selected dirs.    */
 69              comps)                     fixed bin,          /*  Sorting of archive and msf           */
 70                                                             /*   components in selected ents.        */
 71                                                             /*  Lower-numbered array elements are    */
 72                                                             /*   major keys.  See SORT_xxx           */
 73                                                             /*   constants below.                    */
 74          3 handler                                          /*  call this proc to handle entry.      */
 75                                         entry (ptr, char(*), (*)char(32), char(*), fixed bin),
 76 /*                        call handler (star_dataP, dir, ent_names, comp_name, action);              */
 77          3 error                                            /*  call this proc if error occurs.      */
 78                                         entry (ptr, char(*), (*)char(32), char(*),
 79                                                fixed bin(35), char(*), fixed bin),
 80 /*                          call error (star_dataP, dir, ent_names, comp_name,                       */
 81 /*                                      code, message, action);                                      */
 82                                                             /*  =ssu_$null_entry =>                  */
 83                                                             /*          use ssu_$print_error         */
 84          3 handler_dataP                ptr,                /* ptr to caller-provided data passed    */
 85                                                             /*  on to .handler and .error.           */
 86          3 data_desired                 fixed bin,          /* type of info to pass to .handler      */
 87                                                             /*  for each selected entry.  See        */
 88                                                             /*  DATA_xxx constants below.            */
 89          3 data_version                 char(8) unal,       /* Version of star_data structure        */
 90                                                             /*  that .handler expects to receive.    */
 91                                                             /*  Only STAR_DATA_VERSION_1 allowed.    */
 92        2 mbz                            bit(36) aligned,    /* Reserved for future use.              */
 93      star_optionsP                      ptr;                /* ptr to star_options structure.        */
 94 
 95 /*  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *   */
 96 /*                                                                                                   */
 97 /* Named Constant for star_options.version:                                                          */
 98 /*    version of star_options the caller is prepared to deal with.                                   */
 99 /*                                                                                                   */
100 /*  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *   */
101 
102 dcl  STAR_OPTIONS_VERSION_1             init("STAROPT1") char(8) int static options(constant);
103 ^L
104 /*  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *   */
105 /*                                                                                                   */
106 /* star_paths:                                                                                       */
107 /*    array of directory entry pathnames (or archive component pathnames) which does initial         */
108 /*    pathname selection, based upon starnames in dir part (dir>**>ent), final entryname (dir>**),   */
109 /*    and/or archive component part (dir>ent.archive::**) of pathname.  These starnames select the   */
110 /*    initial set of entries to which further selection criteria are applied.                        */
111 /*    star_options.path_allow setting controls which type of pathname (dir entry or archive          */
112 /*    component) is allowed, and which parts may contain stars.                                      */
113 /*                                                                                                   */
114 /*  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *   */
115 
116 dcl  1 star_paths                       aligned based (star_options.star_pathsP),
117        2 version                        char(8),            /* = STAR_PATHS_VERSION_1                */
118        2 max_count                      fixed bin,          /* maximum size of value array for the   */
119                                                             /*  current allocation of star_paths.    */
120        2 count                          fixed bin,          /* current size of value array.          */
121        2 value (star_paths_size refer (star_paths.max_count)) char(202) unal,
122                                                             /* dir>**>ent>**::**                     */
123      star_paths_size                    fixed bin auto,
124      STAR_PATHS_VERSION_1               init("STARPTH1") char(8) int static options(constant);
125 
126 /*  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *   */
127 /*                                                                                                   */
128 /* Named Constants for star_options.path_allow:                                                      */
129 /*    select the types of pathnames are allowed, and which pathname components may contain stars.    */
130 /*                                                                                                   */
131 /*  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *   */
132 
133 dcl (PATH_ALLOW_DIR_STAR_NAMES          init("1"b),         /*  dir>**>ent                           */
134      PATH_ALLOW_ENTRY_STAR_NAMES        init("01"b),        /*  dir>**                               */
135      PATH_ALLOW_ARCHIVE_COMPONENTS      init("001"b),       /*  dir>ent::comp                        */
136      PATH_ALLOW_ARCHIVE_STAR_NAMES      init("0001"b),      /*  dir>ent::**                          */
137      PATH_ALLOW_ARCHIVE_COMP_STAR_NAMES init("0011"b),      /*  dir>ent::** or dir>ent::comp         */
138      PATH_ALLOW_NONDIR_STAR_NAMES       init("0111"b),      /*  dir>**::**                           */
139      PATH_ALLOW_BRANCH_STAR_NAMES       init("1100"b),      /*  dir>**>**                            */
140      PATH_ALLOW_ALL_STAR_NAMES          init("1111"b))      /*  dir>**>**::**                        */
141                                         bit(36) aligned int static options(constant);
142 ^L
143 /*  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *   */
144 /*                                                                                                   */
145 /* Named Constants for star_options.selection.entry_type:                                            */
146 /*    for entries matching the starname, selection by entry type, control expansion, etc.            */
147 /*    One named constant from each group may be ORed together to form a value to be assigned to      */
148 /*    each star_options.entry_type.XXX value (eg, star_options.entry_type.segs).                     */
149 /*                                                                                                   */
150 /*  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *   */
151 
152 dcl (ENTRY_DONT_RETURN                  init("1"b),          /* Don't return entries of this type.   */
153      ENTRY_RETURN                       init("0"b),          /* Return entries of this type.         */
154 
155      ENTRY_LIST_SUBENTRIES              init("01"b),         /* List components of matching ents.    */
156      ENTRY_DONT_LIST_SUBENTRIES         init("00"b),         /* Don't list components of match ents. */
157                                                              /*  Applies to: dirs, archives, msfs    */
158 
159      ENTRY_INAEE                        init("001"b),        /* Interpret as extended ent (-inaee).  */
160      ENTRY_INASE                        init("000"b),        /* Interpret as standard ent (-inase).  */
161                                                              /*  Applies to: segs, dirs, msfs, &     */
162                                                              /*  dm_files.                           */
163 
164      ENTRY_DONT_SELECT_NULL             init("0001"b),       /* Select only nonnull entries.         */
165      ENTRY_DONT_SELECT_NONNULL          init("00001"b),      /* Select only null entries.            */
166      ENTRY_SELECT_NULL_NONNULL          init("00000"b),      /* Select both null and nonnull entries.*/
167                                                              /*  Applies to: links, segs, msfs,      */
168                                                              /*  msf_comps, archives, arch_comps     */
169 
170      ENTRY_CHASE_NONSTAR_LINKS          init("000001"b),     /* Chase links only if link was not     */
171                                                              /*  selected by a starname.             */
172      ENTRY_CHASE_ALL_LINKS              init("0000001"b),    /* Chase all links. (-chase)            */
173      ENTRY_DONT_CHASE_LINKS             init("0000000"b),    /* Don't chase links. (-no_chase)       */
174                                                              /*  Applies to: links                   */
175 
176      ENTRY_DONT_SELECT_OBJECTS          init("00000001"b),   /* Select only nonobject files.         */
177      ENTRY_DONT_SELECT_NONOBJECTS       init("000000001"b),  /* Select only object files.            */
178      ENTRY_SELECT_ALL_FILES             init("000000000"b),  /* Select both objects and nonobjects.  */
179                                                              /*  Applies to: segs, msfs, arch_comps  */
180 
181      ENTRY_DONT_SELECT_MDIRS            init("0000000001"b), /* Select only nonmaster dirs.          */
182      ENTRY_DONT_SELECT_NON_MDIRS        init("00000000001"b),/* Select only master dirs.             */
183      ENTRY_SELECT_ALL_DIRS              init("00000000000"b))/* Select both masters and nonmasters.  */
184                                                              /*  Applies to: dirs                    */
185                                         bit(36) aligned int static options(constant);
186 ^L
187 /*  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *   */
188 /*                                                                                                   */
189 /* extended_entry_types:                                                                             */
190 /*    array of extended entry types applied to entries selected from the star_paths array.  If an    */
191 /*    entry matches any of the given extended types, that entry is included for further selection.   */
192 /*                                                                                                   */
193 /*  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *   */
194 
195 dcl  1 extended_entry_types             aligned based (star_options.extended_entry_typesP),
196        2 version                        char(8),            /* = STAR_EXTENDED_ENTRY_VERSION_1       */
197        2 max_count                      fixed bin,          /* maximum size of value array for the   */
198                                                             /*  current allocation of                */
199                                                             /*  extended_entry_types.                */
200        2 count                          fixed bin,          /* current size of value array.          */
201        2 value (extended_entry_types_size refer (extended_entry_types.max_count)) char(32) unal,
202                                                             /* -slet EXTENDED_TYPE                   */
203      extended_entry_types_size          fixed bin auto,
204      STAR_EXTENDED_ENTRY_VERSION_1      init("STARETP1") char(8) int static options(constant);
205 
206 
207 /*  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *   */
208 /*                                                                                                   */
209 /* match_names:                                                                                      */
210 /*    array of additional starnames which are applied to entries selected from the star_paths        */
211 /*    and extended_entry_types arrays.  If any name on an entry matches any match_name, that entry   */
212 /*    is included for further selection.                                                             */
213 /*                                                                                                   */
214 /*  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *   */
215 
216 dcl  1 match_names                      aligned based (star_options.match_namesP),
217        2 version                        char(8),            /* = STAR_MATCH_NAMES_VERSION_1          */
218        2 max_count                      fixed bin,          /* maximum size of value array for the   */
219                                                             /*  current allocation of match_names.   */
220        2 count                          fixed bin,          /* current size of value array.          */
221        2 value (match_names_size refer (match_names.max_count)) char(32) unal,
222                                                             /*  -match **                            */
223      match_names_size                   fixed bin auto,
224      STAR_MATCH_NAMES_VERSION_1         init("STARMNM1") char(8) int static options(constant);
225 
226 
227 /*  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *   */
228 /*                                                                                                   */
229 /* exclude_names:                                                                                    */
230 /*    array of starnames which are applied to entries selected from star_paths,                      */
231 /*    extended_entry_types and match_names arrays.  If any name on an entry matches an exclude       */
232 /*    name, that entry is excluded from further selection.                                           */
233 /*                                                                                                   */
234 /*  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *   */
235 
236 dcl  1 exclude_names                    aligned based (star_options.exclude_namesP),
237        2 version                        char(8),            /* = STAR_EXCLUDE_NAMES_VERSION_1        */
238        2 max_count                      fixed bin,          /* maximum size of value array for the   */
239                                                             /*  current allocation of exclude_names  */
240        2 count                          fixed bin,          /* current size of value array.          */
241        2 value (exclude_names_size refer (exclude_names.max_count)) char(32) unal,
242                                                             /*  -exclude **                          */
243      exclude_names_size                 fixed bin auto,
244      STAR_EXCLUDE_NAMES_VERSION_1       init("STARENM1") char(8) int static options(constant);
245 ^L
246 /*  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *   */
247 /*                                                                                                   */
248 /* Named Constants for star_options.handler:                                                         */
249 /*   handler procedure's action parameter to control the further progress of searching.              */
250 /*                                                                                                   */
251 /*  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *   */
252 
253 dcl (HANDLER_OK                         init (0),           /* no error when handling entry.         */
254      HANDLER_REJECT                     init (1),           /* no error, but handler does not        */
255                                                             /*  accept entry; it should not be       */
256                                                             /*  counted, expanded, etc.              */
257      HANDLER_DONT_EXPAND                init (2),           /* no error, but handler does not want   */
258                                                             /*  dir/archive entry expanded.          */
259      HANDLER_EXPAND                     init (3),           /* no error, but expand dir/archive      */
260                                                             /*  even if contrary to .entry_type.     */
261      HANDLER_EXPAND_DONT_COUNT          init (4),           /* no error, but handler does not accept */
262                                                             /*  entry; it should not be counted, but */
263                                                             /*  should be expanded.                  */
264      HANDLER_DONT_COUNT                 init (5),           /* no error, but handler does not accept */
265                                                             /*  entry; it should not be counted. Its */
266                                                             /*  expansion depends upon .entry_type   */
267                                                             /*  setting for this type of entry.      */
268      HANDLER_STOP                       init (6),           /* no error, but the selection process   */
269                                                             /*  process terminates immediately.      */
270                                                             /*  Entry should be counted, then        */
271                                                             /*  fs_star_$select returns to caller.   */
272      HANDLER_ABORT                      init (7)            /* error, entry not counted, selection   */
273                                                             /*  process terminates immediately,      */
274                                                             /*  handler reports any error, then      */
275                                                             /*  fs_star_$select returns to caller.   */
276           )                             fixed bin internal static options(constant);
277 ^L
278 /*  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *   */
279 /*                                                                                                   */
280 /* Named Constants for star_options.error:                                                           */
281 /*   error procedure's action parameter.                                                             */
282 /*                                                                                                   */
283 /*  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *   */
284 
285 dcl (ERROR_OK                           init (0),           /* error was processed successfully.     */
286                                                             /*  Entry causing error should be        */
287                                                             /*  counted as a match, but should not   */
288                                                             /*  be passed to handler for processing  */
289                                                             /*  nor expanded.                        */
290      ERROR_REJECT                       init (1),           /* error was processed successfully.     */
291                                                             /*  Entry causing error was rejected,    */
292                                                             /*  should not be counted as a match,    */
293                                                             /*  expanded, nor passed to handler.     */
294      ERROR_STOP                         init (6),           /* error was processed successfully,     */
295                                                             /*  but error routine wants to stop the  */
296                                                             /*  selection process immediately.       */
297                                                             /*  Entry should be counted as a match,  */
298                                                             /*  but not expanded nor passed to the   */
299                                                             /*  handler routine for processing.      */
300      ERROR_ABORT                        init (7)            /* error processing was unsuccessful.    */
301                                                             /*  Error routine wants to stop the      */
302                                                             /*  selection process immediately.       */
303                                                             /*  Entry should not be counted as a     */
304                                                             /*  match, expanded, nor passed to the   */
305                                                             /*  handler routine.                     */
306           )                             fixed bin internal static options(constant);
307 ^L
308 /*  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *   */
309 /*                                                                                                   */
310 /* Named Constants for star_options.sorting:                                                         */
311 /*                                                                                                   */
312 /*    fs_star_ can sort the selected entries before they are passed to the caller-provided handler   */
313 /* routine.  Sorting of selected entries can be based upon three categories of sorting:              */
314 /*   - the attributes of selected archive or MSF components (the component's name or its position    */
315 /*     within the archive/msf); or                                                                   */
316 /*   - the attributes of the selected directory entry (matching entryname, entry type or position    */
317 /*     within the directory); or                                                                     */
318 /*   - the selected entry's location within the selected subtree, or the matching entrynames in the  */
319 /*     directory part of the pathname of a selected entry.                                           */
320 /*                                                                                                   */
321 /*    To provide flexibility, any of the sorting categories above can be used singly, or in          */
322 /* combination.  If used in combination, component sorting occurs before entry sorting, which occurs */
323 /* before directory pathname sorting.  Within a given category, several sorting operations are       */
324 /* possible.  These include:                                                                         */
325 /*   - sorting by name;                                                                              */
326 /*   - sorting by (standard or extended) entry type;                                                 */
327 /*   - sorting of children entries with respect to their parent;                                     */
328 /*   - sorting in ascending or descending sequence (forward or reverse); or                          */
329 /*   - sorting can be disabled for the category.                                                     */
330 /*                                                                                                   */
331 /*    Within a sort category, each sorting operation can be used singly, or in combinations of one to*/
332 /* four sort operations in a caller-defined order.  Order sort operations are specified by filling in*/
333 /* the elements of the star_options.sorting arrays.  For example:                                    */
334 /*        star_options.selection.entry_type = ENTRY_RETURN;                                          */
335 /*        star_options.sorting(*) = SORT_OFF;                                                        */
336 /*        star_options.sorting(1) = SORT_FORWARD;                                                    */
337 /*        star_options.sorting(1).comps = SORT_BY_NAME;                                              */
338 /* passes all directories and directory entries in the selected subtree to the handler routine in the*/
339 /* order they were returned by hcs_$star_.  Selected components of archives and MSFs are passed to   */
340 /* the handler routine, sorted by component name.                                                    */
341 /*        star_options.selection.entry_type = ENTRY_RETURN;                                          */
342 /*        star_options.sorting(*) = SORT_OFF;                                                        */
343 /*        star_options.sorting(1) = SORT_FORWARD;                                                    */
344 /*        star_options.sorting(1).comps = SORT_REVERSE;                                              */
345 /*        star_options.sorting(2).comps = SORT_BY_NAME;                                              */
346 /* passes the components to the handler sorted by component name, in reverse ASCII collating         */
347 /* sequence.                                                                                         */
348 /*        star_options.selection.entry_type = ENTRY_DONT_RETURN;                                     */
349 /*        star_options.selection.entry_type.dirs =  ENTRY_DONT_RETURN | ENTRY_LIST_SUBENTRIES;       */
350 /*        star_options.selection.entry_type.archives = ENTRY_DONT_RETURN | ENTRY_LIST_SUBENTRIES;    */
351 /*        star_options.selection.entry_type.arch_comps = ENTRY_RETURN;                               */
352 /*        star_options.sorting(*) = SORT_OFF;                                                        */
353 /*        star_options.sorting(1).comps = SORT_BY_NAME;                                              */
354 /* passes the archive components to the handler sorted by component name, irrespective of the archive*/
355 /* the component resides in.  That is, components in all archives selected from the subtree are found*/
356 /* and sorted by name, and then passed to the handler in that order.                                 */
357 /*                                                                                                   */
358 /*  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *   */
359 ^L
360 /*  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *   */
361 /*                                                                                                   */
362 /*        star_options.selection.entry_type = ENTRY_RETURN;                                          */
363 /*        star_options.selection.entry_type.dirs = ENTRY_LIST_SUBENTRIES;                            */
364 /*        star_options.selection.entry_type.arch_comps = ENTRY_DONT_RETURN;                          */
365 /*        star_options.selection.entry_type.msf_comps = ENTRY_DONT_RETURN;                           */
366 /*        star_options.sorting(*) = SORT_OFF;                                                        */
367 /*        star_options.sorting(1).dirs = SORT_BY_NAME;                                               */
368 /*        star_options.sorting(1).dir_ents = SORT_BY_STANDARD_TYPE                                   */
369 /*        star_options.sorting(2).dir_ents = SORT_BY_NAME;                                           */
370 /*        star_options.sorting(3).dir_ents = SORT_ENTRIES_BEFORE_SUBENTRIES;                         */
371 /* passes selected entries to the handler routine sorted by directory, and within a directory sorted */
372 /* by matching entryname within entry type groupings.  For entries in a single directory, this is the*/
373 /* type of grouping and sorting performed by the command:                                            */
374 /*        list -sort name -all                                                                       */
375 /*                                                                                                   */
376 /*    Sorting is based upon the location of the item within the selected subtree.  If sorting by     */
377 /* dirs(*) is SORT_OFF, then the entire subtree must be selected and sorted before any data can be   */
378 /* passed to the handler.  If sorting by dirs(*) is not SORT_OFF, then the contents of each dir is   */
379 /* sorted and passed to handler before processing subdirs.  This provides more immediate response.   */
380 /*                                                                                                   */
381 /*    Elements of the star_data.matched minor structure below are counts of the total entries found, */
382 /* divided by entry type.  If sorting.dirs(*) is SORT_OFF, then these counts represent the total of  */
383 /* all entries selected within the entire subtree.  Otherwise, they represent only the entries       */
384 /* selected and sorted within the current node of the subtree and all previously handled nodes.      */
385 /*                                                                                                   */
386 /*  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *   */
387 
388 dcl (SORT_OFF                           init(0),            /* Don't sort by this subtree locator.   */
389      SORT_FORWARD                       init(1),            /* Sort entries in order returned by     */
390                                                             /*  hcs_$star_ or archive_ subrs.        */
391      SORT_REVERSE                       init(2),            /* Reverse ordering specified by         */
392                                                             /*  sort_sel elements with higher        */
393                                                             /*  index values.                        */
394      SORT_BY_NAME                       init(3),            /* Sort by primary matching ent name.    */
395      SORT_BY_STANDARD_ENTRY_TYPE        init(4),            /* Sort by standard entry type.          */
396      SORT_BY_EXTENDED_ENTRY_TYPE        init(5),            /* Sort by extended entry type.          */
397      SORT_ENTRIES_BEFORE_SUBENTRIES     init(6))            /* Sort all entries in a directory before*/
398                                                             /*  looking for any subentries.  By      */
399                                                             /*  default, subentries below an entry   */
400                                                             /*  are expanded immediately after the   */
401                                                             /*  entry is encountered in the sorted   */
402                                                             /*  sequence of directory entries.       */
403                                         fixed bin int static options(constant);
404 
405 
406 /*  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *   */
407 /*                                                                                                   */
408 /* Named Constants for star_options.data_desired:                                                    */
409 /*    values control the amount of data returned to caller's entry handler routine in                */
410 /*    star_data.entry_data.                                                                          */
411 /*                                                                                                   */
412 /*  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *   */
413 
414 dcl (DATA_TYPE                          init (1),           /*  Entry type, only.                    */
415      DATA_INITIATE                      init (2))           /*  Entry type, length and count         */
416                                         fixed bin int static options(constant);
417 ^L
418 /*  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *   */
419 /*                                                                                                   */
420 /* Named constant for star_options.data_version:                                                     */
421 /*    caller-specified version of star_data he is willing to accept.                                 */
422 /*                                                                                                   */
423 /*  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *   */
424 
425 dcl  STAR_DATA_VERSION_1                init ("STARDAT1") char(8) int static options(constant);
426                                                             /* star_data version 1 structure.        */
427 
428 /*  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *   */
429 /*                                                                                                   */
430 /* star_data:                                                                                        */
431 /*    information provided to caller-supplied entry handler routine for each selected entry.         */
432 /*                                                                                                   */
433 /*  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *   */
434 
435 dcl  1 star_data                        aligned based (star_dataP),
436        2 version                        char(8),            /* = STAR_DATA_VERSION_1                 */
437        2 star_optionsP                  ptr,                /* ptr to caller-supplied star_options   */
438                                                             /*  structure.  This makes               */
439                                                             /*  star_options.handler_dataP           */
440                                                             /*  available to the handler routine.    */
441        2 matched,                                           /* count of matching entries:            */
442          3 (
443            current,                                         /*  index of current entry in sort list  */
444            total,                                           /*  count of total entries.              */
445            links,                                           /*  count of total links.                */
446            segs,                                            /*  count of total non-archive,          */
447                                                             /*   non-extended entry segments.        */
448            dirs,                                            /*  count of total directories.          */
449            msfs,                                            /*  count of total multisegment files.   */
450            msf_comps,                                       /*  count of total msf components.       */
451            dm_files,                                        /*  count of total data mgt files.       */
452            archives,                                        /*  count of total archives.             */
453            arch_comps,                                      /*  count of total archive components.   */
454            extended_entries)            fixed bin,          /*  count of total extended entries.     */
455                                                             /*  See Named Constants for              */
456                                                             /*   sort_options.sorting above.         */
457          3 mbz_matched                  (4) fixed bin,      /* reserved for future use.              */
458 
459        2 entry_data,                                        /* Beginning of DATA_xxx return items.   */
460          3 data_desired                 fixed bin,          /* amount of data in entry_data minor    */
461                                                             /*  structure which is valid.            */
462          3 depth                        fixed bin,          /* depth of this entry below its         */
463                                                             /*  corresponding parent in              */
464                                                             /*  star_paths.value.                    */
465          3 type                         char(32) unal,      /* extended entry type for matching      */
466                                                             /*  entry.  See ENTRY_TYPE_xxx           */
467                                                             /*  constants below for standard entry   */
468                                                             /*  types.  Extended types are given     */
469                                                             /*  by entry type suffix (eg, mbx).      */
470                                                             /* Data above available when             */
471                                                             /*  data_desired set to DATA_TYPE.       */
472 ^L
473          3 length                       fixed bin(35),      /* length of entry (by entry type):      */
474                                                             /*  link      => 0                       */
475                                                             /*  seg       => bit count               */
476                                                             /*  dir       => 0                       */
477                                                             /*  msf       => sum of comp bit counts  */
478                                                             /*  msf comp  => msf comp bit count      */
479                                                             /*  dm_file   => 0                       */
480                                                             /*  arch      => bit count of archive    */
481                                                             /*  arch comp => bit count of component  */
482                                                             /*  ext entry => 0                       */
483          3 count                        fixed bin(35),      /* length of entry (by entry type):      */
484                                                             /*  link      => 0                       */
485                                                             /*  seg       => 0                       */
486                                                             /*  dir       => inferior entry count    */
487                                                             /*  msf       => number of components    */
488                                                             /*  msf comp  => total msf components    */
489                                                             /*  dm_file   => 0                       */
490                                                             /*  arch      => number of components    */
491                                                             /*  arch comp => total arch components   */
492                                                             /*  ext entry => 0                       */
493          3 entryP                       ptr,                /* ptr to an entry:                      */
494                                                             /*  link      => null                    */
495                                                             /*  seg       => ptr to segment          */
496                                                             /*  dir       => null                    */
497                                                             /*  msf       => ptr to msf_manager_     */
498                                                             /*               fcb_ptr argument        */
499                                                             /*  msf comp  => ptr to msf component    */
500                                                             /*  dm_file   => null                    */
501                                                             /*  arch      => ptr to archive          */
502                                                             /*  arch comp => ptr to component        */
503                                                             /*  ext entry => null                    */
504                                                             /* Data above available when             */
505                                                             /*  data_desired set to DATA_INITIATE.   */
506 
507      star_dataP                         ptr automatic;      /* ptr to star_data structure.           */
508 ^L
509 /*  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *   */
510 /*                                                                                                   */
511 /* Named constants for star_data.type:                                                               */
512 /*    type values describing the type of entry passed to caller-supplied handler routine.  Type      */
513 /*    strings for file system standard entry types (links, segments, dirs, dm_files, msfs) agree     */
514 /*    with those returned by fs_util_$get_type.                                                      */
515 /*                                                                                                   */
516 /*  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *   */
517 
518 dcl (ENTRY_TYPE_ARCHIVE                 init ("-archive"),
519      ENTRY_TYPE_ARCHIVE_COMP            init ("-archive_component"),
520      ENTRY_TYPE_DIRECTORY               init ("-directory"),
521      ENTRY_TYPE_DM_FILE                 init ("-dm_file"),
522      ENTRY_TYPE_LINK                    init ("-link"),
523      ENTRY_TYPE_MSF                     init ("-multisegment_file"),
524      ENTRY_TYPE_MSF_COMP                init ("-msf_component"),
525      ENTRY_TYPE_SEGMENT                 init ("-segment"),
526      ENTRY_TYPE_UNKNOWN                 init ("-unknown"),
527      ENTRY_TYPE_UNSET                   init ("")
528           )                             char (32) unaligned int static options (constant);
529 
530 dcl  STANDARD_ENTRY_TYPES               (9) char (32) unal/* array of standard entry type values.    */
531                                         int static options(constant) init (
532                                         "-link",
533                                         "-segment",
534                                         "-directory",
535                                         "-multisegment_file",
536                                         "-msf_component",
537                                         "-dm_file",
538                                         "-archive",
539                                         "-archive_component",
540                                         "-unknown");
541 
542 /*  END OF:  fs_star_.incl.pl1                                  *  *  *  *  *  *  *  *  *  *  *  *   */