.;+ .INDEX -- Produce index of procedure library .; .; This procedure will produce a list of all modules in a library .; and if the first line of the module conforms to a specific .; format, will display the line as further directory documentation. .; .; Revision History .; ================ .; 17-May-85 GWA - Changed index listing method from ";" to ".data" .; - Added /-SP switch to LBR command to inhibit spooling .; - Our is corrupted, so we use the one from .; .MAIN., passed as P1 .; .ENABLE SUBSTITUTION .ONERR ERRXIT .SETS FLAG ".;+" ! define documentation flag .SETS BLANK " " .; .; Determine the library to index .; .parse p1 "/" libnam junk ! extract library name if any .test p1 "/LB" ! are we executing from a library? .if <> 0 .goto 20 ! br if yes. do our index. .10: .asks libnam What is the library name? .if libnam = "" .goto 10 ! disallow null name .testfile 'libnam' .if <> 1 .goto 10 .; .; We have the filename, now obtain a module list .; ; Display the index of modules in library 'libnam'. ; .20: .enable quiet LBR 'libnam'/LI,''INDINDEX.TMP/-SP .disable quiet .if <> .goto liberr .; .; Open the module list file and process it .; .openr indindex.tmp .ift .goto erropn .open #3 ti: .30: .read line ! get the next line from the list .ift .goto errend ! branch if empty library .test line .setn linwid -1 .sets line line[1:linwid] .data #3 'line' .test line "FILETYPE" ! look for the library type display .if = 0 .goto 30 ! keep looking .data #3 .sets type line[1:3] .if type <> "UNI" .goto errlib ! library type error .; .; Now process each module in the library .; .40: .read line ! get next module name .sets line "'line%c'" ! compress blanks .ift .goto 60 ! leave if done .test line .if = 0 .goto 40 ; 'line' .; .; avoid any lines with embedded control characters .; .setn tempn 'line%v' .if tempn < 040 .goto 40 .; .sets module line[1:6] ! get the name .if blank = module[1:1] .goto 40 .; ; 'module' .openr #1 'libnam'/lb:'module' .if = .goto 50 ; <> .goto 55 .if flag <> line[1:3] .goto 55 ; 'line' ; .goto 56 .55: ; This module does not conform to the library procedure format and ; is assumed to be a data module. ; .56: .close #1 .goto 40 .; .; Done, clean up .; .60: .close .enable quiet pip indindex.tmp;0/de .disable quiet .exit .errxit: ; Error -- exiting... .exit