🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Andy, Systems Manager Mon, 25 Jan 1993 21:33
VMS_SHARE V8.2, part 02/09
#145
Author: Andy, Systems Manager
Date: Mon, 25 Jan 1993 21:33
1082 lines
50155 bytes
Submitted-by: "Andy, Systems Manager" <UDAA055@ELM.CC.KCL.AC.UK>
Posting-number: Volume 4, Issue 46
Archive-name: vms_share/part02
Supersedes: vms_share: Volume 3, Issue 87-89

-+-+-+-+-+-+-+-+ START OF PART 2 -+-+-+-+-+-+-+-+
Vk
X$`20write/error=CPF_error2`20SHARE_PARAMS`20Max_TPU_Line_Length
X$`20IfDebug`20"-I-DBGPARAM,`20Max_TPU_Line_Length=`20",`20Max_TPU_Line_Length
X$`20write/error=CPF_error2`20SHARE_PARAMS`20Max_Share_Length
X$`20IfDebug`20"-I-DBGPARAM,`20Max_Share_Length`20`20`20=`20",`20Max_Share_Leng
Vth
X$`20write/error=CPF_error2`20SHARE_PARAMS`20Debugging
X$`20IfDebug`20"-I-DBGPARAM,`20Debugging`20`20`20`20`20`20`20`20`20`20=`20",
V`20Debugging
X$`20write/error=CPF_error2`20SHARE_PARAMS`20Logging
X$`20IfDebug`20"-I-DBGPARAM,`20Logging`20`20`20`20`20`20`20`20`20`20`20`20=`20"
V,`20Logging
X$`20write/error=CPF_error2`20SHARE_PARAMS`20Part_Size
X$`20IfDebug`20"-I-DBGPARAM,`20Part_Size`20`20`20`20`20`20`20`20`20`20=`20",
V`20Part_Size
X$`20write/error=CPF_error2`20SHARE_PARAMS`20Compression
X$`20IfDebug`20"-I-DBGPARAM,`20Compression`20`20`20`20`20`20`20`20=`20",`20Comp
Vression
X$`20write/error=CPF_error2`20SHARE_PARAMS`20DirKeep
X$`20IfDebug`20"-I-DBGPARAM,`20DirKeep`20`20`20`20`20`20`20`20`20`20`20`20=`20"
V,`20DirKeep
X$`20write/error=CPF_error2`20SHARE_PARAMS`20VersKeep
X$`20IfDebug`20"-I-DBGPARAM,`20VersKeep`20`20`20`20`20`20`20`20`20`20`20=`20",
V`20VersKeep
X$`20write/error=CPF_error2`20SHARE_PARAMS`20Real_Name
X$`20IfDebug`20"-I-DBGPARAM,`20Real_Name`20`20`20`20`20`20`20`20`20`20=`20",
V`20Real_Name
X$`20write/error=CPF_error2`20SHARE_PARAMS`20ShareFile
X$`20IfDebug`20"-I-DBGPARAM,`20ShareFile`20`20`20`20`20`20`20`20`20`20=`20",
V`20ShareFile
X$
X$`20FileCount`20=`200
X$`20gosub`20Scan_For_Files`09`09`09!`20Scan`20directory`20for`20matching`20fil
Ves
X$`20close`20SHARE_PARAMS
X$`20return
X$
X$
X$CPF_error1:
X$`20em`20"-E-CPFCRE,`20Unable`20to`20create`20parameter`20file"
X$`20goto`20abort
X$CPF_error2:
X$`20em`20"-E-CPFAPP,`20Unable`20to`20append`20parameters`20to`20parameter`20fi
Vle"
X$`20goto`20abort
X$!`0C
X$!`20-------------------------------------------------------------------------
V--
X$!`20SCAN`20FOR`20FILES
X$!
X$!`20`20`20Scan`20the`20file`20system`20for`20the`20files`20specified`20for
V`20the`20user;`20then`20add`20them
X$!`20`20`20if`20required`20into`20the`20parameter`20list`20of`20files`20to`20b
Ve`20packed.
X$!
X$!`20-------------------------------------------------------------------------
V--
X$Scan_For_Files:
X$Next_File_Spec:
X$`20if`20filespec`20.nes.`20""
X$`20`20`20then
X$`20`20`20`20`20pattern`20`20`20`20`20=`20f$element(0,",",filespec)
X$`20`20`20`20`20filespec`20`20`20`20=`20filespec`20-`20pattern`20-`20","
X$`20`20`20`20`20File_Device`20=`20f$parse(pattern,,,"DEVICE")
X$
X$`20`20`20!`20Make`20sure`20the`20syntax`20of`20the`20pattern`20is`20a`20legal
V`20filespec
X$`20`20`20`20`20if`20File_Device`20.eqs.`20""
X$`20`20`20`20`20`20`20then
X$`20`20`20`20`20`20`20`20`20em`20"-E-BADFILE,`20Bad`20file`20specification`20'
V",`20pattern,`20"'"
X$`20`20`20`20`20`20`20`20`20goto`20abort
X$`20`20`20`20`20endif
X$
X$`20`20`20!`20Action`20the`20filespec...
X$`20`20`20`20`20if`20DirKeep`20.and.`20File_Device`20.nes.`20Cur_Device
X$`20`20`20`20`20`20`20then
X$`20`20`20`20`20`20`20`20`20em`20"-E-NOTCURDEV,`20Skipped`20",`20pattern,`20"
V`20:`20does`20not`20refer`20to`20current`20device"
X$`20`20`20`20`20`20`20else
X$`20`20`20`20`20`20`20`20`20fileversion`20=`20f$parse(pattern,,,"VERSION")
X$`20`20`20`20`20`20`20`20`20searchstring=`20f$parse(pattern-fileversion,"`5B
V`5D")-";"`20+`20fileversion
X$`20`20`20`20`20`20`20`20`20Previous_File`20=`20""
X$`20`20`20`20`20`20`20`20`20gosub`20Next_File
X$`20`20`20`20`20endif
X$`20`20`20`20`20goto`20Next_File_Spec
X$`20endif
X$`20return
X$
X$
X$Next_File:
X$`20File`20=`20f$search(searchstring)
X$`20if`20File`20.eqs.`20""
X$`20`20`20then
X$`20`20`20`20`20em`20"-W-NOMATCH,`20No`20files`20matching`20",`20pattern
X$`20`20`20`20`20return
X$`20endif
X$
X$ProcessNextFile:
X$`20gosub`20Check_Out_File
X$`20Previous_File`20=`20File
X$`20File`20=`20f$search(searchstring)
X$`20if`20File`20.nes.`20""`20.and`20File`20.nes.`20Previous_File`20then`20$
V`20goto`20ProcessNextFile
X$`20return
X$!`0C
X$!`20-------------------------------------------------------------------------
V--
X$!`20CHECK`20OUT`20FILE
X$!
X$!`20`20`20Given`20the`20latest`20filename`20that`20matches`20the`20user's`20f
Vilespec,`20examine`20it
X$!`20`20`20to`20see`20if`20it's`20a`20candidate`20for`20selection.`20If`20it
V`20is,`20record`20its`20name,
X$!`20`20`20checksum`20and`20record`20attributes`20in`20the`20parameter`20file.
V
X$!
X$!`20`20`20Files`20are`20rejected`20if`20they
X$!`20`20`20`20`20`20-`20Are`20directories
X$!`09-`20Fall`20outside`20the`20range`20of`20dates`20specified`20by`20/BEFORE
V`20and`20/SINCE
X$!`09-`20Match`20one`20of`20the`20exclusion`20clauses`20(/EXCLUDE`20etc)
X$!`09-`20Are`20not`20in`20the`20directory`20tree`20starting`20at`20the`20curre
Vnt`20directory
X$!`09`20`20(unless`20the`20/NODIRECTORY`20option`20is`20given)
X$!`09-`20Resemble`20a`20sharefile`20part
X$!`09-`20Have`20an`20unsupported`20record`20type`20or`20size
X$!`09-`20If`20they`20are`20not`20confirmed`20by`20the`20user`20(/CONFIRM)
X$!
X$!`20-------------------------------------------------------------------------
V--
X$Check_Out_File:
X$!`20Get`20the`20elements`20of`20the`20filename`20that`20we`20need
X$`20File_Dir`20`20`20`20`20`20=`20f$parse(File,,,"DIRECTORY")
X$`20File_Name`20`20`20`20`20=`20f$parse(File,,,"NAME")
X$`20File_Type`20`20`20`20`20=`20f$parse(File,,,"TYPE")`20
X$`20File_Version`20`20=`20f$parse(File,,,"VERSION")
X$`20File_Filename`20=`20File_Name`20+`20File_Type
X$
X$`20SubFile`20`20`20`20`20`20`20=`20File
X$
X$
X$!`20------------------------------------------------------------------------
X$!`20Ignore`20directories`20always
X$!`20------------------------------------------------------------------------
X$`20if`20File_Type`20.eqs.`20".DIR"`20then`20$`20return
X$
X$
X$!`20------------------------------------------------------------------------
X$!`20Scan`20the`20exclusions`20list`20element`20by`20element`20to`20find`20any
V`20that`20match
X$!`20this`20one.`20An`20`60*'`20Wildcard`20may`20be`20used`20to`20represent
V`20a`20complete`20field`20of
X$!`20the`20file,`20such`20as`20the`20directory,`20filename,`20type,`20or`20ver
Vsion.`20It`20may`20not
X$!`20be`20used`20to`20represent`20a`20partial`20field`20of`20any`20of`20these.
V
X$!`20------------------------------------------------------------------------
X$`20if`20Exclude`20.nes.`20""
X$`20`20`20then
X$`20`20`20`20`20N=0
X$`20`20`20Exclude_Loop:
X$`20`20`20`20`20Epattern`20=`20f$element(N,",",Exclude)
X$`20`20`20`20`20if`20Epattern`20.nes.`20","
X$`20`20`20`20`20`20`20then
X$
X$`20`20`20`20`20`20`20`20`20p`20=`20f$parse(Epattern,"`5B*`5D",,"DIRECTORY")
X$`20`20`20`20`20`20`20`20`20xdir`20`20=`20p`20.eqs.`20"`5B*`5D"`20`20.or.`20p
V`20.eqs.`20File_Dir
X$`20`20`20`20`20`20`20`20`20p`20=`20f$parse(Epattern,"*",,"NAME")
X$`20`20`20`20`20`20`20`20`20xname`20=`20p`20.eqs.`20"*"`20`20`20`20.or.`20p
V`20.eqs.`20File_Name
X$`20`20`20`20`20`20`20`20`20p`20=`20f$parse(Epattern,".*",,"TYPE")
X$`20`20`20`20`20`20`20`20`20xtype`20=`20p`20.eqs.`20".*"`20`20`20.or.`20p`20.e
Vqs.`20File_Type
X$`20`20`20`20`20`20`20`20`20p`20=`20f$parse(Epattern,";*",,"VERSION")
X$`20`20`20`20`20`20`20`20`20xvers`20=`20p`20.eqs.`20";*"`20`20`20.or.`20p`20.e
Vqs.`20File_Version
X$`20`20`20`20`20`20`20`20`20if`20xdir`20.and.`20xname`20.and.`20xtype`20.and.
V`20xvers
X$`20`20`20`20`20`20`20`20`20`20`20then
X$`20`20`20`20`20`20`20`20`20`20`20`20`20if`20Debugging`20.ge.`20Debug_Rejected
V
X$`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20then
X$`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20em`20"-I-REJEXC,`20Skipped
V`20",`20File,`20"`20:`20matches`20/EXCLUDE=",`20Epattern
X$`20`20`20`20`20`20`20`20`20`20`20`20`20endif
X$`20`20`20`20`20`20`20`20`20`20`20`20`20return
X$`20`20`20`20`20`20`20`20`20endif
X$
X$`20`20`20`20`20`20`20`20`20N=N+1
X$`20`20`20`20`20`20`20`20`20goto`20Exclude_Loop
X$`20`20`20`20`20endif
X$`20endif
X$
X$
X$!`20------------------------------------------------------------------------
X$!`20Date`20based`20file`20selection;`20Before/Since`20dates`20already`20in
V`20COMPARISON`20format
X$!`20------------------------------------------------------------------------
X$`20Date`20=`20f$cvtime(f$file(File,Criteria),"COMPARISON")
X$`20if`20Before`20.nes.`20""`20.and.`20Date`20.ges.`20Before
X$`20`20`20then
X$`20`20`20`20`20if`20Debugging`20.ge.`20Debug_Rejected
X$`20`20`20`20`20`20`20then
X$`20`20`20`20`20`20`20`20`20em`20"-I-REJBEF,`20Skipped`20",`20File,`20"`20:
V`20",`20Criteria,`20"`20date`20not`20/BEFORE=",`20Before
X$`20`20`20`20`20endif
X$`20`20`20`20`20return
X$`20endif
X$`20if`20Since`20`20.nes.`20""`20.and.`20Date`20.lts.`20Since`20
X$`20`20then
X$`20`20`20`20`20if`20Debugging`20.ge.`20Debug_Rejected
X$`20`20`20`20`20`20`20then
X$`20`20`20`20`20`20`20`20`20em`20"-I-REJAFT,`20Skipped`20",`20File,`20"`20:
V`20",`20Criteria,`20"`20date`20not`20/AFTER=",`20After
X$`20`20`20`20`20endif
X$`20`20`20`20return
X$`20endif
X$
X$
X$!`20------------------------------------------------------------------------
X$!`20If`20the`20/DIRECTORY`20option`20has`20been`20specified,`20Ensure`20that
V`20the`20file`20exists
X$!`20at`20or`20below`20the`20current`20directory`20tree.`20This`20prevents`20r
Vandom`20top`20level
X$!`20directories`20being`20created`20when`20the`20share`20file`20is`20unpacked
V.`20The
X$!`20subdirectory`20structure`20is`20preserved.
X$!
X$!`20If`20current`20directory`20is`20the`20MFD`20(`5B000000`5D)`20then`20we
V`20should`20allow`20any
X$!`20underlying`20directory`20on`20the`20same`20device,`20otherwise`20we`20jus
Vt`20allow`20a`20sub
X$!`20directory`20of`20the`20current`20one.`20In`20either`20case,`20convert`20i
Vt`20to`20a`20subdirectory
X$!`20format
X$!`20------------------------------------------------------------------------
X$`20if`20DirKeep
X$`20`20`20then
X$
X$`20`20`20`20`20Subfile`20`20=`20SubFile`20-`20File_Device`09!`20Strip`20devic
Ve`20name
X$
X$`20`20`20`20!`20Massage`20directory`20name`20into`20a`20suitable`20subdirecto
Vry`20format
X$`20`20`20`20`20if`20Cur_Directory`20.eqs.`20"`5B000000`5D"
X$`20`20`20`20`20`20`20then
X$`20`20`20`20`20`20`20!`20Convert`20`5B000000.xxx`5D`20and`20`5Bxxx`5D`20into
V`20`5B.xxx`5D
X$`20`20`20`20`20`20`20`20`20if`20f$locate("`5B000000`5D",SubFile)`20.eq.`200
V`20then`20$`20SubFile`20=`20SubFile`20-`20"`5B000000`5D"
X$`20`20`20`20`20`20`20`20`20if`20f$locate("`5B000000.",SubFile)`20.eq.`200`20t
Vhen`20$`20SubFile`20=`20SubFile`20-`20"000000"
X$`20`20`20`20`20`20`20`20`20if`20f$locate("`5B.",SubFile)`20`20`20`20`20`20
V`20.ne.`200`20then`20$`20SubFile`20=`20"`5B."`20+`20(SubFile`20-`20"`5B")
X$`20`20`20`20`20`20`20else
X$`20`20`20`20`20`20`20!`20Strip`20off`20the`20leading`20current`20directory
V`20to`20leave`20a`20subdirectory
X$`20`20`20`20`20`20`20`20`20if`20f$locate(Cur_Directory-"`5D",SubFile)`20.ne.
V`200
X$`20`20`20`20`20`20`20`20`20`20`20then
X$`20`20`20`20`20`20`20`20`20`20`20`20`20em`20"-W-NOTINTREE,`20Skipped`20",`20S
VubFile,`20"`20:`20not`20a`20valid`20subdirectory"
X$`20`20`20`20`20`20`20`20`20`20`20`20`20return
X$`20`20`20`20`20`20`20`20`20endif
X$`20`20`20`20`20`20`20`20`20SubFile`20=`20"`5B"`20+`20(SubFile`20-`20(Cur_Dire
Vctory-"`5D"))
X$`20`20`20`20`20endif
X$`20`20`20`20`20SubFile`20=`20SubFile`20-`20"`5B`5D"`09!`20Don't`20need`20a
V`20null`20directory`20spec
X$`20endif
X$
X$
X$!`20------------------------------------------------------------------------
X$!`20Check`20that`20the`20filename`20does`20not`20resemble`20a`20share`20file
V`20part.`20This`20check
X$!`20is`20probably`20redundant`20now`20as`20the`20files`20to`20be`20packaged
V`20are`20determined
X$!`20before`20any`20share`20file`20parts`20are`20created.`20However,`20leave
V`20it`20here`20for`20the
X$!`20present.
X$!`20------------------------------------------------------------------------
X$`20if`20File_Dir`20.eqs.`20f$parse(ShareFile,,,"DIRECTORY")
X$`20`20`20then
X$`20`20`20`20`20if`20File_Name`20.eqs.`20f$parse(ShareFile,,,"NAME")
X$`20`20`20`20`20`20`20then
X$`20`20`20`20`20`20`20`20`20`20if`20f$locate("-OF-",File_Type)`20.ne.`20f$leng
Vth(File_Type)
X$`20`20`20`20`20`20`20`20`20`20`20`20then
X$`20`20`20`20`20`20`20`20`20`20`20`20`20`20x`20=`20File_Type`20-`20"."`20-`20"
V-OF-"
X$`20`20`20`20`20`20`20`20`20`20`20`20`20`20if`20f$type(x)`20.eqs.`20"INTEGER"
X$`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20then
X$`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20em`20"-W-SHRFILPART,
V`20Skipped`20",`20Subfile,`20"`20:`20Looks`20like`20sharefile`20part"
X$`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20return
X$`20`20`20`20`20`20`20`20`20`20`20`20`20`20endif
X$`20`20`20`20`20`20`20`20`20`20endif
X$`20`20`20`20`20endif
X$`20endif
X$
X$
X$!`20------------------------------------------------------------------------
X$!`20Get`20file's`20record`20attributes
X$!`20------------------------------------------------------------------------
X$`20Gosub`20Get_File_Record_Attributes
X$`20if`20(Attributes`20.eqs.`20"UNKNOWN")
X$`20`20`20then
X$`20`20`20`20`20`20em`20"-W-RFMNOTSUP,`20Skipped`20",`20Subfile,`20"`20:`20Uns
Vupported`20record`20format`20(RFM=''rfmmode',RAT=''ratmode')"
X$`20`20`20`20`20`20return
X$`20endif
X$
X$`20if`20(Recsiz`20.ge.`20Max_TPU_Line_Length)
X$`20`20`20then
X$`20`20`20`20`20`20em`20"-W-RECTOOBIG,`20Skipped`20",`20Subfile,`20"`20:`20Max
V`20Record`20size`20of`20''Recsiz'`20exceeds`20system`20limit`20of`20''Max_TPU_
VLine_Length'"
X$`20`20`20`20`20`20return
X$`20endif
X$
X$
X$
X$!`20------------------------------------------------------------------------
X$!`20Get`20file`20checksum;`20note`20that`20the`20CHECKSUM`20command`20is`20cu
Vrrently`20undocumented
X$!`20------------------------------------------------------------------------
X$`20define/user`20sys$output`20nl:
X$`20define/user`20sys$error`20`20nl:
X$`20checksum`20`26File
X$`20if`20.not.`20$status
X$`20`20`20then
X$`20`20`20`20`20em`20"-W-RECFMTERR,`20",`20Subfile,`20"`20:`20Record`20format
V`20cannot`20be`20processed"
X$`20`20`20`20`20return
X$`20endif
X$
X$
X$!`20------------------------------------------------------------------------
X$!`20If`20the`20user`20has`20requested`20it,`20confirm`20this`20selection`20in
Vteractively
X$!`20------------------------------------------------------------------------
X$`20if`20Confirm
X$`20`20`20then
X$`20`20`20`20`20read`20/end=NotConfirmed`20/prompt="Select`20''Subfile'`20?
V`20(Y/N)`20`5BN`5D`20"`20sys$command`20reply
X$`20`20`20`20`20if`20.not.`20reply`20then`20$`20return
X$`20endif
X$
X$
X$!`20------------------------------------------------------------------------
X$!`20Log`20this`20file`20as`20selected
X$!`20------------------------------------------------------------------------
X$`20if`20logging`20`20`20.ge.`20Log_Selected`20`20`20`20`20then`20$`20em`20"-I
V-SELECT,`20",`20SubFile
X$`20if`20debugging`20.ge.`20DEBUG_ShowParams`20then`20$`20em`20"-I-DBGPARAM,
V`20",`20SubFile,`20",`20Attributes='",`20Attributes,"'"
X$
X$
X$!`20------------------------------------------------------------------------
X$!`20All`20checks`20passed;`20add`20new`20entry`20to`20the`20parameter`20file
X$!`20------------------------------------------------------------------------
X$`20write`20SHARE_PARAMS`20SubFile,`20"`20",`20CheckSum$CheckSum,`20"`20",`20"
V""''Attributes'"""
X$`20FileCount`20=`20FileCount`20+`201
X$NotConfirmed:
X$`20return
X$
X$
X$!`0C
X$!`20-------------------------------------------------------------------------
V--
X$!`20GET`20FILE`20RECORD`20ATTRIBUTES
X$!
X$!`20`20`20The`20file`20record`20attributes`20are`20returned,`20in`20a`20form
V`20that`20can`20be`20passed
X$!`20`20`20directly`20to`20CONVERT/FDL,`20so`20that`20the`20record`20structure
V`20of`20the`20selected
X$!`20`20`20file`20can`20be`20re-instated`20later.
X$!
X$!`20`20`20TPU,`20used`20to`20encode`20files,`20always`20writes`20files`20out
V`20in`20a`20variable`20length
X$!`20`20`20format`20with`20carriage`20return`20controls.`20`20If`20this`20is
V`20the`20format`20of`20the
X$!`20`20`20original`20file`20no`20conversion`20is`20needed`20so`20we`20return
V`20null`20attributes
X$!
X$!`20`20`20A`20return`20type`20of`20"UNKNOWN"`20indicates`20a`20record`20type
V`20that`20we`20do`20not`20support.
X$!
X$!`20`20`20The`20record`20size`20of`20a`20file`20is`20also`20returned`20so`20t
Vhat`20it`20can`20be`20tested
X$!`20`20`20against`20the`20maximum`20record`20size`20supported`20by`20this`20T
VPU.`20We`20can`20therefore
X$!`20`20`20reject`20files`20with`20records`20that`20are`20too`20long`20early
V`20on`20in`20the`20packing
X$!`20`20`20process.
X$!
X$!`20-------------------------------------------------------------------------
V--
X$Get_File_Record_Attributes:
X$`20rfmmode`20=`20f$file_attributes(File,"RFM")`09!`20Get`20file`20information
V
X$`20recsiz`20`20=`20f$file_attributes(File,"MRS")
X$`20ratmode`20=`20f$file_attributes(File,"RAT")
X$`20fsz`20`20`20`20`20=`20f$file_attributes(File,"FSZ")
X$
X$!`20Convert`20the`20record`20format`20to`20an`20FDL`20spec
X$`20Format`20`20=`20""
X$`20if`20rfmmode`20.eqs.`20"STMLF"`20then`20$`20Format`20=`20"FORMAT`20STREAM_
VLF"
X$`20if`20rfmmode`20.eqs.`20"STMCR"`20then`20$`20Format`20=`20"FORMAT`20STREAM_
VCR"
X$`20if`20rfmmode`20.eqs.`20"STM"`20`20`20then`20$`20Format`20=`20"FORMAT`20STR
VEAM"
X$`20if`20rfmmode`20.eqs.`20"FIX"`20`20`20then`20$`20Format`20=`20"FORMAT`20FIX
V;SIZE`20''recsiz'"
X$`20if`20rfmmode`20.eqs.`20"VAR"`20`20`20then`20$`20Format`20=`20"FORMAT`20VAR
VIABLE"
X$`20if`20rfmmode`20.eqs.`20"VFC"`20`20`20then`20$`20Format`20=`20"FORMAT`20VFC
V;CONTROL_FIELD`20''fsz'"
X$
X$!`20Convert`20the`20record`20attributes`20to`20an`20FDL`20spec
X$`20Attributes`20=`20""
X$`20if`20ratmode`20.eqs.`20""`20`20`20`20then`20$`20Attributes`20=`20"CARRIAGE
V_CONTROL`20NONE"
X$`20if`20ratmode`20.eqs.`20"CR"`20`20then`20$`20Attributes`20=`20"CARRIAGE_CON
VTROL`20CARRIAGE_RETURN"
X$`20if`20ratmode`20.eqs.`20"PRN"`20then`20$`20Attributes`20=`20"CARRIAGE_CONTR
VOL`20PRINT"
X$`20if`20ratmode`20.eqs.`20"FTN"`20then`20$`20Attributes`20=`20"CARRIAGE_CONTR
VOL`20FORTRAN"
X$
X$!`20Check`20for`20unsupported`20formats;`20return`20an`20unknown`20FDL`20if
V`20found
X$`20if`20Format`20.eqs.`20""`20.or.`20Attributes`20.eqs.`20""
X$`20`20`20then
X$`20`20`20`20`20Attributes`20=`20"UNKNOWN"
X$`20`20`20`20`20return
X$`20endif
X$
X$!`20Return`20the`20complete`20FDL`20spec;`20special`20case`20the`20standard
V`20format
X$`20if`20rfmmode`20.eqs.`20"VAR"`20.and.`20ratmode`20.eqs.`20"CR"
X$`20`20`20then`20$`20Attributes`20=`20""
X$`20`20`20else`20$`20Attributes`20=`20Format`20+`20";"`20+`20Attributes
X$`20endif
X$`20return
X$
X$`20`20`20`20
X$!`0C
X$!`20-------------------------------------------------------------------------
V--
X$!`20RENAME`20PARTS
X$!
X$!`20`20`20This`20routine`20renames`20the`20parts`20generated`20by`20the`20pac
Vking`20routine`20so`20that
X$!`20`20`20the`20names`20have`20the`20format`20`20`20xxx.nnn-OF-mmm.`20We`20ne
Ved`20to`20know`20in`20advance
X$!`20`20`20how`20many`20parts`20are`20generated.
X$!
X$!`20-------------------------------------------------------------------------
V--
X$Rename_Parts:
X$!`20Get`20the`20number`20of`20parts`20written`20by`20the`20packing`20code
X$`20open/read/error=RP_Error1`20SHARE_PARAMS`20`26TempFile
X$`20read/end=RP_Error2`20SHARE_PARAMS`20NumParts
X$`20close`20SHARE_PARAMS
X$
X$!`20OK,`20make`20sure`20that`20we`20read`20a`20sensible`20number`20of`20parts
V`20(in`20case`20tpu`20failed)
X$`20if`20f$type(NumParts)`20.nes.`20"INTEGER"
X$`20`20`20then
X$`20`20`20`20`20em`20"-F-NUMPTSNOTINT,`20TPU`20has`20returned`20a`20non`20inte
Vger`20part`20count!"
X$`20`20`20`20`20goto`20abort
X$`20endif
X$`20if`20NumParts`20.le.`200
X$`20`20`20then
X$`20`20`20`20`20em`20"-F-NUMPTSNOTPOS,`20TPU`20has`20returned`20a`20negative/z
Vero`20part`20count!"
X$`20`20`20`20`20goto`20abort
X$`20endif
X$
X$`20NumParts`20=`20f$integer(NumParts)
X$`20L=f$length(f$string(NumParts))
X$
X$!`20Rename`20the`20parts
X$`20if`20Logging`20.ge.`20Log_RenameParts
X$`20`20`20then
X$`20`20`20`20`20em`20"-I-RENAME,`20Renaming`20parts`20to`20",`20f$fao(format1,
VShareFile,L,L,NumParts)
X$`20endif
X$
X$`20N`20=`200
X$RP_Loop:
X$`20N`20=`20N+1
X$`20if`20N`20.le.`20NumParts
X$`20`20`20then
X$`20`20`20`20`20NewPart`20=`20f$fao(format2,ShareFile,L,N,L,NumParts)
X$`20`20`20`20`20if`20f$search(ShareFile+"''N'")`20.eqs.`20""
X$`20`20`20`20`20`20`20then`20$`20em`20"-E-MISSPART,`20Unable`20to`20find`20",
V`20ShareFile,`20N
X$`20`20`20`20`20`20`20else`20$`20rename`20'ShareFile''N'`20'NewPart'
X$`20`20`20`20`20endif
X$`20`20`20`20`20goto`20RP_Loop
X$`20endif
X$`20return
X$
X$RP_Error1:
X$`20em`20"-F-RPOPEN,`20Unable`20to`20open`20return`20parameter`20file"
X$`20goto`20abort
X$RP_Error2:
X$`20em`20"-F-RPREAD,`20Unable`20to`20read`20part`20count`20from`20return`20par
Vameter`20file"
X$`20goto`20abort
X$
X$!`0C
X$!`20-------------------------------------------------------------------------
V--
X$!`20CREATE`20PACKAGE`20INDEX
X$!
X$!`20`20`20If`20selected,`20we`20create`20the`20package`20index`20file`20suita
Vble`20for`20using
X$!`20`20`20with`20a`20file`20server`20that`20recognizes`20package`20files.`20T
Vhe`20package`20file
X$!`20`20`20takes`20its`20name`20from`20the`20sharefile,`20with`20a`20suffix
V`20selected`20by`20the
X$!`20`20`20user`20(default`20=`20".$PACKAGE")
X$!
X$!`20-------------------------------------------------------------------------
V--
X$Create_Package_Index:
X$!`20Create`20the`20package`20index
X$`20if`20PackageIdx`20.nes.`20""
X$`20`20`20then
X$`20`20`20`20`20PackIndex`20=`20f$parse(PackageIdx+";",ShareFile)`20-`20";"
X$`20`20`20`20`20if`20Logging`20.ge.`20Log_PackageIndex
X$`20`20`20`20`20`20`20then
X$`20`20`20`20`20`20`20`20`20em`20"-I-CREPKGIDX,`20Creating`20package`20index
V`20",`20PackIndex
X$`20`20`20`20`20endif
X$
X$`20`20`20`20`20open/write/error=CPI_error1`20SHARE_PACKIDX`20`26PackIndex
X$`20`20`20`20`20N=0
X$RP_PKIND_LOOP:
X$`20`20`20`20`20N=N+1
X$`20`20`20`20`20if`20N`20.le.`20NumParts
X$`20`20`20`20`20`20`20then
X$`20`20`20`20`20`20`20`20`20NewPart`20=`20f$fao(format2,ShareFile,L,N,L,NumPar
Vts)
X$`20`20`20`20`20`20`20`20`20write/error=CPI_error2`20SHARE_PACKIDX`20f$parse(N
VewPart,,,"NAME"),f$parse(NewPart,,,"TYPE")
X$`20`20`20`20`20`20`20`20`20goto`20RP_PKIND_LOOP
X$`20`20`20`20`20endif
X$`20`20`20`20`20close`20SHARE_PACKIDX
X$`20endif
X$`20return
X$
X$
X$!`20ERRORS
X$CPI_Error1:
X$`20em`20"-F-RPPACKCRE,`20Unable`20to`20create`20package`20index`20file"
X$`20goto`20abort
X$CPI_Error2:
X$`20em`20"-F-RPPACKWRITE,`20Unable`20to`20write`20part`20name`20to`20package
V`20index`20file"
X$`20goto`20abort
X$
X$
X$!`0C
X$!`20-------------------------------------------------------------------------
V--
X$!`20PACK`20FILES
X$!
X$!`20`20`20This`20routine`20processes`20the`20parameter`20list`20in`20file`20"
VTempFile",`20packs`20the
X$!`20`20`20files`20specified`20and`20produces`20the`20multiple`20parts`20of
V`20the`20share`20file.
X$!
X$!`20-------------------------------------------------------------------------
V--
X$PackFiles:
X$`20edit/tpu/nodisplay/nosection/com=sys$input`20`26TempFile
X!`20--------------------------------------------------------------------------
V-
X!`20+`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20
V`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20
V`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20+
X!`20+`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20O`20V`20E`20R`20V`20I
V`20E`20W`20`20`20O`20F`20`20`20V`20M`20S`20_`20S`20H`20A`20R`20E`20`20`20`20
V`20`20`20`20`20`20`20`20`20`20`20+
X!`20+`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20
V`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20
V`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20+
X!`20+`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20
V`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20
V`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20+
X!`20+`20`20`20`20`20`20`20`20`20To`20package`20a`20series`20of`20files`20into
V`20a`20format`20that`20can`20be`20`20`20`20`20`20`20`20`20`20+
X!`20+`20`20`20`20`20`20`20`20`20successfully`20mailed`20through`20most`20netwo
Vrks`20without`20damage.`20`20`20`20`20`20`20+
X!`20+`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20
V`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20
V`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20+
X!`20+`20`20`20`20`20`20`20`20`20Characters`20prone`20to`20translation`20by`20m
Vailers/networks`20are`20`20`20`20`20`20`20`20`20+
X!`20+`20`20`20`20`20`20`20`20`20encoded`20into`20a`20form`20that`20will`20(hop
Vefully)`20not`20be`20altered`20`20`20`20`20`20`20`20+
X!`20+`20`20`20`20`20`20`20`20`20but`20we`20cannot`20recover`20if`20they`20ARE
V`20altered`20despite`20the`20`20`20`20`20`20`20`20`20`20`20+
X!`20+`20`20`20`20`20`20`20`20`20encoding.`20A`20checksum`20is`20included`20so
V`20we`20can`20at`20least`20detect`20`20`20`20`20`20+
X!`20+`20`20`20`20`20`20`20`20`20corruption.`20`20`20`20`20`20`20`20`20`20`20
V`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20
V`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20+
X!`20+`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20
V`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20
V`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20+
X!`20+`20`20`20`20`20`20`20`20`20Files`20are`20packaged`20into`20a`20single`20s
Velf-unpacking`20share`20file`20`20`20`20`20`20+
X!`20+`20`20`20`20`20`20`20`20`20which`20is`20split`20into`20multiple`20parts,
V`20each`20small`20enough`20to`20be`20`20`20`20`20+
X!`20+`20`20`20`20`20`20`20`20`20mailed`20out`20without`20truncation`20(the`20p
Vart`20size`20is`20configurable)`20`20`20+
X!`20+`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20
V`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20
V`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20+
X!`20+`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20
V`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20
V`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20+
X!`20+`20`20`20Version`208.2`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20And
Vy`20Harper`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20December`20199
V2`20+
X!`20+`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20
V`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20
V`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20+
X!`20+`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20
V`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20
V`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20+
X!`20+`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20
V`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20
V`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20+
X!`20+`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20R
V`20E`20S`20T`20R`20I`20C`20T`20I`20O`20N`20S`20`20`20`20`20`20`20`20`20`20`20
V`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20+
X!`20+`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20
V`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20
V`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20+
X!`20+`20`20`20`20`20`20`20`20`201.`20This`20version`20does`20not`20support`20t
Vhe`20UDF`20(undefined`20record)`20`20`20`20`20+
X!`20+`20`20`20`20`20`20`20`20`20`20`20`20format.`20All`20other`20record`20form
Vats`20are`20supported`20although`20only`20+
X!`20+`20`20`20`20`20`20`20`20`20`20`20`20the`20carriage`20control`20record`20a
Vttribute`20is`20preserved.`20`20`20`20`20`20`20`20`20`20+
X!`20+`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20
V`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20
V`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20+
X!`20+`20`20`20`20`20`20`20`20`202.`20Text`20files`20are`20fully`20supported.
V`20Binary`20files`20should`20be`20`20`20`20`20`20`20+
X!`20+`20`20`20`20`20`20`20`20`20`20`20`20supported`20because`20all`20non-print
Ving`20characters`20are`20encoded`20`20`20`20+
X!`20+`20`20`20`20`20`20`20`20`20`20`20`20to`20a`20printable`20escape`20sequenc
Ve.`20However,`20it`20is`20advisable`20to`20`20+
X!`20+`20`20`20`20`20`20`20`20`20`20`20`20stick`20to`20plain`20text`20files`20w
Vhere`20possible.`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20+
X!`20+`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20
V`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20
V`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20+
X!`20+`20`20`20`20`20`20`20`20`203.`20Because`20the`20files`20are`20intended
V`20to`20be`20mailed,`20the`20encoding`20`20`20`20+
X!`20+`20`20`20`20`20`20`20`20`20`20`20`20relies`20on`20the`20integrity`20of
V`20the`20underlying`20mailer`20and`20network.+
X!`20+`20`20`20`20`20`20`20`20`20`20`20`20If`20files`20are`20corrupted,`20we
V`20are`20unable`20to`20recover.`20`20`20`20`20`20`20`20`20`20`20`20+
X!`20+`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20
V`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20
V`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20+
X!`20+`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20
V`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20
V`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20+
X!`20+`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20
V`20`20`20`20C`20R`20E`20D`20I`20T`20S`20`20`20`20`20`20`20`20`20`20`20`20`20
V`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20+
X!`20+`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20
V`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20
V`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20+
X!`20+`20`20`20`20`20`20`20`20`20All`20due`20credit`20must`20go`20to`20the`20fo
Vllowing`20people:`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20+
X!`20+`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20
V`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20
V`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20+
X!`20+`20`20`20`20`20`20`20`20`201.`20`20`20James`20Gray`20for`20the`20first
V`20version`20of`20VMS_SHARE`20`20`20`20`20`20`20`20`20`20`20`20`20`20+
X!`20+`20`20`20`20`20`20`20`20`202.`20`20`20Michael`20Bednarek`20for`20the`20or
Viginal`20idea`20and`20prototype`20`20`20`20`20`20`20+
X!`20+`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20
V`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20
V`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20+
X!`20+`20`20`20`20`20`20`20`20`20Credits`20are`20also`20due`20to`20the`20variou
Vs`20people`20who`20have`20submitted`20`20`20+
X!`20+`20`20`20`20`20`20`20`20`20ideas`20and`20code`20fragments`20for`20some
V`20of`20the`20features`20of`20VMS_SHARE`20`20+
X!`20+`20`20`20`20`20`20`20`20`20including`20the`20following`20for`20major`20fe
Vatures:`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20+
X!`20+`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20
V`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20
V`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20+
X!`20+`20`20`20`20`20`20`20`20`20`20`20`20`20`20Mark`20Pizzolato,`20for`20run-l
Vength`20encoding`20and`20attributes`20`20`20`20`20+
X!`20+`20`20`20`20`20`20`20`20`20`20`20`20`20`20Dick`20Munroe,`20for`20better
V`20part`20name`20conventions`20`20`20`20`20`20`20`20`20`20`20`20`20`20+
X!`20+`20`20`20`20`20`20`20`20`20`20`20`20`20`20Joe`20Meadows,`20for`20various
V`20useful`20updates`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20
V`20+
X!`20+`20`20`20`20`20`20`20`20`20`20`20`20`20`20Wolfgang`20Moeller,`20for`20dir
Vectory/version`20stripping`20`20`20`20`20`20`20`20`20`20+
X!`20+`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20
V`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20
V`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20+
X!`20+-------------------------------------------------------------------------
V+
X`0C
X!`20+--------------------------------------------------------------------+
X!`20+`20Initialisation`20routine`20to`20set`20up`20global`20constant`20values
V`20`20`20`20`20`20`20`20`20`20`20`20+
X!`20+--------------------------------------------------------------------+
X
XPROCEDURE`20Initialize;
XLOCAL`20Ascii_Code;
X
X`20FAC_unpack`20`20`20`20`20`20`20`20`20`20:=`20"UNPACK";`09!`20Facility`20nam
Ve`20of`20unpack`20code
X
X!`20Various`20Logging`20levels`20-`20activate`20if`20'Logging'`20is`20at`20lea
Vst`20this`20high
X`20LOG_ShowStats`20`20`20`20`20`20`20:=`202;`09!`20Log`20statistics`20of`20buf
Vfer`20compression
X`20LOG_ShowFile`20`20`20`20`20`20`20`20:=`201;`09!`20Log`20filename`20being
V`20processed
X`20LOG_ShowParts`20`20`20`20`20`20`20:=`201;`09!`20Log`20number`20of`20parts
V`20written`20out
X
X!`20Various`20DEBUG`20levels`20-`20activate`20if`20`60Debugging'`20is`20at`20l
Veast`20this`20high
X`20DEBUG_PackTPU`20`20`20`20`20`20`20:=`204;`09!`20Shows`20TPU`20unpacking`20c
Vode`20being`20generated
X`20DEBUG_FindBreak`20`20`20`20`20:=`203;`09!`20Shows`20the`20search`20for`20a
V`20part`20breakpoint
X`20DEBUG_PartSplit`20`20`20`20`20:=`203;`09!`20Shows`20sizes`20of`20buffers
V`20prior`20to`20splitting
X`20DEBUG_AddToPrologue`20:=`202;`09!`20Shows`20files`20added`20to`20share`20fi
Vle`20prologue
X`20DEBUG_SIMess`20`20`20`20`20`20`20`20:=`201;`09!`20Show`20both`20Success`20a
Vnd`20Informational`20messages
X
X!`20Various`20COMPRESS`20techniques
X`20COMPRESS_LZW`20`20`20`20`20`20`20`20:=`202;`09!`20Lempel-Ziv-Welch`20Compre
Vssion
X`20COMPRESS_RunLength`20`20:=`201;`09!`20Run-length`20encoding
X`20COMPRESS_None`20`20`20`20`20`20`20:=`200;`09!`20No`20special`20compression
X
X!`20Define`20separator`20flags`20and`20associated`20variables,`20used`20to`20s
Veparate`20parts
X`20Part_Begin`20`20`20`20`20`20`20`20`20:=`20"-+-+-+-+-+-+-+-+";
X`20Part_End`20`20`20`20`20`20`20`20`20`20`20:=`20"+-+-+-+-+-+-+-+-";
X
X!`20Define`20separator`20lines`20for`20user`20data
X`20FAO_Start_Part`20`20`20`20`20:=`20Part_Begin`20+`20"`20START`20OF`20PART
V`20!UL`20"`20+`20Part_Begin;
X`20FAO_End_Part`20`20`20`20`20`20`20:=`20Part_End`20`20`20+`20"`20`20END`20
V`20OF`20PART`20!UL`20"`20+`20Part_End;
X
X!`20Define`20separator`20lines`20for`20DCL`20portions`20of`20the`20code
X`20FAO_start_label`20`20`20`20:=`20"$PART!UL:";
X`20FAO_end_goto`20`20`20`20`20`20`20:=`20"$`20GOTO`20PART!UL";`09!`20Format
V`20strings`20for`20DCL`20part`20separators
X
X!`20Constants
X`20MaxHexEnc`20`20`20`20`20`20`20`20`20`20:=`20255;`09!`20Max`20number`20encod
Veable`20in`202`20hex`20digits
X`20EOL`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20:=`203;`09!`20Record`20l
Vength`20overhead`20in`20file,`20per`20record
X`20Max_Parts`20`20`20`20`20`20`20`20`20`20:=`20999;
X`20FakeEOL_Flag`20`20`20`20`20`20`20:=`20"`7E";`09!`20Used`20during`20lzw`20se
Varches`20to`20cross`20lines
X`20Initial_Flag`20`20`20`20`20`20`20:=`20"X";
X`20Continuation_Flag`20`20:=`20"V";
X`20TPU_separators`20`20`20`20`20:=`20"`5B`5D(),=;>*";
X
X!`20Flags`20to`20mark`20encoded`20characters
X`20Run_Flag`20`20`20`20`20`20`20`20`20`20`20:=`20"`26";`09!`20Flag`20for`20run
V`20length`20encoding`20"`26nnhh"
X`20Quote_Flag`20`20`20`20`20`20`20`20`20:=`20"`60";`09!`20Flag`20for`20quoted
V`20chars`20`20`20`20`20`20`20`20"`60hh"
X`20LZW_Flag`20`20`20`20`20`20`20`20`20`20`20:=`20"`5C";`09!`20Flag`20of`20LZW
V`20coded`20substrings`20"`5Cbbll"
X
X!`20Set`20up`20the`20ascii`20code`20string`20and`20the`20quotable`20characters
V`20string
X`20Quote_Chars`20`20`20`20`20`20`20`20:=`20"";
X`20Ascii_Code`20`20`20`20`20`20`20`20`20:=`200;
X`20LOOP
X`20`20`20EXITIF`20Ascii_Code`20>`20255;
X`20`20`20`20`20IF`20(Ascii_Code`20<`2032)`20OR`20(Ascii_Code`20>=`20127)`20THE
VN
X`20`20`20`20`20`20`20Quote_Chars`20:=`20Quote_Chars`20+`20ASCII(Ascii_Code)
V`09!`20Ones`20to`20be`20escaped
X`20`20`20`20`20ENDIF;
X`20`20`20`20`20Ascii_Code`20:=`20Ascii_Code`20+`201;
X`20ENDLOOP;
X
X
X!`20Extra`20printable`20characters`20that`20get`20munged;`20treat`20them`20as
V`20non-printing
X`20Quote_Chars`20:=`20Quote_Chars`20+`20"`20`5B`5D`5E`7B`7C`7D`7E"`20+`20Quote
V_Flag`20+`20Run_Flag`20+`20LZW_Flag;
XENDPROCEDURE;
X`0C
X!`20+--------------------------------------------------------------------+
X!`20+`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20
V`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20
V`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20+
X!`20+`20`20`20`20`20`20`20`20`20`20G`20E`20N`20E`20R`20A`20L`20`20`20U`20T`20I
V`20L`20I`20T`20Y`20`20`20R`20O`20U`20T`20I`20N`20E`20S`20`20`20`20`20`20`20
V`20`20`20`20+
X!`20+`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20
V`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20
V`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20+
X!`20+`20`20`20This`20section`20provides`20a`20number`20of`20miscellaneous`20si
Vmple`20routines`20`20+
X!`20+`20`20`20to`20assist`20in`20the`20general`20packing`20code.`20`20`20`20
V`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20+
X!`20+`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20
V`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20
V`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20+
X!`20+`20`20`20Version`208.2`20`20`20`20`20`20`20`20`20`20`20Andy`20Harper`20
V`20`20`20`20`20`20`20`20`20`20`20`20December`201992`20`20`20`20`20`20+
X!`20+`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20
V`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20
V`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20+
X!`20+`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20
V`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20
V`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20+
X!`20+`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20
V`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20
V`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20+
X!`20+`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20R`20O`20U`20T`20I
V`20N`20E`20`20`20S`20U`20M`20M`20A`20R`20Y`20`20`20`20`20`20`20`20`20`20`20
V`20`20`20`20`20`20`20`20`20`20+
X!`20+`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20
V`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20
V`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20+
X!`20+`20`20`20Inform`20`20`20`20`20`20General`20messages`20and`20information
V`20a`20la`20VMS`20format`20`20`20`20`20+
X!`20+`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20
V`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20
V`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20+
X!`20+`20`20`20SizeBuffer`20`20Routine`20to`20return`20the`20size,`20in`20bytes
V,`20of`20a`20buffer`20`20`20`20+
X!`20+`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20allowing`20for`20the`20end
V`20of`20line`20mark;`20to`20approximate`20`20`20`20+
X!`20+`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20how`20much`20disk`20space
V`20it`20will`20occupy`20when`20written.`20`20`20`20`20+
X!`20+`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20
V`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20
V`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20+
X!`20+`20`20`20MoveInfo`20`20`20`20Routine`20to`20move`20data`20from`20one`20bu
Vffer`20to`20another`20`20`20`20`20`20+
X!`20+`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20
V`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20
V`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20+
X!`20+`20`20`20CopyLine`20`20`20`20Like`20COPY_TEXT`20but`20adds`20a`20new`20li
Vne`20after`20it`20`20`20`20`20`20`20`20`20`20+
X!`20+`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20
V`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20
V`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20+
X!`20+`20`20`20ReuseBuffer`20Empty`20a`20specified`20buffer`20and`20position
V`20to`20it`20`20`20`20`20`20`20`20`20`20+
X!`20+`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20
V`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20
V`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20+
X!`20+`20`20`20StripFile`20`20`20Parse`20the`20file`20name`20and`20remove`20unw
Vanted`20bits`20`20`20`20`20`20`20`20`20+
X!`20+`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20
V`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20
V`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20+
X!`20+`20`20`20FindString`20`20Locate`20substring`20within`20a`20string,`20righ
Vtmost`20occurence+
X!`20+`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20
V`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20
V`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20+
X!`20+`20`20`20RightMost`20`20`20Return`20rightmost`20`60n'`20characters`20of
V`20a`20string`20`20`20`20`20`20`20`20`20`20+
X!`20+`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20
V`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20
V`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20+
X!`20+--------------------------------------------------------------------+
X`0C
X!`20----------------------------------------------------------------------
X!`20Issue`20a`20message`20in`20standard`20VMS`20syntax
X!`20----------------------------------------------------------------------
X
XPROCEDURE`20Inform(Xsev,Xident,Xtext)
X`20`20MESSAGE(`20FAO("%!AS-!AS-!AS,`20!AS",`20Facility,`20Xsev,`20Xident,`20Xt
Vext)`20)
XENDPROCEDURE;
X
X
X
X!`20----------------------------------------------------------------------
X!`20Return`20the`20size,`20in`20bytes,`20of`20a`20buffer`20full`20of`20charact
Vers`20taking`20account
X!`20of`20the`20space`20occupied`20by`20the`20record`20header.`20`20This`20give
Vs`20an`20approximation
X!`20to`20the`20amount`20of`20disk`20space`20the`20buffer`20will`20occupy`20whe
Vn`20it`20is`20written`20out
X!`20to`20disk
X!`20----------------------------------------------------------------------
X
XPROCEDURE`20SizeBuffer(Xbuffer)
XLOCAL`20Size_Chars,`20Size_Lines;
X`20`20`20Size_Chars`20:=`20LENGTH(CREATE_RANGE(BEGINNING_OF(Xbuffer),END_OF(Xb
Vuffer),NONE));
X`20`20`20Size_Lines`20:=`20GET_INFO(Xbuffer,"RECORD_COUNT");
X`20`20`20RETURN(`20Size_Chars`20+`20EOL`20*`20Size_Lines`20);
XENDPROCEDURE;
X
X
X
X!`20----------------------------------------------------------------------
X!`20Move`20a`20buffer`20of`20information`20to`20the`20current`20point`20in`20a
Vnother`20buffer
X!`20----------------------------------------------------------------------
X
XPROCEDURE`20MoveInfo(FromBuf,`20ToBuf)
X`20`20`20POSITION(ToBuf);
X`20`20`20MOVE_TEXT(FromBuf);
XENDPROCEDURE;
X
X
X
X!`20----------------------------------------------------------------------
X!`20This`20routine`20works`20like`20COPY_TEXT`20but`20adds`20a`20new`20line
V`20at`20the`20end.`20Care
X!`20is`20taken`20when`20inserting`20the`20text`20not`20to`20exceed`20the`20max
Vimum`20record
X!`20length,`20by`20creating`20a`20blank`20line`20first`20and`20then`20copying
V`20the`20text
X!`20into`20it.
X!`20----------------------------------------------------------------------
X
XPROCEDURE`20CopyLine(NewText)
X`20`20`20SPLIT_LINE;
X`20`20`20MOVE_HORIZONTAL(-1);
X`20`20`20COPY_TEXT(NewText);
X`20`20`20MOVE_HORIZONTAL(1);
XENDPROCEDURE;
X
X
X
X!`20----------------------------------------------------------------------
X!`20This`20routine`20re-initializes`20a`20particular`20buffer`20for`20use`20by
V`20emptying
X!`20it`20and`20then`20positioning`20to`20it.
X!`20----------------------------------------------------------------------
X
XPROCEDURE`20ReuseBuffer(Xbuffer)
X`20`20`20ERASE(Xbuffer);
X`20`20`20POSITION(Xbuffer);
XENDPROCEDURE;
X
X
X`0C
X!`20----------------------------------------------------------------------
X!`20This`20routine`20implements`20the`20optional`20stripping`20of`20directory
V`20name`20and
X!`20version`20number`20from`20the`20name`20stored`20in`20the`20archive`20file.
V`20NOTE`20that
X!`20specifying`20the`20keyword`20DIRECTORY`20to`20FILE_PARSE`20has`20to`20be
V`20avoided`20as`20this
X!`20returns`20the`20FULL`20directory`20spec,`20not`20the`20relative`20spec`20t
Vhat`20we`20want.
X!`20----------------------------------------------------------------------
XPROCEDURE`20StripFile(File);
X
X`20`20CASE`202*DirKeep+Verskeep`20FROM`200`20TO`203
X`20`20`20`20`5B0`5D:`20File`20:=`20FILE_PARSE(File,"","",NAME,TYPE);`09`09!
V`20/NODIR/NOVER
X`20`20`20`20`5B1`5D:`20File`20:=`20FILE_PARSE(File,"","",NAME,TYPE,VERSION);
V`09!`20/NODIR/VER
X`20`20`20`20`5B2`5D:`20File`20:=`20File`20-`20FILE_PARSE(File,"","",VERSION);
V`09`09!`20/DIR/NOVER
X`20`20`20`20`5B3`5D:;`09`09`09`09`09`09`09!`20/DIR/VER
X`20`20`20`20`5BOUTRANGE`5D:`20Inform("F","BADDIRVER",`20FAO("DIR=!UL,VERS=!UL"
V,DirKeep,VersKeep));`20ABORT;
X`20`20ENDCASE;
X
X`20`20RETURN(File);
XENDPROCEDURE;
X`0C
X!`20--------------------------------------------------------------------------
V--
X!`20FINDSTRING
X!
X!`20`20`20`20Given`20a`20substring`20and`20a`20string,`20locate`20the`20positi
Von`20of`20the`20substring
X!`20`20`20`20within`20the`20string.`20`20This`20is`20like`20the`20built-in`20I
VNDEX`20except`20that`20the
X!`20`20`20`20rightmost`20occurrence`20is`20found`20rather`20than`20the`20leftm
Vost`20occurrence
X!
X!`20`20`20`20If`20the`20last`20parameter`20is`20non-zero,`20use`20it`20as`20th
Ve`20initial`20start`20position
X!`20`20`20`20to`20avoid`20rescanning`20strings`20we've`20already`20scanned`20o
Vnce.
X!
X!`20--------------------------------------------------------------------------
V--
X
XPROCEDURE`20FindString(substring,origstring,Start);
XLOCAL`20p,s;
X
X`20!`20Find`20starting`20point`20for`20search,`20and`20match`20length
X`20`20`20`20s`20:=`20LENGTH(substring);
X`20`20`20`20p`20:=`20LENGTH(origstring)-s+1;
X`20`20`20`20IF`20(Start`20<>`200)`20AND`20(Start`20<`20p)`20THEN`20p`20:=`20St
Vart;`20ENDIF;
X
X`20!`20Scan`20backwards`20to`20find`20latest`20match;`20return`20position
X`20`20`20`20LOOP
X`20`20`20`20`20`20`20EXITIF`20p<1;
X`20`20`20`20`20`20`20IF`20substring`20=`20SUBSTR(origstring,p,s)`20THEN`20RETU
VRN(p);`20ENDIF;
X`20`20`20`20`20`20`20p:=p-1;
X`20`20`20`20ENDLOOP;
X
X`20!`20No`20match
X`20`20`20`20RETURN(0);
X
XENDPROCEDURE;
X
X
X
X!`20--------------------------------------------------------------------------
V--
X!`20RIGHTMOST
X!
X!`20`20`20Returns`20the`20RIGHTMOST`20`60n'`20characters`20of`20a`20string.
X!
X!`20--------------------------------------------------------------------------
V--
X
XPROCEDURE`20RightMost(OrigString,n)
XLOCAL`20l;
X`20`20`20l`20:=`20LENGTH(OrigString);
X`20`20`20IF`20l`20>`20n
X`20`20`20`20`20THEN
X`20`20`20`20`20`20`20`20RETURN(`20SUBSTR(OrigString,l-n+1,n)`20);
X`20`20`20`20`20ELSE
X`20`20`20`20`20`20`20`20RETURN(OrigString);
X`20`20`20ENDIF;
XENDPROCEDURE
X
X
X`0C
X!`20+--------------------------------------------------------------------+
X!`20+`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20
V`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20
V`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20+
X!`20+`20`20`20`20`20`20`20`20`20`20`20P`20A`20R`20T`20`20`20S`20P`20L`20I`20T
V`20T`20I`20N`20G`20`20`20R`20O`20U`20T`20I`20N`20E`20S`20`20`20`20`20`20`20
V`20`20`20`20`20+
+-+-+-+-+-+-+-+-  END  OF PART 2 +-+-+-+-+-+-+-+-
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads