$! ------------------ CUT HERE ----------------------- $ v='f$verify(f$trnlnm("SHARE_VERIFY"))' $! $! This archive created by VMS_SHARE Version 7.2-011 26-Jun-1992 $! On 3-AUG-1992 10:53:10.75 By user GOATHUNTER (@WKUVX1.BITNET) $! $! 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. DATAC.VAX;1 $! $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 $ x = P1 - f$parse(P1,,,"version") $ y = f$search(x) $ if y .eqs. "" then $ goto file_absent $ x = f$integer(f$parse(P1,,,"version")-";") $ y = f$integer(f$parse(y,,,"version")-";") $ if x .gt. y then $ goto file_absent $ if f$mode() .eqs. "INTERACTIVE" then $ goto file_interactive $ if x .eq. y then e "-W-EXISTS, File ''P1' exists. Skipped." $ if x .ne. y then e "-W-NEWERVERSION, of File ''P1' exists. Skipped." $file_delete: $ delete 'f'* $ exit $file_interactive: $ if x .eq. y then e "-W-EXISTS, File ''P1' exists." $ if x .ne. y then e "-W-NEWERVERSION, of File ''P1' exists." $ read/error=file_delete/end=file_delete- /prompt="Create new version [y/n]: " - sys$command x $ if .not. x then $ e "-W-SKIPPED, File ''P1' skipped." $ if .not. x then $ goto file_delete $ P1 = P1 - f$parse(P1,,,"version") $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' XWhat Yu want? XWhat Yu want? typ dt.c X#include X#include X Xstruct`09unaligned X`09`7B X`09short`09two_ words`5B2`5D; X`09char`09a_byte; X`09int`09x; X`09`7D; X X Xmain() X`7B X`09void`09junk_sub(struct unaligned); X`09static`09struct`09unaligned`09bad_data; X`09int`09i; X X`09printf("%d\n",&bad_data.x); X X`09for(i=0;i<100000000;i++)`09bad_data.x = 47; X`09printf("Data initialized\n"); X`09junk_sub(bad_data); X`7D XWhat Yu want? type js.c Xstruct`09unaligned X`09`7B X`09`09short`09two_words`5B2`5D; X`09`09char`09a_byte; X`09`09int`09x, X`09`7D; Xvoid`09junk_sub(struct unaligned zz_top) X`7B X`09int`09zz; X X`09zz = zz_top.x; X`7D XWhat Yu want? XWhat Yu want? cc js XWhat Yu want? cc dt XWhat Yu want? link dt,js,sys$1ibrary:vaxcrtl/lib XWhat Yu want? XWhat Yu want? XWhat Yu want? show status X Status on 13-MAY-1992 16:45:35.26`09Elapsed CPU :`090 00:00:15.07 X Buff. I/O :`09 452`09 Cur. ws. :`09512 Open files :`09 0 X Dir. I/O :`09 280`09 Phys. Mem. :`09245 Page Faults :`09 3773 XWhat Yu want? r dt X3961 XData initialized XWhat yu want? show status X Status on 13-MAY-1992 16:48:39.38`09Elapsed CPU :`090 00:02:57.99 X Buff. I/O :`09 464`09 Cur. ws. :`09512 Open files :`09 0 X Dir. I/O :`09 281`09 Phys. Mem. :`09235 Page Faults :`09 3915 XWhat yu want? X X`0C X XWhat Yu want? type dt2.c X#inclue X#include X Xstruct`09aligned X`09`7B X`09int`09x; X`09short`09two words`5B2`5D; X`09char`09a byte; X`09`7D; X X Xmain() X`7B X`09void`09junk sub(struct aligned); X`09static`09struct`09aligned good_data; X`09int`09i; X X`09printf("%d\n",&good_data.x); X X`09for(i=0;i<100000000;i++)`09good_data.x = 47; X`09printf("Data initialized\n"); X`09junk_sub(good_data); X`7D XWhat Yu want? typ js2.c Xstruct`09aligned X`09`7D X`09int`09x; X`09short`09two_words`5B2`5D; X`09char`09a_byte; X`09`7D; Xvoid`09junk_sub(struct aligned zz_top) X`7B X`09int`09zz; X X`09zz = zz top.x; X`7D XWhat Yu want? XWhat Yu want? cc dt2 XWhat Yu want? link js2 XWhat Yu want? link dt2,js2,sys$1ibrary:vaxcrtl/lib XWhat Yu want? XWhat Yu want? show status X Status on 13-MAY-1992 16:49:48.45`09Elapsed CPU :`090 00:00:13.54 X Buff. I/O :`09 369`09 Cur. ws. :`09512 Open files :`09 0 X Dir. I/O :`09 280`09 Phys. Mem. :`09261 Page Faults :`09 3136 XWhat Yu want? r dt2 X3956 XData initialized XWhat Yu want? show status X Status on 13-MAY-1992 16:51:45.20`09Elapsed CPU :`090 00:01:56.10 X Buff. I/O :`09 381`09 Cur. ws. :`09512 Open files :`09 0 X Dir. I/O :`09 281`09 Phys. Mem. :`09273 Page Faults :`09 3214 XWhat Yu want? X X`0C X XWhat Yu want? XWhat Yu want? type noise.c X#inlude X#include X Xstruct`09unaligned X`09`7B X`09short`09two_words`5B2`5D; X`09char`09a_byte; X`09int`09x; X`09`7D; X X Xmain() X`7B X`09void`09junk_sub(struct unaligned); X`09static`09struct`09unaligned`09bad_data; X`09int`09i; X X`09printf("%d\n",&bad data.x); X X`09for(i=0;i<100000000;i++) ; /* Loop and execute null statement. */ X`09printf("Data initialized\n"); X`09junk sub(bad data); X`7D XWhat Yu want? XWhat Yu want? cc noise XWhat Yu want? link noise,js,sys$1ibrary:vaxcrtl/lib XWhat Yu want? XWhat Yu want? show status X Status on 13-MAY-1992 17:42:50.54`09Elapsed CPU :`090 00:00:08.49 X Buff. I/O :`09 180`09 Cur. ws. :`09512 Open files :`09 0 X Dir. I/O :`09 218`09 Phys. Mem. :`09245 Page Faults :`09 1999 XWhat Yu want? run noise X3961 XData initialized XWhat Yu want? show status X Status on 13-MAY-1992 17:44:12.02`09Elapsed CPU :`090 00:01:22.72 X Buff. I/O :`09 192`09 Cur. ws. :`09512 Open files :`09 0 X Dir. I/O :`09 219`09 Phys. Mem. :`09282 Page Faults :`09 209 XWhat Yu want? $ CALL UNPACK DATAC.VAX;1 1780634254 $ v=f$verify(v) $ EXIT