$!/* acf4:vmsnet.sources / tp@mccall.com / 6:26 am Oct 5, 1990 */ $!Submitted-by: fauconne@frsim51.bitnet (Alain Fauconnet) $!Archive-name: vmstar/patch1-part1 $! $! ------------------ CUT HERE ----------------------- $ v='f$verify(f$trnlnm("SHARE_VERIFY"))' $! $! This archive created by VMS_SHARE Version 7.2-007 22-FEB-1990 $! On 28-SEP-1990 22:28:23.75 By user FAUCONNET $! $! This VMS_SHARE Written by: $! Andy Harper, Kings College London UK $! $! Acknowledgements to: $! James Gray - Original VMS_SHARE $! Michael Bednarek - Original Concept and implementation $! $! TO UNPACK THIS SHARE FILE, CONCATENATE ALL PARTS IN ORDER $! AND EXECUTE AS A COMMAND PROCEDURE ( @name ) $! $! THE FOLLOWING FILE(S) WILL BE CREATED AFTER UNPACKING: $! 1. V11V12.DIFF;3 $! $set="set" $set symbol/scope=(nolocal,noglobal) $f=f$parse("SHARE_TEMP","SYS$SCRATCH:.TMP_"+f$getjpi("","PID")) $e="write sys$error ""%UNPACK"", " $w="write sys$output ""%UNPACK"", " $ if f$trnlnm("SHARE_LOG") then $ w = "!" $ ve=f$getsyi("version") $ if ve-f$extract(0,1,ve) .ges. "4.4" then $ goto START $ e "-E-OLDVER, Must run at least VMS 4.4" $ v=f$verify(v) $ exit 44 $UNPACK: SUBROUTINE ! P1=filename, P2=checksum $ if f$search(P1) .eqs. "" then $ goto file_absent $ e "-W-EXISTS, File ''P1' exists. Skipped." $ delete 'f'* $ exit $file_absent: $ if f$parse(P1) .nes. "" then $ goto dirok $ dn=f$parse(P1,,,"DIRECTORY") $ w "-I-CREDIR, Creating directory ''dn'." $ create/dir 'dn' $ if $status then $ goto dirok $ e "-E-CREDIRFAIL, Unable to create ''dn'. File skipped." $ delete 'f'* $ exit $dirok: $ w "-I-PROCESS, Processing file ''P1'." $ if .not. f$verify() then $ define/user sys$output nl: $ EDIT/TPU/NOSEC/NODIS/COM=SYS$INPUT 'f'/OUT='P1' PROCEDURE Unpacker ON_ERROR ENDON_ERROR;SET(FACILITY_NAME,"UNPACK");SET( SUCCESS,OFF);SET(INFORMATIONAL,OFF);f:=GET_INFO(COMMAND_LINE,"file_name");b:= CREATE_BUFFER(f,f);p:=SPAN(" ")@r&LINE_END;POSITION(BEGINNING_OF(b)); LOOP EXITIF SEARCH(p,FORWARD)=0;POSITION(r);ERASE(r);ENDLOOP;POSITION( BEGINNING_OF(b));g:=0;LOOP EXITIF MARK(NONE)=END_OF(b);x:=ERASE_CHARACTER(1); IF g=0 THEN IF x="X" THEN MOVE_VERTICAL(1);ENDIF;IF x="V" THEN APPEND_LINE; MOVE_HORIZONTAL(-CURRENT_OFFSET);MOVE_VERTICAL(1);ENDIF;IF x="+" THEN g:=1; ERASE_LINE;ENDIF;ELSE IF x="-" THEN IF INDEX(CURRENT_LINE,"+-+-+-+-+-+-+-+")= 1 THEN g:=0;ENDIF;ENDIF;ERASE_LINE;ENDIF;ENDLOOP;t:="0123456789ABCDEF"; POSITION(BEGINNING_OF(b));LOOP r:=SEARCH("`",FORWARD);EXITIF r=0;POSITION(r); ERASE(r);x1:=INDEX(t,ERASE_CHARACTER(1))-1;x2:=INDEX(t,ERASE_CHARACTER(1))-1; COPY_TEXT(ASCII(16*x1+x2));ENDLOOP;WRITE_FILE(b,GET_INFO(COMMAND_LINE, "output_file"));ENDPROCEDURE;Unpacker;QUIT; $ delete/nolog 'f'* $ CHECKSUM 'P1' $ IF CHECKSUM$CHECKSUM .eqs. P2 THEN $ EXIT $ e "-E-CHKSMFAIL, Checksum of ''P1' failed." $ ENDSUBROUTINE $START: $ create 'f' X*** vmstar.c;-1 X--- vmstar.c X************** X*** 15,21 X *`09file - space-separated list of file names, can include VMS-style X *`09 string wildcards on extract, can be any VMS file name X * specification (except DECnet) on create archive. X!`20 X * Original author of the VMS2TAR and TAR2VMS programs: X * Copyright 1986, Sid Penstone, X * Department of Electrical Engineering, X--- 15,21 ----- X *`09file - space-separated list of file names, can include VMS-style X *`09 string wildcards on extract, can be any VMS file name X * specification (except DECnet) on create archive. X! * X * Original author of the VMS2TAR and TAR2VMS programs: X * Copyright 1986, Sid Penstone, X * Department of Electrical Engineering, X************** X*** 35,41 X * PROBLEMS SHOULD BE REPORTED TO ME. PLEASE DON'T BOTHER SID PENSTONE X * WITH MY OWN BUGS ! X * X! * Version 1.1 17-SEP-1990 X * Based on TAR2VMS V2.2 21-OCT-1986 and VMS2TAR V1.8 23-DEC-1986 X * X * Sid Penstone did not include any copyright information in his program s Vo X--- 35,41 ----- X * PROBLEMS SHOULD BE REPORTED TO ME. PLEASE DON'T BOTHER SID PENSTONE X * WITH MY OWN BUGS ! X * X! * Version 1.2 28-SEP-1990 X * Based on TAR2VMS V2.2 21-OCT-1986 and VMS2TAR V1.8 23-DEC-1986 X * X * Sid Penstone did not include any copyright information in his program s Vo X************** X*** 45,50 X * source file of any modified version of VMSTAR. X * X * Modification history: X * 1.1 - reworked handling of current VMS default X * - will now create *relative* tarfiles (i.e. files known X * as "./..." in tar archive directory) except when X--- 45,54 ----- X * source file of any modified version of VMSTAR. X * X * Modification history: X+ * 1.2 - fixed bug in out_file not closing input VMS file, limited X+ * maximum number of files archived to FILLM quota X+ * - added mapping to underscores of some more characters found X+ * in Un*x file names illegal in VMS file names X * 1.1 - reworked handling of current VMS default X * - will now create *relative* tarfiles (i.e. files known X * as "./..." in tar archive directory) except when X************** X*** 138,144 X *ctime(), /* System function */ X linkname`5BNAMSIZE`5D, /* Linked file name */ X searchname`5BNAMSIZE`5D, /* used in the NAM block for SYS$SEARCH */ X! dbuffer`5BDSIZE`5D; /* input file buffer for create operation */ X `20 X struct stat sblock; /* structure returned from stat() */ X struct FAB fblock; /* File attribute block */ X--- 142,150 ----- X *ctime(), /* System function */ X linkname`5BNAMSIZE`5D, /* Linked file name */ X searchname`5BNAMSIZE`5D, /* used in the NAM block for SYS$SEARCH */ X! dbuffer`5BDSIZE`5D, /* input file buffer for create operation */ X! badchars`5B`5D = `7B",+`7E`60@#%`5E*?`7C\&`5B`5D`7B`7D"`7D; X! /* Chars found in Un*x file names, illegal in VMS V */ X `20 X struct stat sblock; /* structure returned from stat() */ X struct FAB fblock; /* File attribute block */ X************** X*** 626,635 X `7D X `20 X `20 X! /* Remove illegal characters from directory and file names; replace X! * hyphens and commas with underscores.Returns number of translations X! * that were made. X! */ X `20 X vms_cleanup(string) X char string`5B`5D; X--- 632,641 ----- X `7D X `20 X `20 X! /* vms_cleanup -- removes illegal characters from directory and file names X! * Replaces hyphens and commas with underscores. Returns number of transla Vtions X! * that were made. X! */ X `20 X vms_cleanup(string) X char string`5B`5D; X************** X*** 634,653 X vms_cleanup(string) X char string`5B`5D; X `7B X! int i,flag=0; X! char c; X! for(i=0;c=string`5Bi`5D;i++) X! `7B X! switch (c) X! `7B X! case ',': /* No commas in file names */ X! string`5Bi`5D= '_'; X! flag++; /* Record if any changes were made */ X! break; X! default: X! string`5Bi`5D = toupper(c); /* map to uppercase */ X! break; X! `7D X `7D X return(flag); X `7D X--- 640,654 ----- X vms_cleanup(string) X char string`5B`5D; X `7B X! int i,flag=0; X! char c; X!`20 X! for(i=0; c=string`5Bi`5D; ++i) X! `7B X! if (strchr(badchars, c) != NULL) X! `7B /* Replace illegal characters by underscore Vs */ X! string`5Bi`5D= '_'; X! flag++; /* Record if any changes were made */ X `7D X else X string`5Bi`5D = toupper(c); /* Map to uppercase */ X************** X*** 649,654 X break; X `7D X `7D X return(flag); X `7D X `20 X--- 650,658 ----- X string`5Bi`5D= '_'; X flag++; /* Record if any changes were made */ X `7D X+ else X+ string`5Bi`5D = toupper(c); /* Map to uppercase */ X+ `7D X return(flag); X `7D X `20 X************** X*** 769,775 X * move nbytes of data from "fdin" to "fdout"; X * Always pad the output to a full DSIZE X * If it a VMS text file, it may be various formats, so we will X! * write into a temporary file first, then copy to the output X * so that we get the correct byte count. X * We set the bytecount=0 if this is funny file. X */ X--- 773,779 ----- X * move nbytes of data from "fdin" to "fdout"; X * Always pad the output to a full DSIZE X * If it a VMS text file, it may be various formats, so we will X! * read the file twice in case of a text file X * so that we get the correct byte count. X * We set the bytecount=0 if this is funny file. X */ X************** X*** 837,842 X `7D X `7D X flushout(fdout); X return(0); X `7D X /* Other formats e.g. .OBJ are not done */ X--- 841,847 ----- X `7D X `7D X flushout(fdout); X+ fclose(filein); X return(0); X `7D X /* Other formats e.g. .OBJ are not done */ $ CALL UNPACK V11V12.DIFF;3 673865846 $ v=f$verify(v) $ EXIT