home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 3 / 3613 < prev    next >
Encoding:
Internet Message Format  |  1991-07-11  |  30.4 KB

  1. From: dhesi@bsu-cs.bsu.edu (Rahul Dhesi)
  2. Newsgroups: alt.sources
  3. Subject: zoo 2.1 source part 09/15
  4. Message-ID: <12776@bsu-cs.bsu.edu>
  5. Date: 10 Jul 91 10:34:45 GMT
  6.  
  7. Checksum:  251396339 (verify with "brik -cv")
  8. Submitted-by: dhesi@bsu-cs.bsu.edu
  9. Archive-name: zoo210/part09
  10.  
  11. ---- Cut Here and feed the following to sh ----
  12. #!/bin/sh
  13. # This is part 09 of zoo210
  14. # ============= vmsbugs.doc ==============
  15. if test -f 'vmsbugs.doc' -a X"$1" != X"-c"; then
  16.     echo 'x - skipping vmsbugs.doc (File already exists)'
  17. else
  18. echo 'x - extracting vmsbugs.doc (Text)'
  19. sed 's/^X//' << 'SHAR_EOF' > 'vmsbugs.doc' &&
  20. X
  21. X
  22. X                           Zoo 2.0 on VAX/VMS
  23. X                                   by
  24. X                              Rahul Dhesi
  25. X
  26. X
  27. The zoo archiver is used to create and maintain archives containing mul-
  28. tiple files that may be stored in compressed format.  Consult the zoo
  29. manual for more details.  This document describes those features of
  30. VAX/VMS zoo that are specific to the VAX/VMS implementation.
  31. X
  32. X
  33. X                              INSTALLATION
  34. X
  35. The file "descrip.mms" is a makefile suitable for use with DEC's imple-
  36. mentation of make, called MMS.  To avoid any confusion, delete the file
  37. called "makefile" as that is not for VAX/VMS systems and it might con-
  38. fuse MMS.  With all source files in the current directory, simply type
  39. MMS and wait while all files get compiled and linked.  Then give the
  40. command "mms fiz" to build "fiz.exe", and "mms blif" to build "bilf.exe".
  41. X
  42. If your system does not have MMS, execute the "vmsbuild.com" script.
  43. X
  44. The result should be the executable program, "zoo.exe", "fiz.exe",
  45. and "bilf.exe".
  46. X
  47. Optionally, the command "mms zoobig.exe" will create a version of the
  48. executable that is linked without the shareable library.  This may be
  49. more portable if you intend to transfer it to an VMS system that does
  50. not have its own C compiler.  But "zoobig.exe" will be about twice the
  51. size of "zoo.exe".
  52. X
  53. To run zoo, bilf, and fiz, you will need to set up symbols by giving
  54. commands similar to the following, either by typing them at the system
  55. prompt or by putting them in your "login.com" file.
  56. X
  57. X     $ zoo  :== $ user$disk:[userdir]zoo.exe
  58. X     $ fiz  :== $ user$disk:[userfir]fiz.exe
  59. X     $ bilf :== $ user$disk:[userdir]bilf.exe
  60. X
  61. In place of "user$disk" use the name of the device on which
  62. your login directory is located, and instead of "userdir" use
  63. the name of the directory in which you have placed the executable
  64. programs "zoo.exe" and "fiz.exe".
  65. X
  66. X
  67. X                          WARNING -- VMS BUGS
  68. X
  69. VAX/VMS peculiarities cause unusual bahavior.
  70. X
  71. X   - VMS C does not preserve uppercase characters in a command line.  To
  72. X     specify a command containing an uppercase character, enclose the
  73. X     command in double quotes.  For example, the command
  74. X
  75. X          zoo aM stuff *
  76. X
  77. X     will not work under VMS.  To make this command work under VMS, use
  78. X     double quotes like this:
  79. X
  80. X          zoo "aM" stuff *
  81. X
  82. X   - For most text files that are not in stream-LF format, VMS returns
  83. X     an incorrect file size to zoo.  This will be evident if you use the
  84. X     "f" modifier to tell zoo to archive files without compression.
  85. X     Files that were in stream-LF format will be stored with the correct
  86. X     size;  other text files will be stored with an incorrect value for
  87. X     the original size of the file.
  88. X
  89. X     When such files are extracted, however, they are extracted in
  90. X     stream-LF format, which is the only file format that VMS seems to
  91. X     handle correctly.  Thus, so far as I can determine, no file con-
  92. X     tents are actually lost, and the only evidence of the problem is
  93. X     that in archive listings, files stored without compression may
  94. X     still appear to be compressed by about 1 to 5 percent, or occasion-
  95. X     ally by some meaningless value.
  96. X
  97. X   - VAX/VMS uses many different types of file structures.  Zoo creates
  98. X     archives in stream-LF format, and all archives used by zoo in any
  99. X     way must be in this format.  It is dangerous to use zoo on an
  100. X     archive that is in any other format, because it may permanently
  101. X     corrupt the archive contents.  Thus, if you have uploaded an
  102. X     archive to a VMS system using Kermit, do not try to manipulate it
  103. X     with zoo until you have converted it to stream-LF format.  File
  104. X     conversion instructions are given later in this document.
  105. X
  106. X   - The VAX/VMS batch system causes the C statement
  107. X
  108. X          fflush(stdout);
  109. X
  110. X     to become equivalent to:
  111. X
  112. X          printf("\n");
  113. X
  114. X     The result is that if files are added to a zoo archive from a batch
  115. X     run, the batch log will look very strange and contain spurious new-
  116. X     lines.
  117. X
  118. X
  119. X                        ARCHIVING SELECTED FILES
  120. X
  121. Zoo can read filenames from standard input.  This allows you to use an
  122. external program to generate a list of files to be archived.  When this
  123. list is fed to zoo, it will archive only the selected files.
  124. X
  125. For this example, assume that files are to be archived in an archive
  126. called "backups.zoo".
  127. X
  128. To achieve redirection of input under VAX/VMS, the following steps are
  129. necessary:
  130. X
  131. X 1.  Create a file containing the filenames to be archived.  Suppose
  132. X     this file is called "names.lis".
  133. X
  134. X 2.  Redirect zoo's standard input thus:
  135. X
  136. X          $ define /user_mode SYS$INPUT names.lis
  137. X
  138. X
  139. X 3.  Invoke zoo thus:
  140. X
  141. X          $ zoo "aI" backups
  142. X
  143. X     This command line will cause zoo to read a list of filenames from
  144. X     its standard input, and archive them into "backups.zoo".  Since the
  145. X     logical name SYS$INPUT was changed to refer to the file
  146. X     "names.lis", zoo will read filenames from that file.
  147. X
  148. A good way of creating a list of files to be archived is to use the vms
  149. "directory" command.  Include at least the switches shown:
  150. X
  151. X     $ directory /noheading /notrailing /column=1 /output=names.lis
  152. X
  153. This tells VMS to produce a list of filenames, one per line, and to
  154. store the resulting output in the file "names.lis".  You can also add
  155. additional selection options.  For example, to select all files that
  156. have been modified in the last 12 hours:
  157. X
  158. X     $ dir/nohead/notrail/col=1/out=names.lis/since=-12:00/modified
  159. X
  160. A good way to decrease the effort is to create a symbol as follows:
  161. X
  162. X     $ select:=="dir/nohead/notrail/col=1/out=names.lis/modified/since="
  163. X
  164. Now you can archive all *.c files modified in the last 60 minutes by
  165. giving the following commands:
  166. X
  167. X     $ select -1:00:00 *.c
  168. X     $ define/user sys$input names.lis
  169. X     $ zoo "aI" backups
  170. X
  171. X
  172. X                       FILE TRANSFERS WITH KERMIT
  173. X
  174. Zoo archives can be uploaded to a VAX/VMS system and downloaded from it
  175. using Kermit.  Due to VMS limitations, some file conversions must be
  176. done to avoid a corrupted zoo archive.
  177. X
  178. Zoo always expects zoo archives to be in stream-LF format.  However, the
  179. standard VAX/VMS Kermit does not create stream-LF files, and treats them
  180. as text files when it reads them, resulting in corrupted downloads.
  181. Thus you must handle Kermit transfers with care. The following discus-
  182. sions refers solely to the standard Kermit-32, which I believe is from
  183. the Stevens Institute of Technology.  If the following instructions are
  184. carefully followed, you should be able to transfer zoo archives between
  185. a VAX/VMS system and a microcomputer running Kermit.
  186. X
  187. KERMIT UPLOADS:  To transfer a zoo archive from a microcomputer to a
  188. VAX/VMS system, do the following.
  189. X
  190. X 1.  Invoke VAX/VMS Kermit as shown below.  It will prompt you with the
  191. X     string "Kermit-32>".  Give it a command as shown to tell it to
  192. X     receive a binary file:
  193. X
  194. X          $ kermit
  195. X          Kermit-32> set file type binary
  196. X          Kermit-32> set block-check 3
  197. X          Kermit-32> receive
  198. X
  199. X     Note:  Do not use the command "set file type fixed".  In most cases
  200. X     it will not work.
  201. X
  202. X     The command to set the block-check is optional, but tells Kermit to
  203. X     use a 16-bit CRC, which is much more reliable than the default 6-
  204. X     bit CRC.  Use this command if your version of Kermit does not use a
  205. X     16-bit CRC by default.
  206. X
  207. X 2.  At this point, VAX/VMS Kermit is waiting for you to send it a file.
  208. X     Now tell your local Kermit to send the file.  On an MS-DOS system,
  209. X     using MS-Kermit, you would do this by first typing the local escape
  210. X     sequence to get to the local mode, where the prompt is "MS-
  211. X     Kermit>", then telling your local Kermit to send the zoo archive as
  212. X     a binary file.  A typical sequence of commands is:
  213. X
  214. X          (type escape sequence to get back to local mode)
  215. X          MS-Kermit> set eof noctrl-z
  216. X          MS-Kermit> send stuff.zoo
  217. X
  218. X     It is important that your local Kermit send the zoo archive as a
  219. X     binary file, not a text file.  How you do this depends on your sys-
  220. X     tem;  on MS-DOS systems it suffices to give say "set eof noctrl-z".
  221. X
  222. X 3.  Wait until the Kermit upload is complete.  Then tell your local
  223. X     Kermit to go into terminal mode (usually by giving the command CON-
  224. X     NECT), and exit from VAX/VMS Kermit with the command EXIT.  A typi-
  225. X     cal sequence is:
  226. X
  227. X          MS-Kermit> connect
  228. X          (stuff from MS-Kermit printed...)
  229. X          (hit carriage return if necessary to get the next prompt)
  230. X          Kermit-32> exit
  231. X          $
  232. X
  233. X     Now you are back at the VAX/VMS prompt.  At this point, you must
  234. X     convert the uploaded zoo archive, which is currently in binary for-
  235. X     mat, to stream-LF format so that it can be used by VAX/VMS zoo.
  236. X     You do this by using the Bilf utility, which can convert files
  237. X     between binary and stream-LF formats.  Give the command:
  238. X
  239. X          $ bilf l stuff.zoo
  240. X
  241. X 4.  After Bilf has done the conversion, you will have a new generation
  242. X     of stuff.zoo that is in stream-LF format.  Now you can manipulate
  243. X     it normally with VAX/VMS zoo.
  244. X
  245. DON'T TRY TO USE ZOO TO MANIPULATE AN UPLOADED ARCHIVE WITHOUT PERFORM-
  246. ING THE CONVERSION TO STREAM-LF FORMAT, ELSE YOU MAY PERMANENTLY DESTROY
  247. ARCHIVE CONTENTS.
  248. X
  249. KERMIT DOWNLOADS:  Before downloading a zoo archive from VAX/VMS to a
  250. microcomputer, you must convert it to binary format.    Then use VMS
  251. Kermit normally.  A sample sequence is shown.
  252. X
  253. X 1.  Convert the zoo archive to binary format.
  254. X
  255. X          $ bilf b stuff.zoo
  256. X
  257. X 2.  Invoke VMS Kermit and tell it to send the file.
  258. X
  259. X          $ kermit
  260. X          Kermit-32> set block-check 3
  261. X          Kermit-32> send stuff.zoo
  262. X
  263. X 3.  Get back to your local Kermit and tell it to receive a binary file.
  264. X
  265. X          (type escape sequence to get into local mode)
  266. X          MS-Kermit> set eof noctrl-z
  267. X          MS-Kermit> receive
  268. X          (transfer takes place)
  269. X
  270. X
  271. X                         FILE TRANSFER SUMMARY
  272. X
  273. Here are pictorial summaries of the steps involved in performing file
  274. transfers of zoo archives using Kermit.
  275. X
  276. ======================================================================
  277. X
  278. DOWNLOADS:
  279. X                                           files on a VMS
  280. X                                         system to be archived
  281. X                                               using zoo
  282. X                                                    |
  283. X                                   archive created  |
  284. X                                   using zoo.exe    |
  285. X                                   or zoobig.exe    |
  286. X                                   on a VMS system  |
  287. X                                                    v
  288. X
  289. zoo archive on VMS      bilf b           zoo archive on VMS, in
  290. in fixed-length     <----------------    in stream-LF format
  291. binary format
  292. X      |
  293. X      |
  294. X      | archive transferred
  295. X      | from VMS to microcomputer
  296. X      | using Kermit; receiving
  297. X      | Kermit must be told this
  298. X      | is a binary file; sending
  299. X      | Kermit may need to be told too
  300. X      |
  301. X      v
  302. zoo archive
  303. on microcomputer
  304. system
  305. X
  306. ======================================================================
  307. X
  308. UPLOADS:
  309. X
  310. zoo archive
  311. on microcomputer
  312. system
  313. X    |
  314. X    |
  315. X    | archive uploaded to VMS using Kermit;
  316. X    | receiving Kermit on VMS must be given
  317. X    | command "set file type binary"
  318. X    | (NOTE:  "set file type fixed" will
  319. X    | usually not work);  sending Kermit
  320. X    | must be told this is a binary file
  321. X    |
  322. X    v
  323. zoo archive on VMS,       bilf l         zoo archive on VMS, in
  324. in variable-length    ---------------->    in stream-LF format
  325. binary format                                      |
  326. X                                                   | extract
  327. X                                                   | normally using
  328. X                                                   | zoo on VMS
  329. X                                                   |
  330. X                                                   v
  331. X                                         files extracted from zoo
  332. X                                          archive on a VMS system
  333. X
  334. ======================================================================
  335. X
  336. X
  337. X                       ENSURING ARCHIVE INTEGRITY
  338. X
  339. After performing a transfer of a zoo archive using Kermit (and perform-
  340. ing any file conversion necessary for VMS), make it a habit to immedi-
  341. ately test the integrity of the transferred archive with the -test com-
  342. mand of zoo, illustrated for VMS:
  343. X
  344. X     $ zoo -test stuff
  345. X
  346. In addition, also get a listing of the archive contents:
  347. X
  348. X     $ zoo -list stuff
  349. X
  350. If neither command reports an error, it is reasonable to assume that
  351. archive integrity was not harmed by the Kermit transfer.
  352. X
  353. The -test command tests the integrity of each stored file.  The -list
  354. command tests the integrity of the internal archive structure.  Both are
  355. checked using separate cyclic redundancy codes, one for each archived
  356. file, and one for each directory entry in the archived. (Actually, the
  357. -list command ignores deleted entries, so if the archive contains any,
  358. use the "ld" command instead.)
  359. X
  360. X
  361. X                               WILDCARDS
  362. X
  363. All implementations of zoo on all systems use the same wildcard charac-
  364. ters:  "*" matches any sequence of zero or more characters, and "?"
  365. matches any one character.
  366. X
  367. ADDING FILES:  For specifying directory names when adding files, use the
  368. usual VAX/VMS syntax.  Thus, to recursively archive all files in the
  369. current directory and all its subdirectories, the command syntax is:
  370. X
  371. X     $ zoo a stuff [...]*
  372. X
  373. X The character range wildcard of the form "c-c" is also available, which
  374. X will select all files beginning with the specified character range.
  375. X For example,
  376. X
  377. X      $ zoo a stuff [...]a-d [...]x-z
  378. X
  379. X will archive all files beginning with the characters a through d, and
  380. X with the characters x through z, in the current directory and all its
  381. X subdirectories.  A side-effect of this is that during addition to
  382. X archives, dots in filenames must be explicitly matched.  Thus to add
  383. X all files with an extension of DOC, you would type:
  384. X
  385. X      $ zoo a stuff *.doc
  386. X
  387. X and "*doc" will not work.  As a special case, a trailing "*.*" in any
  388. X filename you specify can always be replaced by just a trailing "*".
  389. X The safest rule to follow when adding files is to always specify the
  390. X dot in each filename.
  391. X
  392. X EXTRACTING FILES:  During extraction, both the directory name and the
  393. X filename must be specified according to zoo syntax.  Thus you could say
  394. X
  395. X      $ zoo x stuff [*xyz*]*.doc
  396. X
  397. X to extract all archived files with filenames that match "*.doc" and
  398. X that contain the string "xyz" in the directory name.  Note that VMS
  399. X syntax for selecting directories won't work here:
  400. X
  401. X      $ zoo x stuff [...]*.doc        ! won't work for extraction
  402. X
  403. X If you do not specify the directory name at all, zoo will only perform
  404. X the match against filenames;  thus
  405. X
  406. X      $ zoo x stuff *.doc
  407. X
  408. X will extract all files matching *.doc regardless of the directory name.
  409. X
  410. X Also note that if you specify extraction of "*.*", as in
  411. X
  412. X      $ zoo x stuff *.*
  413. X
  414. X it will result in the extraction of files whose filename contains at
  415. X least one dot.  Similarly, the command
  416. X
  417. X      $ zoo x stuff *_*
  418. X
  419. X will select all filename containing at least one underscore.
  420. X
  421. X To extract all files, specify no filename, e.g.
  422. X
  423. X      $ zoo x stuff
  424. X
  425. X or use "*" rather than "*.*".
  426. X
  427. X SAFEST RULE OF THUMB:  WHEN SELECTING FILES ON DISK, SPECIFY THE DOT IN
  428. X EACH FILENAME;  WHEN SELECTING FILES INSIDE A ZOO ARCHIVE, SPECIFY A
  429. X DOT ONLY IF YOU NEED ONE.  But to select all files, you can always just
  430. X use "*".
  431. X
  432. X
  433. X                            FILE GENERATIONS
  434. X
  435. X When a file is added to an archive, the generation number (if any) that
  436. X it is given in the archive is not related to the generation number it
  437. X had in the VAX/VMS filesystem.  At extraction time a new version is
  438. X always created for an extracted file.  The overwrite option ("O") does
  439. X not cause overwriting, but simply suppresses the warning message that
  440. X zoo normally gives when it finds that a file about to be extracted
  441. X already exists.
  442. X
  443. X
  444. X                             FILE STRUCTURES
  445. X
  446. X At extraction time, zoo preserves all data bytes in binary files, and
  447. X stores all text files as lines of text terminated with linefeeds. The
  448. X internal file structure maintained by DEC's RMS is not currently
  449. X preserved.  (Support for this is planned for the distant future.)
  450. X Thus, the following two types of files can be safely archived and
  451. X restored:
  452. X
  453. X    - All text files are extracted in stream-LF format.  Most VMS utili-
  454. X      ties that accept text files will accept such files.  The EDT edi-
  455. X      tor may complain, but will still work.
  456. X
  457. X    - VMS executable files, when stored and then extracted, are
  458. X      extracted in stream-LF format.  Such files can be restored to
  459. X      their original state using Bilf with the "b" option.  (However,
  460. X      current versions of VAX/VMS seem to be able to load and execute
  461. X      stream-LF files, so conversion may not be necessary.)
  462. X
  463. X HANDLING VMS EXECUTABLE FILES.  You can archive an executable program
  464. X called "xyz.exe":
  465. X
  466. X      $ zoo a stuff xyz.exe
  467. X      $ delete xyz.exe;*
  468. X
  469. X Now the only copy of xyz.exe is in the archive "stuff.zoo".  Extract
  470. X it:
  471. X
  472. X      $ zoo x stuff xyz.exe
  473. X
  474. X The extracted copy of "xyz.exe" is in stream-LF format and VMS may or
  475. X may not execute it.  Now we convert it back to fixed-length record for-
  476. X mat thus:
  477. X
  478. X      $ bilf b xyz.exe
  479. X      $ purge xyz.exe
  480. X
  481. X Now "xyz.exe" has been converted to binary format and can be executed.
  482. X It should be identical to the original copy of "xyz.exe" that was
  483. X archived.
  484. X
  485. X TEXT FILES FROM OTHER SYSTEMS.  A text file archived on a different
  486. X computer system will use either linefeeds, or carriage returns plus
  487. X linefeeds, as line terminators.  Text files with linfeeds only can be
  488. X be extracted and used exactly as if they had been archived on a VAX/VMS
  489. X system.  Text files containing carriage returns plus linefeeds will,
  490. X when extracted, contain a spurious carriage return at the end of each
  491. X line.  This extra carriage return can be removed using EDT's "substi-
  492. X tute" command while in screen mode.  Simply replace all carriage returns
  493. X with nothing.  The VMS C compiler currently appears to accept trailing
  494. X carriage returns in files without any trouble.
  495. X
  496. X Text files trasnferred from MS-DOS or CP/M or similar systems may con-
  497. X tain a trailing control Z character.  This may cause problems on VMS
  498. X and should be edited out with a text editor.
  499. X
  500. X                                     -- Rahul Dhesi 1988/02/04
  501. X                                            Revised 1991/07/07
  502. SHAR_EOF
  503. chmod 0644 vmsbugs.doc ||
  504. echo 'restore of vmsbugs.doc failed'
  505. Wc_c="`wc -c < 'vmsbugs.doc'`"
  506. test 18584 -eq "$Wc_c" ||
  507.     echo 'vmsbugs.doc: original size 18584, current size' "$Wc_c"
  508. fi
  509. # ============= vmsbuild.com ==============
  510. if test -f 'vmsbuild.com' -a X"$1" != X"-c"; then
  511.     echo 'x - skipping vmsbuild.com (File already exists)'
  512. else
  513. echo 'x - extracting vmsbuild.com (Text)'
  514. sed 's/^X//' << 'SHAR_EOF' > 'vmsbuild.com' &&
  515. $! VMSBUILD.COM for ZOO 2.10
  516. $!
  517. $! Adapted from similar script for zoo 2.01 that was contributed by
  518. $!    Steve Roseman
  519. $!    Lehigh University Computing Center
  520. $!    LUSGR@VAX1.CC.Lehigh.EDU
  521. $! 
  522. $ write sys$output "Compiling zoo..."
  523. $ write sys$output "$ cc addbfcrc.c"
  524. $ cc/nolist addbfcrc.c/define=(BIG_MEM,NDEBUG,VMS)
  525. $ write sys$output "$ cc addfname.c"
  526. $ cc/nolist addfname.c/define=(BIG_MEM,NDEBUG,VMS)
  527. $ write sys$output "$ cc basename.c"
  528. $ cc/nolist basename.c/define=(BIG_MEM,NDEBUG,VMS)
  529. $ write sys$output "$ cc comment.c"
  530. $ cc/nolist comment.c/define=(BIG_MEM,NDEBUG,VMS)
  531. $ write sys$output "$ cc crcdefs.c"
  532. $ cc/nolist crcdefs.c/define=(BIG_MEM,NDEBUG,VMS)
  533. $ write sys$output "$ cc decode.c"
  534. $ cc/nolist decode.c/define=(BIG_MEM,NDEBUG,VMS)
  535. $ write sys$output "$ cc encode.c"
  536. $ cc/nolist encode.c/define=(BIG_MEM,NDEBUG,VMS)
  537. $ write sys$output "$ cc getfile.c"
  538. $ cc/nolist getfile.c/define=(BIG_MEM,NDEBUG,VMS)
  539. $ write sys$output "$ cc huf.c"
  540. $ cc/nolist huf.c/define=(BIG_MEM,NDEBUG,VMS)
  541. $ write sys$output "$ cc io.c"
  542. $ cc/nolist io.c/define=(BIG_MEM,NDEBUG,VMS)
  543. $ write sys$output "$ cc lzc.c"
  544. $ cc/nolist lzc.c/define=(BIG_MEM,NDEBUG,VMS)
  545. $ write sys$output "$ cc lzd.c"
  546. $ cc/nolist lzd.c/define=(BIG_MEM,NDEBUG,VMS)
  547. $ write sys$output "$ cc lzh.c"
  548. $ cc/nolist lzh.c/define=(BIG_MEM,NDEBUG,VMS)
  549. $ write sys$output "$ cc machine.c"
  550. $ cc/nolist machine.c/define=(BIG_MEM,NDEBUG,VMS)
  551. $ write sys$output "$ cc makelist.c"
  552. $ cc/nolist makelist.c/define=(BIG_MEM,NDEBUG,VMS)
  553. $ write sys$output "$ cc maketbl.c"
  554. $ cc/nolist maketbl.c/define=(BIG_MEM,NDEBUG,VMS)
  555. $ write sys$output "$ cc maketree.c"
  556. $ cc/nolist maketree.c/define=(BIG_MEM,NDEBUG,VMS)
  557. $ write sys$output "$ cc misc.c"
  558. $ cc/nolist misc.c/define=(BIG_MEM,NDEBUG,VMS)
  559. $ write sys$output "$ cc misc2.c"
  560. $ cc/nolist misc2.c/define=(BIG_MEM,NDEBUG,VMS)
  561. $ write sys$output "$ cc needed.c"
  562. $ cc/nolist needed.c/define=(BIG_MEM,NDEBUG,VMS)
  563. $ write sys$output "$ cc nextfile.c"
  564. $ cc/nolist nextfile.c/define=(BIG_MEM,NDEBUG,VMS)
  565. $ write sys$output "$ cc options.c"
  566. $ cc/nolist options.c/define=(BIG_MEM,NDEBUG,VMS)
  567. $ write sys$output "$ cc parse.c"
  568. $ cc/nolist parse.c/define=(BIG_MEM,NDEBUG,VMS)
  569. $ write sys$output "$ cc portable.c"
  570. $ cc/nolist portable.c/define=(BIG_MEM,NDEBUG,VMS)
  571. $ write sys$output "$ cc prterror.c"
  572. $ cc/nolist prterror.c/define=(BIG_MEM,NDEBUG,VMS)
  573. $ write sys$output "$ cc version.c"
  574. $ cc/nolist version.c/define=(BIG_MEM,NDEBUG,VMS)
  575. $ write sys$output "$ cc vmstime.c"
  576. $ cc/nolist vmstime.c/define=(BIG_MEM,NDEBUG,VMS)
  577. $ write sys$output "$ cc zoo.c"
  578. $ cc/nolist zoo.c/define=(BIG_MEM,NDEBUG,VMS)
  579. $ write sys$output "$ cc zooadd.c"
  580. $ cc/nolist zooadd.c/define=(BIG_MEM,NDEBUG,VMS)
  581. $ write sys$output "$ cc zooadd2.c"
  582. $ cc/nolist zooadd2.c/define=(BIG_MEM,NDEBUG,VMS)
  583. $ write sys$output "$ cc zoodel.c"
  584. $ cc/nolist zoodel.c/define=(BIG_MEM,NDEBUG,VMS)
  585. $ write sys$output "$ cc zooext.c"
  586. $ cc/nolist zooext.c/define=(BIG_MEM,NDEBUG,VMS)
  587. $ write sys$output "$ cc zoolist.c"
  588. $ cc/nolist zoolist.c/define=(BIG_MEM,NDEBUG,VMS)
  589. $ write sys$output "$ cc zoopack.c"
  590. $ cc/nolist zoopack.c/define=(BIG_MEM,NDEBUG,VMS)
  591. $
  592. $
  593. $ write sys$output "Linking zoo..."
  594. $ link /executable=zoo.exe -
  595. X   addbfcrc.obj, addfname.obj, basename.obj, comment.obj,  -
  596. X   crcdefs.obj, decode.obj, encode.obj, getfile.obj, huf.obj,  -
  597. X   io.obj, lzc.obj, lzd.obj, lzh.obj, machine.obj, makelist.obj,  -
  598. X   maketbl.obj, maketree.obj, misc.obj, misc2.obj, needed.obj,  -
  599. X   nextfile.obj, options.obj, parse.obj, portable.obj, prterror.obj,  -
  600. X   version.obj, vmstime.obj, zoo.obj, zooadd.obj, zooadd2.obj,  -
  601. X   zoodel.obj, zooext.obj, zoolist.obj, zoopack.obj, -
  602. X    options/opt
  603. $
  604. $ write sys$output "Building fiz..."
  605. $ cc/nolist fiz.c
  606. $ link /executable=fiz.exe fiz.obj, addbfcrc.obj, portable.obj, -
  607. X    crcdefs.obj, options/opt
  608. $ write sys$output "Building bilf..."
  609. $ cc/nolist bilf.c
  610. $ link /executable=bilf.exe bilf.obj, options/opt
  611. $
  612. $! delete *.obj.*
  613. SHAR_EOF
  614. chmod 0644 vmsbuild.com ||
  615. echo 'restore of vmsbuild.com failed'
  616. Wc_c="`wc -c < 'vmsbuild.com'`"
  617. test 3909 -eq "$Wc_c" ||
  618.     echo 'vmsbuild.com: original size 3909, current size' "$Wc_c"
  619. fi
  620. # ============= vmstime.c ==============
  621. if test -f 'vmstime.c' -a X"$1" != X"-c"; then
  622.     echo 'x - skipping vmstime.c (File already exists)'
  623. else
  624. echo 'x - extracting vmstime.c (Text)'
  625. sed 's/^X//' << 'SHAR_EOF' > 'vmstime.c' &&
  626. /* vmstime.c */
  627. #ifndef LINT
  628. static char sccsid[]="$Source: /usr/home/dhesi/zoo/RCS/vmstime.c,v $\n\
  629. $Id: vmstime.c,v 1.6 91/07/06 12:20:26 dhesi Exp $";
  630. #endif
  631. /*
  632. This file was graciously supplied by Randal Barnes to support preservation
  633. of file timestamps under VAX/VMS.  I claim no copyright on the contents of
  634. this file.  I assume that neither do its authors.  However, if you adapt
  635. this code for your own use, I recommend preserving author attributions.
  636. X
  637. X                                -- Rahul Dhesi  1991/07/04
  638. */
  639. X
  640. /*
  641. *  This module sets a VAX/VMS file's creation and revision date/time to a
  642. *  specified date/time.
  643. *
  644. *  Inputs       Type            Description
  645. *  ------       ----            -----------
  646. *  path         char *          Name of file to be modified
  647. *  date         int             Binary formatted date to be applied to the file
  648. *  time         int             Binary formatted time to be applied to the file
  649. *
  650. *  Outputs      Type            Description
  651. *  -------      ----            -----------
  652. *  Modified file
  653. *
  654. *  Randy Magnuson - (612) 542-5052
  655. *  Randal Barnes  - (612) 542-5021
  656. *  Honeywell Inc. - Military Avionics Division
  657. *  April 12, 1990
  658. */
  659. X
  660. #include <stdio.h>
  661. #include <rms.h>
  662. #include <fibdef.h>
  663. #include <atrdef.h>
  664. #include <descrip.h>
  665. #include <iodef.h>
  666. #include <libdtdef.h>
  667. X
  668. int setutime (char *path, unsigned int date, unsigned int time)
  669. {
  670. X   char EName [NAM$C_MAXRSS],   /*  Expanded String Area                */
  671. X        RName [NAM$C_MAXRSS],   /*  Resultant String Area               */
  672. X        date_str [50];          /*  Holds intermediate ASCII date/time  */
  673. X
  674. X   short iosb [4];              /*  I/O status block for sys calls      */
  675. X
  676. X   int  status,                 /*  Condition code for sys calls, etc.  */
  677. X        i,                      /*  Temp index for looping thru arrays  */
  678. X        chan,                   /*  Channel to device containing file   */
  679. X        Cdate [2],              /*  VMS binary time - creation date     */
  680. X        Rdate [2],              /*  VMS binary time - revision date     */
  681. X        datetimecontext = 0,    /*  Context for time conv. lib calls    */
  682. X        intime = LIB$K_INPUT_FORMAT,  /*  Constant for time lib calls   */
  683. X        intdate [2];            /*  VMS binary time - temp              */
  684. X
  685. X   struct FAB Fab;              /*  RMS File Access Block               */
  686. X   struct NAM Nam;              /*  RMS Name Block                      */
  687. X   static struct fibdef Fib;    /*  RMS File Information Block          */
  688. X   struct atrdef Atr [] =       /*  File attribute struct               */
  689. X      {
  690. X         { sizeof (Cdate), ATR$C_CREDATE, &Cdate [0] }, /*  Creation date  */
  691. X         { sizeof (Rdate), ATR$C_REVDATE, &Rdate [0] }, /*  Revision date  */
  692. X         {              0,             0,         0 }
  693. X      };
  694. X   struct dsc$descriptor devnam =       /*  Device name descriptor      */
  695. X      { 0, DSC$K_DTYPE_T, DSC$K_CLASS_S, &Nam.nam$t_dvi [1] };
  696. X   struct dsc$descriptor FibDesc =      /*  File ID descriptor          */
  697. X      { sizeof (Fib), 0, 0, &Fib };
  698. X   struct dsc$descriptor_s FileName =   /*  File name descriptor        */
  699. X      { 0, DSC$K_DTYPE_T, DSC$K_CLASS_S, 0 };
  700. X
  701. X   /*  Time conversion format specification  */
  702. X   $DESCRIPTOR (datetimeformat, "|!Y4!MN0!D0|!H04!M0!S0!C2|");
  703. X
  704. X   /*  String descriptor for intermediate date/time string  */
  705. X   $DESCRIPTOR (date_desc, date_str);
  706. X
  707. X
  708. /*
  709. *  Fill out our File Access Block, Name Block, and Extended Attribute Block so
  710. *  we can parse the file name.
  711. */
  712. X   Fab = cc$rms_fab;
  713. X   Nam = cc$rms_nam;
  714. X
  715. X   Fab.fab$l_fna = path;
  716. X   Fab.fab$b_fns = strlen (path);
  717. X   Fab.fab$l_nam = &Nam;
  718. X
  719. X   Nam.nam$l_esa = &EName;
  720. X   Nam.nam$b_ess = sizeof (EName);
  721. X   Nam.nam$l_rsa = &RName;
  722. X   Nam.nam$b_rss = sizeof (RName);
  723. X
  724. X
  725. /*
  726. *  Do a parse and search to fill out the NAM block.
  727. */
  728. X   status = sys$parse(&Fab);
  729. X   if (!(status & 1))
  730. X      return 0;
  731. X   status = sys$search(&Fab);
  732. X   if (!(status & 1))
  733. X      return 0;
  734. X
  735. X
  736. /*
  737. *  Open a channel to the device that the file resides on.
  738. */
  739. X   devnam.dsc$w_length = Nam.nam$t_dvi [0];
  740. X   status = SYS$ASSIGN (&devnam, &chan, 0, 0);
  741. X   if (!(status & 1))
  742. X      return 0;
  743. X
  744. X
  745. /*
  746. *  Initialize the FIB
  747. */
  748. X   Fib.fib$r_acctl_overlay.fib$l_acctl = FIB$M_NORECORD;
  749. X   for (i = 0; i < 3; i++)
  750. X   {
  751. X      Fib.fib$r_fid_overlay.fib$w_fid [i] = Nam.nam$w_fid [i];
  752. X      Fib.fib$r_did_overlay.fib$w_did [i] = Nam.nam$w_did [i];
  753. X   }
  754. X
  755. X
  756. /*
  757. *  Set up the file name descriptor for the QIO
  758. */
  759. X   FileName.dsc$a_pointer = Nam.nam$l_name;
  760. X   FileName.dsc$w_length = Nam.nam$b_name + Nam.nam$b_type + Nam.nam$b_ver;
  761. X
  762. X
  763. /*
  764. *  Use the IO$_ACCESS function to return info about the file.
  765. */
  766. X   status = SYS$QIOW (0, chan, IO$_ACCESS, &iosb, 0, 0,
  767. X                      &FibDesc, &FileName, 0, 0, 0, 0);
  768. X   if (!(status & 1))
  769. X      return 0;
  770. X   status = iosb [0];
  771. X   if (!(status & 1))
  772. X      return 0;
  773. X
  774. X
  775. /*
  776. *  Set up a date/time format that we can easily convert to - "YYMMDD HHMMSS"
  777. */
  778. X   status = LIB$INIT_DATE_TIME_CONTEXT (&datetimecontext, &intime,
  779. X                                        &datetimeformat);
  780. X   if (!(status & 1))
  781. X      return 0;
  782. X
  783. X
  784. /*
  785. *  Convert the MS-DOS time ints to our ASCII format.
  786. */
  787. X   date_desc.dsc$w_length = sprintf (date_str, "%04d%02d%02d %02d%02d%02d00",
  788. X                                      ((date >> 9) & 0x7f) + 1980, /* year */
  789. X                                      (date >> 5) & 0x0f,          /* month */
  790. X                                      date & 0x1f,                 /* day */
  791. X                                      (time >> 11)& 0x1f,          /* hour */
  792. X                                      (time >> 5) & 0x3f,          /* min */
  793. X                                      (time & 0x1f) * 2);          /* sec */
  794. X
  795. X
  796. /*
  797. *  Convert our ASCII formatted date/time to VMS internal time format
  798. */
  799. X   status = LIB$CONVERT_DATE_STRING (&date_desc, &intdate, &datetimecontext);
  800. X   if (!(status & 1))
  801. X      return 0;
  802. X
  803. X
  804. /*
  805. *  Fill in the creation date and revision date fields in the Extended Attribute
  806. *  Block with the date and time from the zoo file.
  807. */
  808. X   Cdate [0] = Rdate [0] = intdate [0];
  809. X   Cdate [1] = Rdate [1] = intdate [1];
  810. X
  811. /*
  812. *  Modify the file
  813. */
  814. X   status = SYS$QIOW (0, chan, IO$_MODIFY, &iosb, 0, 0,
  815. X                      &FibDesc, &FileName, 0, 0, &Atr, 0);
  816. X   if (!(status & 1))
  817. X      return 0;
  818. X   status = iosb [0];
  819. X   if (!(status & 1))
  820. X      return 0;
  821. X
  822. X
  823. /*
  824. *  Okee dokee.
  825. */
  826. X   return 1;
  827. }
  828. SHAR_EOF
  829. chmod 0644 vmstime.c ||
  830. echo 'restore of vmstime.c failed'
  831. Wc_c="`wc -c < 'vmstime.c'`"
  832. test 6408 -eq "$Wc_c" ||
  833.     echo 'vmstime.c: original size 6408, current size' "$Wc_c"
  834. fi
  835. true || echo 'restore of zoo.1 failed'
  836. echo End of part 9, continue with part 10
  837. exit 0
  838.