$! ................... Cut between dotted lines and save. ................... $!........................................................................... $! VAX/VMS archive file created by VMS_SHARE V06.10 7-FEB-1989. $! $! VMS_SHARE was written by James Gray (Gray:OSBUSouth@Xerox.COM) from $! VMS_SHAR by Michael Bednarek (U3369429@ucsvc.dn.mu.oz.au). $! $! To unpack, simply save, concatinate all parts into one file and $! execute (@) that file. $! $! This archive was created by user PHILIPPE $! on 22-DEC-1989 09:48:49.95. $! $! It contains the following 4 files: $! MAKE_TLB.DOC $! EXTRACT_TLB.COM $! MAKE_TLB.COM $! XTR.COM $! $!============================================================================ $ SET SYMBOL/SCOPE=( NOLOCAL, NOGLOBAL ) $ VERSION = F$GETSYI( "VERSION" ) $ IF VERSION .GES "V4.4" THEN GOTO VERSION_OK $ WRITE SYS$OUTPUT "You are running VMS ''VERSION'; ", - "VMS_SHARE V06.10 7-FEB-1989 requires VMS V4.4 or higher." $ EXIT 44 ! SS$_ABORT $VERSION_OK: $ GOTO START $! $UNPACK_FILE: $ WRITE SYS$OUTPUT "Creating ''FILE_IS'" $ DEFINE/USER_MODE SYS$OUTPUT NL: $ EDIT/TPU/COMMAND=SYS$INPUT/NODISPLAY/OUTPUT='FILE_IS'/NOSECTION - VMS_SHARE_DUMMY.DUMMY b_part := CREATE_BUFFER( "{Part}", GET_INFO( COMMAND_LINE, "file_name" ) ) ; s_file_spec := GET_INFO( COMMAND_LINE, "output_file" ); SET( OUTPUT_FILE , b_part, s_file_spec ); b_errors := CREATE_BUFFER( "{Errors}" ); i_errors := 0; pat_beg_1 := ANCHOR & "-+-+-+ Beginning"; pat_beg_2 := LINE_BEGIN & "+-+-+-+ Beginning"; pat_end := ANCHOR & "+-+-+-+-+ End"; POSITION ( BEGINNING_OF( b_part ) ); LOOP EXITIF SEARCH( SPAN( ' ' )@r_trail & LINE_END, FORWARD) = 0; POSITION( r_trail ); ERASE( r_trail ); ENDLOOP ; POSITION( BEGINNING_OF( b_part ) ); i_append_line := 0; LOOP EXITIF MARK ( NONE ) = END_OF( b_part ); s_x := ERASE_CHARACTER( 1 ) ; IF s_x = '+' THEN r_skip := SEARCH( pat_beg_1, FORWARD, EXACT ); IF r_skip <> 0 THEN s_x := ''; MOVE_HORIZONTAL( -CURRENT_OFFSET ); ERASE_LINE; ENDIF ; ENDIF; IF s_x = '-' THEN r_skip := SEARCH( pat_end, FORWARD, EXACT ) ; IF r_skip <> 0 THEN s_x := ''; MOVE_HORIZONTAL( -CURRENT_OFFSET ); m_skip := MARK( NONE ); r_skip := SEARCH( pat_beg_2, FORWARD, EXACT ); IF r_skip <> 0 THEN POSITION( END_OF( r_skip ) ); MOVE_HORIZONTAL( -CURRENT_OFFSET ) ; MOVE_VERTICAL( 1 ); MOVE_HORIZONTAL( -1 ); ELSE POSITION( END_OF( b_part ) ); ENDIF; ERASE( CREATE_RANGE( m_skip, MARK( NONE ), NONE ) ); ENDIF; ENDIF ; IF s_x = 'V' THEN s_x := ''; IF i_append_line <> 0 THEN APPEND_LINE ; MOVE_HORIZONTAL( -CURRENT_OFFSET ); ENDIF; i_append_line := 1 ; MOVE_VERTICAL( 1 ); ENDIF; IF s_x = 'X' THEN s_x := ''; IF i_append_line <> 0 THEN APPEND_LINE; MOVE_HORIZONTAL( -CURRENT_OFFSET ); ENDIF ; i_append_line := 0; MOVE_VERTICAL( 1 ); ENDIF; IF s_x <> '' THEN i_errors := i_errors + 1; s_text := CURRENT_LINE; POSITION( b_errors ); COPY_TEXT ( "The following line could not be unpacked properly:" ); SPLIT_LINE ; COPY_TEXT( s_x ); COPY_TEXT( s_text ); POSITION( b_part ); MOVE_VERTICAL ( 1 ); ENDIF; ENDLOOP; POSITION( BEGINNING_OF( b_part ) ); LOOP r_x := SEARCH ( "`", FORWARD, EXACT ); EXITIF r_x = 0; POSITION( r_x ); ERASE_CHARACTER( 1 ); COPY_TEXT( ASCII( INT( ERASE_CHARACTER( 3 ) ) ) ); ENDLOOP ; IF i_errors = 0 THEN SET( NO_WRITE, b_errors, ON ); ELSE POSITION ( BEGINNING_OF( b_errors ) ); COPY_TEXT( FAO ( "The following !UL errors were detected while unpacking !AS", i_errors , s_file_spec ) ); SPLIT_LINE; SET( OUTPUT_FILE, b_errors, "SYS$COMMAND" ) ; ENDIF; EXIT; $ DELETE VMS_SHARE_DUMMY.DUMMY;* $ CHECKSUM 'FILE_IS $ WRITE SYS$OUTPUT " CHECKSUM ", - F$ELEMENT( CHECKSUM_IS .EQ. CHECKSUM$CHECKSUM, ",", "failed!!,passed." ) $ RETURN $! $START: $ FILE_IS = "MAKE_TLB.DOC" $ CHECKSUM_IS = 1131884468 $ COPY SYS$INPUT VMS_SHARE_DUMMY.DUMMY X MAKE_TLB.COM X Version 2 by Stuart Fuller X XThis command procedure creates a text library (.TLB) from all of the Xsequential files files in the directory. The text library is DCX Xcompressed after creation. X XMAKE_TLB.COM should be copied to the directory you want to use. X X $ @MAKE_TLB text_library_name_to_create X XAfter the operation, the following new files are in the directory: X The text library (compressed version) X EXTRACT_TLB.COM - A procedure to extract the files from the library. X NOT_IN_TLB.LIS - A listing of files not placed in the library. X XFiles that are candidates for loading into the text library include all Xvariable record length files (text files, .OBJ files, etcand all fixed Xrecord length files up to 2048 bytes per record (.EXE, other library Xfiles, BACKUP savesets made with /BLOCK=2048/GROUP=0, etc). X XFiles that are not sequential (indexed files, for example), and Xfixed record length files with record size greater than 2048 can not be Xsaved in the text library. However, these files can be placed into a XBACKUP saveset and the saveset may be placed into the library (see above Xparagraph). X XThe internal names for variable record length files in the text library Xare the same as the original names, except "." is replaced with "`094". The Xinternal names for fixed record length files is the same as the original Xnames, except '.' is replaced by '#', and the record size and another '#' Xis appended to the file name. X X X EXTRACTING FILES X XThe command procedures (MAKE_TLB.COM and EXTRACT_TLB.COM) are always Xcontained in the text library. To extract all of the files from the text Xlibrary, issue the following DCL commands: X X $ LIB/EXTRACT=EXTRACT_TLB`094COM/OUTPUT=EXTRACT_TLB.COM library_name.TLB X $ @EXTRACT_TLB library_name X XThere is another command file included in the library called XTR.COM. XThis command file will prompt for a text library name, and execute the Xabove 2 commands for you. $ GOSUB UNPACK_FILE $ FILE_IS = "EXTRACT_TLB.COM" $ CHECKSUM_IS = 1276859519 $ COPY SYS$INPUT VMS_SHARE_DUMMY.DUMMY X$ ! The following lines comprise the command file EXTRACT_TLB.COM X$ ! X$ wo := "WRITE SYS$OUTPUT " X$ ! X$ ! Get the library name, either from the command line, or from the`032 X$ ! user. Append a ".TLB" if not already there. X$ ! X$ Lib_Name = p1 X$get_Lib_Name:`009 X$ If Lib_Name .eqs. "" then inquire Lib_Name "Name for .TLB file" X$ If Lib_Name .eqs. "" then Goto get_Lib_Name X$ Lib_Name = f$Parse(Lib_Name, ".TLB") X$ ! X$ ! List out the contents of the library and start looking thru it for X$ ! some files to extract out of it. X$ ! X$ Library/Text/List=Contents.Lis 'Lib_Name' X$ Open/Read File Contents.Lis X$read_next: X$ read/end=finished file this_file X$ ! V$ ! First, try looking for a '`094'. If we found one, then this is a variabl Xe X$ ! record file. Just replace the '`094' with a '.' to make a legal filename X$ ! and extract it X$ ! X$ file_name = f$element (0,"`094",this_file) X$ If file_name .eqs. this_file then Goto try_fixed X$ file_type = f$element (1,"`094",this_file) X$ If file_type .eqs. "`094" then file_type = "" X$ file_out = file_name + "." + file_type X$ wo "Extracting: " + File_Out + " (variable)" X$ Library/Text/Extract='This_file'/Output='File_out' 'Lib_Name' X$ Goto read_next X$ ! X$ ! Next, let's see if there's a '#' in the module name. If so, then X$ ! the first element of the module name is the filename, the second X$ ! is the filetype, and the third is the record length X$ ! X$try_fixed: X$ file_name = f$element (0,"#",this_file) X$ If file_name .eqs. this_file then Goto read_next X$ file_type = f$element (1,"#",this_file) X$ If file_type .eqs. "#" then file_type = "" X$ file_out = file_name + "." + file_type X$ Rec_Size = f$element (2, "#", this_file) X$ wo "Extracting: " + file_out + " (fixed, ''rec_size')" X$ Library/Text/Extract='This_file'/Output='File_out' 'Lib_Name' X$ !`032 X$ ! Build a .FDL file, so that we can convert the variable record file that X$ ! the librarian created back to a fixed record file X$ ! X$ Open/Write List Extract_Tlb.FDL X$ Write List "RECORD" X$ Write List " Carriage_Control None" X$ Write List " Format Fixed" X$ Write List " Size " + f$String(Rec_Size) X$ Close list X$ ! X$ ! Convert the variable record file to a fixed file, and clean up by X$ ! deleting the .FDL and the variable record file. X$ ! X$ Convert/FDL=Extract_Tlb.FDL 'File_Out' 'File_Out' X$ Delete 'File_out';-1 X$ Delete Extract_TLB.FDL; X$ Goto Read_Next X$ ! X$ ! OK, Now clean up by deleting the contents listing, and ourself. X$ ! Since EXTRACT_TLB will be in the list of files to extract from the X$ ! library, so there's no need to keep two copies, eh? X$ ! X$finished: X$ close file X$ Delete Contents.Lis; X$ Delete 'f$Environment("PROCEDURE")' X$ EXIT $ GOSUB UNPACK_FILE $ FILE_IS = "MAKE_TLB.COM" $ CHECKSUM_IS = 1917427315 $ COPY SYS$INPUT VMS_SHARE_DUMMY.DUMMY X$ Goto BEGIN_MAKE_TLB X$ ! X$ ! The following lines comprise the command file EXTRACT_TLB.COM X$ ! X$ wo := "WRITE SYS$OUTPUT " X$ ! X$ ! Get the library name, either from the command line, or from the`032 X$ ! user. Append a ".TLB" if not already there. X$ ! X$ Lib_Name = p1 X$get_Lib_Name:`009 X$ If Lib_Name .eqs. "" then inquire Lib_Name "Name for .TLB file" X$ If Lib_Name .eqs. "" then Goto get_Lib_Name X$ Lib_Name = f$Parse(Lib_Name, ".TLB") X$ ! X$ ! List out the contents of the library and start looking thru it for X$ ! some files to extract out of it. X$ ! X$ Library/Text/List=Contents.Lis 'Lib_Name' X$ Open/Read File Contents.Lis X$read_next: X$ read/end=finished file this_file X$ ! V$ ! First, try looking for a '`094'. If we found one, then this is a variabl Xe X$ ! record file. Just replace the '`094' with a '.' to make a legal filename X$ ! and extract it X$ ! X$ file_name = f$element (0,"`094",this_file) X$ If file_name .eqs. this_file then Goto try_fixed X$ file_type = f$element (1,"`094",this_file) X$ If file_type .eqs. "`094" then file_type = "" X$ file_out = file_name + "." + file_type X$ wo "Extracting: " + File_Out + " (variable)" X$ Library/Text/Extract='This_file'/Output='File_out' 'Lib_Name' X$ Goto read_next X$ ! X$ ! Next, let's see if there's a '#' in the module name. If so, then X$ ! the first element of the module name is the filename, the second X$ ! is the filetype, and the third is the record length X$ ! X$try_fixed: X$ file_name = f$element (0,"#",this_file) X$ If file_name .eqs. this_file then Goto read_next X$ file_type = f$element (1,"#",this_file) X$ If file_type .eqs. "#" then file_type = "" X$ file_out = file_name + "." + file_type X$ Rec_Size = f$element (2, "#", this_file) X$ wo "Extracting: " + file_out + " (fixed, ''rec_size')" X$ Library/Text/Extract='This_file'/Output='File_out' 'Lib_Name' X$ !`032 X$ ! Build a .FDL file, so that we can convert the variable record file that X$ ! the librarian created back to a fixed record file X$ ! X$ Open/Write List Extract_Tlb.FDL X$ Write List "RECORD" X$ Write List " Carriage_Control None" X$ Write List " Format Fixed" X$ Write List " Size " + f$String(Rec_Size) X$ Close list X$ ! X$ ! Convert the variable record file to a fixed file, and clean up by X$ ! deleting the .FDL and the variable record file. X$ ! X$ Convert/FDL=Extract_Tlb.FDL 'File_Out' 'File_Out' X$ Delete 'File_out';-1 X$ Delete Extract_TLB.FDL; X$ Goto Read_Next X$ ! X$ ! OK, Now clean up by deleting the contents listing, and ourself. X$ ! Since EXTRACT_TLB will be in the list of files to extract from the X$ ! library, so there's no need to keep two copies, eh? X$ ! X$finished: X$ close file X$ Delete Contents.Lis; X$ Delete 'f$Environment("PROCEDURE")' X$ EXIT X$ ! X$ !`012 X$ ! X$ BEGIN_MAKE_TLB: X$ wo := "WRITE SYS$OUTPUT " X$ ! X$ ! This section writes a file EXTRACT_TLB.COM using all of the lines at X$ ! the top of this file, except for the first two lines. X$ ! X$ wo "This is MAKE_TLB V2" X$ wo "Creating extraction procedure EXTRACT_TLB.COM" X$ this_file = f$environment("PROCEDURE") X$ open/read/shared file 'this_file' X$ open/write xcom EXTRACT_TLB.COM X$ read file line X$ read file line X$ x_read: X$ read/end=do_tlb file line X$ write xcom line X$ If f$extract(0,6,line) .eqs. "$ EXIT" then Goto do_tlb X$ Goto x_read X$ !`032 X$ do_tlb: X$ close file X$ close xcom X$ purge extract_tlb.com X$ ! X$ !`012 X$ !`032 X$ ! MAKE_TLB.COM X$ ! Makes a compressed text library from all files in the current X$ ! directory. Handled all types of variable record length files, and`032 X$ ! fixed record length files with record size of 2048 or lower. X$ !`032 X$ Vfy = f$verify(0) X$ !`032 X$ ! Get a name for the .TLB X$ ! X$ Lib_Name = p1 X$Get_Lib_Name:`009 X$ If Lib_Name .eqs. "" Then $ Inquire Lib_Name "Name for .TLB file" X$ If Lib_Name .eqs. "" Then $ Goto Get_Lib_Name X$ Lib_Name = f$Parse(Lib_Name, ".TLB") X$ Library/Create/Text 'Lib_Name' X$ !`032 X$ ! Create a list of files that will not be included in the .TLB, and X$ ! and initialize some counters X$ open/write excluded_files not_in_tlb.lis X$ include_count = 0 X$ exclude_count = 0 X$ !`032 X$ ! Start a loop gathering filenames. X$ ! X$read_next: X$ This_file = f$Search("*.*") X$ If This_File .eqs. "" Then $ Goto Did_Files X$ ! X$ ! Make sure we don't include the .TLB we're building. X$ ! X$ If f$element(0, ";", Lib_Name) .eqs. f$element(0, ";", This_File) Then - X $ Goto Read_Next X$ ! X$ ! Break apart the filespec into the name and type X$ ! X$ File_name = f$parse(this_file,,,"NAME") X$ File_type = f$parse(this_file,,,"TYPE") - "." X$ ! X$ ! Skip our exclusion listing, and any directory files X$ ! X$ If file_name .eqs. "NOT_IN_TLB" then Goto read_next X$ If file_type .eqs. "DIR" then Goto exclude X$ ! X$ ! Get file attribute info for later use X$ ! X$ Fixed = (f$file_attributes (this_file, "RFM") .eqs. "FIX") X$ Rec_Size = f$file_attributes (this_file, "MRS")`032 X$ If Fixed .and. (Rec_Size .gt. 2048) Then $ Goto Exclude X$ ! X$ ! We don't do non-sequential files. If we want to xfer a non-seq file X$ ! then, put it in a BACKUP save set with /GROUP=0 and /BLOCK=2048 X$ ! X$ If f$file_attributes (this_file,"ORG") .nes. "SEQ" then Goto exclude X$ ! X$ ! Ok, we have a file to work on X$ ! X$include:`009 X$ wo "Including: " + This_File X$ ! X$ ! The format of the lib entry for a fixed record file is: X$ ! name#type#rec_len X$ ! X$ If Fixed Then - V $ Module_Name = file_name + "#" + file_type + "#" + f$string(Rec_Size X) X$ ! X$ ! The format of the lib entry for a variable record file is: X$ ! name`094type X$ !`032 X$ If .Not. Fixed Then -`032 X $ Module_Name = file_name + "`094" + file_type X$ ! X$ ! Insert into the text library, with the new module name X$ ! and increment a counter X$ ! X$ Library/Text/Insert 'Lib_Name' 'This_File'/Module='Module_Name' X$ include_count = include_count + 1 X$ Goto read_next X$ ! X$ ! Sorry, we don't do this file. Add it to the exclusion list and count. X$ !`032 X$exclude: X$ wo "Excluding: " + This_File + " *****" X$ write excluded_files This_File`032 X$ exclude_count = exclude_count + 1 X$ Goto read_next X$ !`032 X$ !`012 X$ ! X$ ! Ok, we're done building the library. Some more to do. Close the X$ ! exclusion list, purge them, compress the library and delete the`032 X$ ! non-compressed library, show the user the library listing X$ ! X$did_files: X$ close excluded_files X$ purge not_in_tlb.lis X$ wo "Compressing text library: " + lib_name X$ Library/Text/Data=Reduce 'Lib_Name' X$ Library/Text/List 'Lib_Name' X$ Delete 'Lib_Name'-1 X$ ! X$ ! If we excluded any files, then tell the user about it X$ ! X$ If exclude_count .eq. 0 then Goto no_exclude X$ wo "" X$ wo "*** The following files were excluded from the library " + Lib_Name X$ type not_in_tlb.lis X$ wo "" X$ wo "*** A listing of these files is contained in " - X`009 + "NOT_IN_TLB.LIS" X$ Goto conclusion X$no_exclude:`009 X$ delete not_in_tlb.lis; X$ !`032 X$conclusion: X$ Vfy = f$Verify(Vfy) X$ exit $ GOSUB UNPACK_FILE $ FILE_IS = "XTR.COM" $ CHECKSUM_IS = 2065632295 $ COPY SYS$INPUT VMS_SHARE_DUMMY.DUMMY X$ ! X$ ! Generic procedure to extract the contents of ANY library created with X$ ! the MAKE_TLB.COM procedure. X$ ! X$ ! Get a name for the .TLB X$ ! X$ Lib_Name = p1 X$Get_Lib_Name:`009 X$ If Lib_Name .eqs. "" Then $ Inquire Lib_Name "Name for .TLB file" X$ If Lib_Name .eqs. "" Then $ Goto Get_Lib_Name X$ Lib_Name = f$parse(Lib_Name, ".TLB") X$ !`032 X$ Library/Extract=EXTRACT_TLB`094COM/Output=EXTRACT_TLB.COM 'Lib_Name' X$ @EXTRACT_TLB 'Lib_Name' X$ $ GOSUB UNPACK_FILE $ EXIT