home *** CD-ROM | disk | FTP | other *** search
view JSON data
|
view as text
|
open on a Mac
|
open on a PC
This file was processed as: SHell self-extracting ARchive
(archive/shar).
You can browse this item here: 64
Confidence | Program | Detection | Match Type | Support
|
---|
100%
| dexvert
| Newsgroup Content (archive/news)
| magic
| Supported |
100%
| dexvert
| SHell self-extracting ARchive (archive/shar)
| magic
| Supported |
100%
| dexvert
| Internet Message Format (text/imf)
| magic
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| news or mail text
| default
| |
99%
| file
| C source text
| default
| |
98%
| file
| makefile script text
| default
| |
97%
| file
| C source, ASCII text
| default
| |
100%
| TrID
| E-Mail message (Var. 2)
| default
| |
100%
| perlTextCheck
| Likely Text (Perl)
| default
| |
100%
| siegfried
| fmt/329 Shell Archive Format
| default
| |
100%
| detectItEasy
| Format: plain text[LF]
| default (weak)
| |
100%
| xdgMime
| message/rfc822
| default
|
|
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 46 72 6f 6d 3a 20 64 64 | 6c 40 68 75 73 63 36 2e |From: dd|l@husc6.|
|00000010| 55 55 43 50 20 28 44 61 | 6e 20 4c 61 6e 63 69 61 |UUCP (Da|n Lancia|
|00000020| 6e 69 29 0a 4e 65 77 73 | 67 72 6f 75 70 73 3a 20 |ni).News|groups: |
|00000030| 63 6f 6d 70 2e 73 6f 75 | 72 63 65 73 2e 6d 69 73 |comp.sou|rces.mis|
|00000040| 63 0a 53 75 62 6a 65 63 | 74 3a 20 61 72 63 20 72 |c.Subjec|t: arc r|
|00000050| 65 70 6f 73 74 20 28 73 | 6f 72 74 20 6f 66 29 20 |epost (s|ort of) |
|00000060| 31 2f 34 0a 4d 65 73 73 | 61 67 65 2d 49 44 3a 20 |1/4.Mess|age-ID: |
|00000070| 3c 33 36 33 39 40 6e 63 | 6f 61 73 74 2e 55 55 43 |<3639@nc|oast.UUC|
|00000080| 50 3e 0a 44 61 74 65 3a | 20 32 36 20 4a 75 6c 20 |P>.Date:| 26 Jul |
|00000090| 38 37 20 32 33 3a 34 33 | 3a 30 32 20 47 4d 54 0a |87 23:43|:02 GMT.|
|000000a0| 53 65 6e 64 65 72 3a 20 | 61 6c 6c 62 65 72 79 40 |Sender: |allbery@|
|000000b0| 6e 63 6f 61 73 74 2e 55 | 55 43 50 0a 4f 72 67 61 |ncoast.U|UCP.Orga|
|000000c0| 6e 69 7a 61 74 69 6f 6e | 3a 20 48 61 72 76 61 72 |nization|: Harvar|
|000000d0| 64 20 55 6e 69 76 65 72 | 73 69 74 79 20 43 6f 6d |d Univer|sity Com|
|000000e0| 70 75 74 65 72 20 53 65 | 72 76 69 63 65 73 0a 4c |puter Se|rvices.L|
|000000f0| 69 6e 65 73 3a 20 31 34 | 39 38 0a 41 70 70 72 6f |ines: 14|98.Appro|
|00000100| 76 65 64 3a 20 61 6c 6c | 62 65 72 79 40 6e 63 6f |ved: all|bery@nco|
|00000110| 61 73 74 2e 55 55 43 50 | 0a 58 2d 41 72 63 68 69 |ast.UUCP|.X-Archi|
|00000120| 76 65 3a 20 63 6f 6d 70 | 2e 73 6f 75 72 63 65 73 |ve: comp|.sources|
|00000130| 2e 6d 69 73 63 2f 38 37 | 30 37 2f 36 34 0a 0a 5b |.misc/87|07/64..[|
|00000140| 48 65 72 65 20 69 74 20 | 69 73 20 61 67 61 69 6e |Here it |is again|
|00000150| 2c 20 69 6e 20 61 6c 6c | 20 69 74 73 20 67 28 6c |, in all| its g(l|
|00000160| 29 6f 72 79 21 20 20 3b | 2d 29 20 4d 61 79 62 65 |)ory! ;|-) Maybe|
|00000170| 20 74 68 69 73 20 6f 6e | 65 20 77 69 6c 6c 20 77 | this on|e will w|
|00000180| 6f 72 6b 2e 20 20 2b 2b | 62 73 61 5d 0a 0a 09 53 |ork. ++|bsa]...S|
|00000190| 69 6e 63 65 20 6d 79 20 | 66 69 72 73 74 20 70 6f |ince my |first po|
|000001a0| 73 74 69 6e 67 20 77 61 | 73 20 61 70 70 61 72 65 |sting wa|s appare|
|000001b0| 6e 74 6c 79 20 74 72 75 | 6e 63 61 74 65 64 20 69 |ntly tru|ncated i|
|000001c0| 6e 20 6d 61 6e 79 20 70 | 6c 61 63 65 73 2c 0a 68 |n many p|laces,.h|
|000001d0| 65 72 65 20 69 73 20 61 | 20 22 72 65 22 70 6f 73 |ere is a| "re"pos|
|000001e0| 74 20 63 75 74 20 69 6e | 74 6f 20 73 6d 61 6c 6c |t cut in|to small|
|000001f0| 65 72 20 70 69 65 63 65 | 73 2e 20 20 54 68 69 73 |er piece|s. This|
|00000200| 20 74 69 6d 65 2c 20 65 | 61 63 68 20 69 73 20 61 | time, e|ach is a|
|00000210| 20 73 65 70 61 72 61 74 | 65 0a 73 68 61 72 20 61 | separat|e.shar a|
|00000220| 72 63 68 69 76 65 20 66 | 6f 72 20 6d 6f 72 65 20 |rchive f|or more |
|00000230| 69 6e 74 75 69 74 69 76 | 65 20 75 6e 70 61 63 6b |intuitiv|e unpack|
|00000240| 69 6e 67 2e 20 20 4e 6f | 77 2c 20 74 68 69 73 20 |ing. No|w, this |
|00000250| 69 73 6e 27 74 20 72 65 | 61 6c 6c 79 20 61 0a 72 |isn't re|ally a.r|
|00000260| 65 70 6f 73 74 20 73 69 | 6e 63 65 20 74 68 65 72 |epost si|nce ther|
|00000270| 65 20 61 72 65 20 73 6f | 6d 65 20 63 68 61 6e 67 |e are so|me chang|
|00000280| 65 73 2e 20 20 56 61 72 | 69 6f 75 73 20 70 6f 70 |es. Var|ious pop|
|00000290| 75 6c 61 72 20 62 75 67 | 20 66 69 78 65 73 20 77 |ular bug| fixes w|
|000002a0| 65 72 65 0a 61 70 70 6c | 69 65 64 2c 20 74 68 65 |ere.appl|ied, the|
|000002b0| 20 6e 6f 6e 2d 72 65 70 | 65 61 74 20 75 6e 70 61 | non-rep|eat unpa|
|000002c0| 63 6b 69 6e 67 20 66 6f | 72 20 73 71 75 61 73 68 |cking fo|r squash|
|000002d0| 65 64 20 61 72 63 68 69 | 76 65 73 20 77 61 73 20 |ed archi|ves was |
|000002e0| 72 65 6d 6f 76 65 64 20 | 61 73 0a 69 74 20 77 61 |removed |as.it wa|
|000002f0| 73 20 69 6e 64 69 63 61 | 74 65 64 20 74 68 61 74 |s indica|ted that|
|00000300| 20 74 68 69 73 20 77 61 | 73 20 77 72 6f 6e 67 2c | this wa|s wrong,|
|00000310| 20 61 6e 64 20 61 20 27 | 71 27 20 66 6c 61 67 20 | and a '|q' flag |
|00000320| 74 6f 20 66 6f 72 63 65 | 20 73 71 75 61 73 68 69 |to force| squashi|
|00000330| 6e 67 0a 69 6e 73 74 65 | 61 64 20 6f 66 20 63 72 |ng.inste|ad of cr|
|00000340| 75 6e 63 68 69 6e 67 20 | 77 61 73 20 61 64 64 65 |unching |was adde|
|00000350| 64 2e 20 20 4e 6f 77 20 | 74 68 65 20 62 61 64 20 |d. Now |the bad |
|00000360| 6e 65 77 73 2e 20 20 53 | 71 75 61 73 68 69 6e 67 |news. S|quashing|
|00000370| 20 62 69 67 20 66 69 6c | 65 73 0a 6f 72 20 6d 6f | big fil|es.or mo|
|00000380| 72 65 20 74 68 61 6e 20 | 6f 6e 65 20 66 69 6c 65 |re than |one file|
|00000390| 20 70 65 72 20 27 61 27 | 20 6f 70 65 72 61 74 69 | per 'a'| operati|
|000003a0| 6f 6e 20 63 61 75 73 65 | 73 20 70 72 6f 62 6c 65 |on cause|s proble|
|000003b0| 6d 73 2e 20 20 53 6f 6d | 65 74 68 69 6e 67 20 69 |ms. Som|ething i|
|000003c0| 73 0a 70 72 6f 62 61 62 | 6c 79 20 62 65 69 6e 67 |s.probab|ly being|
|000003d0| 20 6f 76 65 72 77 72 69 | 74 74 65 6e 20 6f 6e 20 | overwri|tten on |
|000003e0| 74 68 65 20 73 74 61 63 | 6b 20 61 6e 64 20 49 20 |the stac|k and I |
|000003f0| 64 6f 6e 27 74 20 6b 6e | 6f 77 20 77 68 65 6e 20 |don't kn|ow when |
|00000400| 49 20 77 69 6c 6c 0a 62 | 65 20 61 62 6c 65 20 74 |I will.b|e able t|
|00000410| 6f 20 77 6f 72 6b 20 6f | 6e 20 69 74 20 6d 75 63 |o work o|n it muc|
|00000420| 68 20 6d 6f 72 65 2e 20 | 20 49 74 20 69 73 20 75 |h more. | It is u|
|00000430| 6e 64 6f 75 62 74 65 64 | 6c 79 20 61 20 73 74 75 |ndoubted|ly a stu|
|00000440| 70 69 64 20 65 72 72 6f | 72 20 6f 6e 0a 6d 79 20 |pid erro|r on.my |
|00000450| 70 61 72 74 20 61 6e 64 | 20 49 20 68 6f 70 65 20 |part and| I hope |
|00000460| 73 6f 6d 65 6f 6e 65 20 | 77 69 6c 6c 20 66 69 78 |someone |will fix|
|00000470| 20 69 74 2e 20 20 49 6e | 20 61 6e 79 20 63 61 73 | it. In| any cas|
|00000480| 65 2c 20 74 68 65 20 69 | 6d 70 6f 72 74 61 6e 74 |e, the i|mportant|
|00000490| 20 74 68 69 6e 67 0a 72 | 65 6d 61 69 6e 73 20 74 | thing.r|emains t|
|000004a0| 68 65 20 61 62 69 6c 69 | 74 79 20 74 6f 20 75 6e |he abili|ty to un|
|000004b0| 70 61 63 6b 20 73 71 75 | 61 73 68 65 64 20 61 72 |pack squ|ashed ar|
|000004c0| 63 68 69 76 65 73 2e 0a | 0a 09 09 09 09 09 44 61 |chives..|......Da|
|000004d0| 6e 20 4c 61 6e 63 69 61 | 6e 69 0a 09 09 09 09 09 |n Lancia|ni......|
|000004e0| 64 64 6c 40 68 61 72 76 | 61 72 64 2e 2a 0a 0a 23 |ddl@harv|ard.*..#|
|000004f0| 21 20 2f 62 69 6e 2f 73 | 68 0a 23 20 54 68 69 73 |! /bin/s|h.# This|
|00000500| 20 69 73 20 61 20 73 68 | 65 6c 6c 20 61 72 63 68 | is a sh|ell arch|
|00000510| 69 76 65 2c 20 6d 65 61 | 6e 69 6e 67 3a 0a 23 20 |ive, mea|ning:.# |
|00000520| 31 2e 20 52 65 6d 6f 76 | 65 20 65 76 65 72 79 74 |1. Remov|e everyt|
|00000530| 68 69 6e 67 20 61 62 6f | 76 65 20 74 68 65 20 23 |hing abo|ve the #|
|00000540| 21 20 2f 62 69 6e 2f 73 | 68 20 6c 69 6e 65 2e 0a |! /bin/s|h line..|
|00000550| 23 20 32 2e 20 53 61 76 | 65 20 74 68 65 20 72 65 |# 2. Sav|e the re|
|00000560| 73 75 6c 74 69 6e 67 20 | 74 65 78 74 20 69 6e 20 |sulting |text in |
|00000570| 61 20 66 69 6c 65 2e 0a | 23 20 33 2e 20 45 78 65 |a file..|# 3. Exe|
|00000580| 63 75 74 65 20 74 68 65 | 20 66 69 6c 65 20 77 69 |cute the| file wi|
|00000590| 74 68 20 2f 62 69 6e 2f | 73 68 20 28 6e 6f 74 20 |th /bin/|sh (not |
|000005a0| 63 73 68 29 20 74 6f 20 | 63 72 65 61 74 65 20 74 |csh) to |create t|
|000005b0| 68 65 20 66 69 6c 65 73 | 3a 0a 23 09 4d 61 6b 65 |he files|:.#.Make|
|000005c0| 66 69 6c 65 0a 23 09 61 | 72 63 2e 63 0a 23 09 61 |file.#.a|rc.c.#.a|
|000005d0| 72 63 2e 68 0a 23 09 61 | 72 63 61 64 64 2e 63 0a |rc.h.#.a|rcadd.c.|
|000005e0| 23 09 61 72 63 63 6f 64 | 65 2e 63 0a 23 09 61 72 |#.arccod|e.c.#.ar|
|000005f0| 63 63 76 74 2e 63 0a 23 | 09 61 72 63 64 65 6c 2e |ccvt.c.#|.arcdel.|
|00000600| 63 0a 23 09 61 72 63 64 | 69 72 2e 63 0a 23 20 54 |c.#.arcd|ir.c.# T|
|00000610| 68 69 73 20 61 72 63 68 | 69 76 65 20 63 72 65 61 |his arch|ive crea|
|00000620| 74 65 64 3a 20 54 68 75 | 20 4a 75 6c 20 32 33 20 |ted: Thu| Jul 23 |
|00000630| 32 33 3a 33 39 3a 34 38 | 20 31 39 38 37 0a 65 78 |23:39:48| 1987.ex|
|00000640| 70 6f 72 74 20 50 41 54 | 48 3b 20 50 41 54 48 3d |port PAT|H; PATH=|
|00000650| 2f 62 69 6e 3a 24 50 41 | 54 48 0a 69 66 20 74 65 |/bin:$PA|TH.if te|
|00000660| 73 74 20 2d 66 20 27 4d | 61 6b 65 66 69 6c 65 27 |st -f 'M|akefile'|
|00000670| 0a 74 68 65 6e 0a 09 65 | 63 68 6f 20 73 68 61 72 |.then..e|cho shar|
|00000680| 3a 20 77 69 6c 6c 20 6e | 6f 74 20 6f 76 65 72 2d |: will n|ot over-|
|00000690| 77 72 69 74 65 20 65 78 | 69 73 74 69 6e 67 20 66 |write ex|isting f|
|000006a0| 69 6c 65 20 22 27 4d 61 | 6b 65 66 69 6c 65 27 22 |ile "'Ma|kefile'"|
|000006b0| 0a 65 6c 73 65 0a 63 61 | 74 20 3c 3c 20 5c 53 48 |.else.ca|t << \SH|
|000006c0| 41 52 5f 45 4f 46 20 3e | 20 27 4d 61 6b 65 66 69 |AR_EOF >| 'Makefi|
|000006d0| 6c 65 27 0a 23 0a 23 09 | 4d 61 6b 65 66 69 6c 65 |le'.#.#.|Makefile|
|000006e0| 20 66 6f 72 20 48 61 63 | 6b 2d 61 74 74 61 63 6b | for Hac|k-attack|
|000006f0| 20 31 2e 33 0a 23 09 56 | 41 58 20 31 31 2f 37 38 | 1.3.#.V|AX 11/78|
|00000700| 30 20 42 53 44 34 2e 32 | 20 22 41 52 43 22 20 75 |0 BSD4.2| "ARC" u|
|00000710| 74 69 6c 69 74 79 0a 23 | 0a 43 46 4c 41 47 53 20 |tility.#|.CFLAGS |
|00000720| 3d 20 2d 4f 0a 0a 4f 42 | 4a 53 20 3d 20 61 72 63 |= -O..OB|JS = arc|
|00000730| 2e 6f 20 61 72 63 61 64 | 64 2e 6f 20 61 72 63 63 |.o arcad|d.o arcc|
|00000740| 6f 64 65 2e 6f 20 61 72 | 63 63 76 74 2e 6f 20 61 |ode.o ar|ccvt.o a|
|00000750| 72 63 64 65 6c 2e 6f 20 | 61 72 63 64 69 72 2e 6f |rcdel.o |arcdir.o|
|00000760| 20 5c 0a 61 72 63 64 6f | 73 2e 6f 20 61 72 63 65 | \.arcdo|s.o arce|
|00000770| 78 74 2e 6f 20 61 72 63 | 69 6f 2e 6f 20 61 72 63 |xt.o arc|io.o arc|
|00000780| 6c 73 74 2e 6f 20 61 72 | 63 6c 7a 77 2e 6f 20 61 |lst.o ar|clzw.o a|
|00000790| 72 63 6d 61 74 63 68 2e | 6f 20 61 72 63 70 61 63 |rcmatch.|o arcpac|
|000007a0| 6b 2e 6f 20 61 72 63 72 | 75 6e 2e 6f 20 5c 0a 61 |k.o arcr|un.o \.a|
|000007b0| 72 63 73 71 2e 6f 20 61 | 72 63 73 76 63 2e 6f 20 |rcsq.o a|rcsvc.o |
|000007c0| 61 72 63 74 73 74 2e 6f | 20 61 72 63 75 6e 70 2e |arctst.o| arcunp.|
|000007d0| 6f 20 61 72 63 75 73 71 | 2e 6f 20 61 72 63 76 61 |o arcusq|.o arcva|
|000007e0| 78 2e 6f 20 61 72 63 6d | 69 73 63 2e 6f 20 73 71 |x.o arcm|isc.o sq|
|000007f0| 75 61 73 68 2e 6f 0a 0a | 53 52 43 53 20 3d 20 61 |uash.o..|SRCS = a|
|00000800| 72 63 2e 63 20 61 72 63 | 61 64 64 2e 63 20 61 72 |rc.c arc|add.c ar|
|00000810| 63 63 6f 64 65 2e 63 20 | 61 72 63 63 76 74 2e 63 |ccode.c |arccvt.c|
|00000820| 20 61 72 63 64 65 6c 2e | 63 20 61 72 63 64 69 72 | arcdel.|c arcdir|
|00000830| 2e 63 20 5c 0a 61 72 63 | 64 6f 73 2e 63 20 61 72 |.c \.arc|dos.c ar|
|00000840| 63 65 78 74 2e 63 20 61 | 72 63 69 6f 2e 63 20 61 |cext.c a|rcio.c a|
|00000850| 72 63 6c 73 74 2e 63 20 | 61 72 63 6c 7a 77 2e 63 |rclst.c |arclzw.c|
|00000860| 20 61 72 63 6d 61 74 63 | 68 2e 63 20 61 72 63 70 | arcmatc|h.c arcp|
|00000870| 61 63 6b 2e 63 20 61 72 | 63 72 75 6e 2e 63 20 5c |ack.c ar|crun.c \|
|00000880| 0a 61 72 63 73 2e 63 20 | 61 72 63 73 71 2e 63 20 |.arcs.c |arcsq.c |
|00000890| 61 72 63 73 76 63 2e 63 | 20 61 72 63 74 73 74 2e |arcsvc.c| arctst.|
|000008a0| 63 20 61 72 63 75 6e 70 | 2e 63 20 61 72 63 75 73 |c arcunp|.c arcus|
|000008b0| 71 2e 63 20 61 72 63 76 | 61 78 2e 63 20 61 72 63 |q.c arcv|ax.c arc|
|000008c0| 6d 69 73 63 2e 63 20 73 | 71 75 61 73 68 2e 63 0a |misc.c s|quash.c.|
|000008d0| 0a 61 72 63 3a 09 09 24 | 7b 4f 42 4a 53 7d 0a 09 |.arc:..$|{OBJS}..|
|000008e0| 63 63 20 20 2d 4f 20 2d | 6f 20 61 72 63 20 24 7b |cc -O -|o arc ${|
|000008f0| 4f 42 4a 53 7d 0a 61 72 | 63 2e 6f 3a 09 09 61 72 |OBJS}.ar|c.o:..ar|
|00000900| 63 2e 68 0a 09 63 63 20 | 2d 4f 20 2d 63 20 61 72 |c.h..cc |-O -c ar|
|00000910| 63 2e 63 0a 61 72 63 61 | 64 64 2e 6f 3a 09 61 72 |c.c.arca|dd.o:.ar|
|00000920| 63 2e 68 0a 09 63 63 20 | 2d 4f 20 2d 63 20 61 72 |c.h..cc |-O -c ar|
|00000930| 63 61 64 64 2e 63 0a 61 | 72 63 63 6f 64 65 2e 6f |cadd.c.a|rccode.o|
|00000940| 3a 09 61 72 63 2e 68 0a | 09 63 63 20 2d 4f 20 2d |:.arc.h.|.cc -O -|
|00000950| 63 20 61 72 63 63 6f 64 | 65 2e 63 0a 61 72 63 63 |c arccod|e.c.arcc|
|00000960| 76 74 2e 6f 3a 09 61 72 | 63 2e 68 0a 09 63 63 20 |vt.o:.ar|c.h..cc |
|00000970| 2d 4f 20 2d 63 20 61 72 | 63 63 76 74 2e 63 0a 61 |-O -c ar|ccvt.c.a|
|00000980| 72 63 64 65 6c 2e 6f 3a | 09 61 72 63 2e 68 0a 09 |rcdel.o:|.arc.h..|
|00000990| 63 63 20 2d 4f 20 2d 63 | 20 61 72 63 64 65 6c 2e |cc -O -c| arcdel.|
|000009a0| 63 0a 61 72 63 64 69 72 | 2e 6f 3a 09 61 72 63 2e |c.arcdir|.o:.arc.|
|000009b0| 68 0a 09 63 63 20 2d 4f | 20 2d 63 20 61 72 63 64 |h..cc -O| -c arcd|
|000009c0| 69 72 2e 63 0a 61 72 63 | 64 6f 73 2e 6f 3a 09 61 |ir.c.arc|dos.o:.a|
|000009d0| 72 63 2e 68 0a 09 63 63 | 20 2d 4f 20 2d 63 20 61 |rc.h..cc| -O -c a|
|000009e0| 72 63 64 6f 73 2e 63 0a | 61 72 63 65 78 74 2e 6f |rcdos.c.|arcext.o|
|000009f0| 3a 09 61 72 63 2e 68 0a | 09 63 63 20 2d 4f 20 2d |:.arc.h.|.cc -O -|
|00000a00| 63 20 61 72 63 65 78 74 | 2e 63 0a 61 72 63 69 6f |c arcext|.c.arcio|
|00000a10| 2e 6f 3a 09 61 72 63 2e | 68 0a 09 63 63 20 2d 4f |.o:.arc.|h..cc -O|
|00000a20| 20 2d 63 20 61 72 63 69 | 6f 2e 63 0a 61 72 63 6c | -c arci|o.c.arcl|
|00000a30| 73 74 2e 6f 3a 09 61 72 | 63 2e 68 0a 09 63 63 20 |st.o:.ar|c.h..cc |
|00000a40| 2d 4f 20 2d 63 20 61 72 | 63 6c 73 74 2e 63 0a 61 |-O -c ar|clst.c.a|
|00000a50| 72 63 6c 7a 77 2e 6f 3a | 09 61 72 63 2e 68 0a 09 |rclzw.o:|.arc.h..|
|00000a60| 63 63 20 2d 4f 20 2d 63 | 20 61 72 63 6c 7a 77 2e |cc -O -c| arclzw.|
|00000a70| 63 0a 61 72 63 6d 61 74 | 63 68 2e 6f 3a 09 61 72 |c.arcmat|ch.o:.ar|
|00000a80| 63 2e 68 0a 09 63 63 20 | 2d 4f 20 2d 63 20 61 72 |c.h..cc |-O -c ar|
|00000a90| 63 6d 61 74 63 68 2e 63 | 0a 61 72 63 6d 69 73 63 |cmatch.c|.arcmisc|
|00000aa0| 2e 6f 3a 09 61 72 63 2e | 68 0a 09 63 63 20 2d 4f |.o:.arc.|h..cc -O|
|00000ab0| 20 2d 63 20 61 72 63 6d | 69 73 63 2e 63 0a 61 72 | -c arcm|isc.c.ar|
|00000ac0| 63 70 61 63 6b 2e 6f 3a | 09 61 72 63 2e 68 0a 09 |cpack.o:|.arc.h..|
|00000ad0| 63 63 20 2d 4f 20 2d 63 | 20 61 72 63 70 61 63 6b |cc -O -c| arcpack|
|00000ae0| 2e 63 0a 61 72 63 72 75 | 6e 2e 6f 3a 09 61 72 63 |.c.arcru|n.o:.arc|
|00000af0| 2e 68 0a 09 63 63 20 2d | 4f 20 2d 63 20 61 72 63 |.h..cc -|O -c arc|
|00000b00| 72 75 6e 2e 63 0a 61 72 | 63 73 2e 6f 3a 09 09 61 |run.c.ar|cs.o:..a|
|00000b10| 72 63 6d 2e 68 0a 09 63 | 63 20 2d 4f 20 2d 63 20 |rcm.h..c|c -O -c |
|00000b20| 61 72 63 73 2e 63 0a 61 | 72 63 73 71 2e 6f 3a 09 |arcs.c.a|rcsq.o:.|
|00000b30| 61 72 63 2e 68 0a 09 63 | 63 20 2d 4f 20 2d 63 20 |arc.h..c|c -O -c |
|00000b40| 61 72 63 73 71 2e 63 0a | 61 72 63 73 76 63 2e 6f |arcsq.c.|arcsvc.o|
|00000b50| 3a 09 61 72 63 2e 68 0a | 09 63 63 20 2d 4f 20 2d |:.arc.h.|.cc -O -|
|00000b60| 63 20 61 72 63 73 76 63 | 2e 63 0a 61 72 63 74 73 |c arcsvc|.c.arcts|
|00000b70| 74 2e 6f 3a 09 61 72 63 | 2e 68 0a 09 63 63 20 2d |t.o:.arc|.h..cc -|
|00000b80| 4f 20 2d 63 20 61 72 63 | 74 73 74 2e 63 0a 61 72 |O -c arc|tst.c.ar|
|00000b90| 63 75 6e 70 2e 6f 3a 09 | 61 72 63 2e 68 0a 09 63 |cunp.o:.|arc.h..c|
|00000ba0| 63 20 2d 4f 20 2d 63 20 | 61 72 63 75 6e 70 2e 63 |c -O -c |arcunp.c|
|00000bb0| 0a 61 72 63 75 73 71 2e | 6f 3a 09 61 72 63 2e 68 |.arcusq.|o:.arc.h|
|00000bc0| 0a 09 63 63 20 2d 4f 20 | 2d 63 20 61 72 63 75 73 |..cc -O |-c arcus|
|00000bd0| 71 2e 63 0a 61 72 63 76 | 61 78 2e 6f 3a 09 61 72 |q.c.arcv|ax.o:.ar|
|00000be0| 63 2e 68 0a 09 63 63 20 | 2d 4f 20 2d 63 20 61 72 |c.h..cc |-O -c ar|
|00000bf0| 63 76 61 78 2e 63 0a 73 | 71 75 61 73 68 2e 6f 3a |cvax.c.s|quash.o:|
|00000c00| 09 61 72 63 2e 68 0a 09 | 63 63 20 2d 4f 20 2d 63 |.arc.h..|cc -O -c|
|00000c10| 20 73 71 75 61 73 68 2e | 63 0a 61 72 63 2e 68 3a | squash.|c.arc.h:|
|00000c20| 09 09 61 72 63 6d 2e 68 | 20 61 72 63 73 2e 68 0a |..arcm.h| arcs.h.|
|00000c30| 09 74 6f 75 63 68 20 61 | 72 63 2e 68 0a 53 48 41 |.touch a|rc.h.SHA|
|00000c40| 52 5f 45 4f 46 0a 63 68 | 6d 6f 64 20 2b 78 20 27 |R_EOF.ch|mod +x '|
|00000c50| 4d 61 6b 65 66 69 6c 65 | 27 0a 66 69 20 23 20 65 |Makefile|'.fi # e|
|00000c60| 6e 64 20 6f 66 20 6f 76 | 65 72 77 72 69 74 69 6e |nd of ov|erwritin|
|00000c70| 67 20 63 68 65 63 6b 0a | 69 66 20 74 65 73 74 20 |g check.|if test |
|00000c80| 2d 66 20 27 61 72 63 2e | 63 27 0a 74 68 65 6e 0a |-f 'arc.|c'.then.|
|00000c90| 09 65 63 68 6f 20 73 68 | 61 72 3a 20 77 69 6c 6c |.echo sh|ar: will|
|00000ca0| 20 6e 6f 74 20 6f 76 65 | 72 2d 77 72 69 74 65 20 | not ove|r-write |
|00000cb0| 65 78 69 73 74 69 6e 67 | 20 66 69 6c 65 20 22 27 |existing| file "'|
|00000cc0| 61 72 63 2e 63 27 22 0a | 65 6c 73 65 0a 63 61 74 |arc.c'".|else.cat|
|00000cd0| 20 3c 3c 20 5c 53 48 41 | 52 5f 45 4f 46 20 3e 20 | << \SHA|R_EOF > |
|00000ce0| 27 61 72 63 2e 63 27 0a | 73 74 61 74 69 63 20 63 |'arc.c'.|static c|
|00000cf0| 68 61 72 20 2a 52 43 53 | 69 64 20 3d 20 22 24 48 |har *RCS|id = "$H|
|00000d00| 65 61 64 65 72 3a 20 61 | 72 63 2e 63 2c 76 20 31 |eader: a|rc.c,v 1|
|00000d10| 2e 32 20 38 36 2f 30 37 | 2f 31 35 20 30 37 3a 35 |.2 86/07|/15 07:5|
|00000d20| 32 3a 30 34 20 74 75 72 | 6e 65 72 20 45 78 70 20 |2:04 tur|ner Exp |
|00000d30| 24 22 3b 0a 0a 2f 2a 0a | 20 2a 20 24 4c 6f 67 3a |$";../*.| * $Log:|
|00000d40| 09 61 72 63 2e 63 2c 76 | 20 24 0a 20 2a 20 48 61 |.arc.c,v| $. * Ha|
|00000d50| 63 6b 2d 61 74 74 61 63 | 6b 20 31 2e 33 20 20 38 |ck-attac|k 1.3 8|
|00000d60| 36 2f 31 32 2f 32 30 20 | 20 30 31 3a 32 33 3a 34 |6/12/20 | 01:23:4|
|00000d70| 35 20 20 77 69 6c 68 69 | 74 65 40 75 73 63 65 61 |5 wilhi|te@uscea|
|00000d80| 73 74 2e 75 75 63 70 0a | 20 2a 20 09 42 6c 75 64 |st.uucp.| * .Blud|
|00000d90| 67 65 6f 6e 65 64 20 69 | 6e 74 6f 20 73 75 62 6d |geoned i|nto subm|
|00000da0| 69 73 73 69 6f 6e 20 66 | 6f 72 20 56 41 58 20 31 |ission f|or VAX 1|
|00000db0| 31 2f 37 38 30 20 42 53 | 44 34 2e 32 0a 20 2a 09 |1/780 BS|D4.2. *.|
|00000dc0| 28 75 67 6c 79 20 63 6f | 64 65 2c 20 62 75 74 20 |(ugly co|de, but |
|00000dd0| 66 65 77 65 72 20 63 6f | 72 65 20 64 75 6d 70 73 |fewer co|re dumps|
|00000de0| 29 0a 20 2a 0a 20 2a 20 | 52 65 76 69 73 69 6f 6e |). *. * |Revision|
|00000df0| 20 31 2e 32 20 20 38 36 | 2f 30 37 2f 31 35 20 20 | 1.2 86|/07/15 |
|00000e00| 30 37 3a 35 32 3a 30 34 | 20 20 74 75 72 6e 65 72 |07:52:04| turner|
|00000e10| 0a 20 2a 20 66 69 72 73 | 74 20 77 6f 72 6b 69 6e |. * firs|t workin|
|00000e20| 67 20 76 65 72 73 69 6f | 6e 20 66 6f 72 20 74 68 |g versio|n for th|
|00000e30| 65 20 76 61 78 0a 20 2a | 20 0a 20 2a 20 52 65 76 |e vax. *| . * Rev|
|00000e40| 69 73 69 6f 6e 20 31 2e | 31 20 20 38 36 2f 30 36 |ision 1.|1 86/06|
|00000e50| 2f 32 36 20 20 31 34 3a | 35 39 3a 31 35 20 20 74 |/26 14:|59:15 t|
|00000e60| 75 72 6e 65 72 0a 20 2a | 20 69 6e 69 74 69 61 6c |urner. *| initial|
|00000e70| 20 76 65 72 73 69 6f 6e | 0a 20 2a 20 0a 20 2a 2f | version|. * . */|
|00000e80| 0a 0a 2f 2a 20 20 41 52 | 43 20 2d 20 41 72 63 68 |../* AR|C - Arch|
|00000e90| 69 76 65 20 75 74 69 6c | 69 74 79 0a 0a 24 64 65 |ive util|ity..$de|
|00000ea0| 66 69 6e 65 28 74 61 67 | 2c 24 24 73 65 67 6d 65 |fine(tag|,$$segme|
|00000eb0| 6e 74 28 40 31 2c 24 24 | 69 6e 64 65 78 28 40 31 |nt(@1,$$|index(@1|
|00000ec0| 2c 3d 29 2b 31 29 29 23 | 0a 24 64 65 66 69 6e 65 |,=)+1))#|.$define|
|00000ed0| 28 76 65 72 73 69 6f 6e | 2c 56 65 72 73 69 6f 6e |(version|,Version|
|00000ee0| 20 24 74 61 67 28 0a 54 | 45 44 5f 56 45 52 53 49 | $tag(.T|ED_VERSI|
|00000ef0| 4f 4e 20 44 42 20 3d 35 | 2e 31 32 29 2c 20 63 72 |ON DB =5|.12), cr|
|00000f00| 65 61 74 65 64 20 6f 6e | 20 24 74 61 67 28 0a 54 |eated on| $tag(.T|
|00000f10| 45 44 5f 44 41 54 45 20 | 44 42 20 3d 30 32 2f 30 |ED_DATE |DB =02/0|
|00000f20| 35 2f 38 36 29 20 61 74 | 20 24 74 61 67 28 0a 54 |5/86) at| $tag(.T|
|00000f30| 45 44 5f 54 49 4d 45 20 | 44 42 20 3d 32 32 3a 32 |ED_TIME |DB =22:2|
|00000f40| 32 3a 30 31 29 29 23 0a | 24 75 6e 64 65 66 69 6e |2:01))#.|$undefin|
|00000f50| 65 28 74 61 67 29 23 0a | 20 20 20 20 24 76 65 72 |e(tag)#.| $ver|
|00000f60| 73 69 6f 6e 0a 0a 28 43 | 29 20 43 4f 50 59 52 49 |sion..(C|) COPYRI|
|00000f70| 47 48 54 20 31 39 38 35 | 2c 38 36 20 62 79 20 53 |GHT 1985|,86 by S|
|00000f80| 79 73 74 65 6d 20 45 6e | 68 61 6e 63 65 6d 65 6e |ystem En|hancemen|
|00000f90| 74 20 41 73 73 6f 63 69 | 61 74 65 73 3b 20 41 4c |t Associ|ates; AL|
|00000fa0| 4c 20 52 49 47 48 54 53 | 20 52 45 53 45 52 56 45 |L RIGHTS| RESERVE|
|00000fb0| 44 0a 0a 20 20 20 20 42 | 79 3a 20 20 54 68 6f 6d |D.. B|y: Thom|
|00000fc0| 20 48 65 6e 64 65 72 73 | 6f 6e 0a 0a 20 20 20 20 | Henders|on.. |
|00000fd0| 44 65 73 63 72 69 70 74 | 69 6f 6e 3a 0a 20 20 20 |Descript|ion:. |
|00000fe0| 20 20 20 20 20 20 54 68 | 69 73 20 70 72 6f 67 72 | Th|is progr|
|00000ff0| 61 6d 20 69 73 20 61 20 | 67 65 6e 65 72 61 6c 20 |am is a |general |
|00001000| 61 72 63 68 69 76 65 20 | 75 74 69 6c 69 74 79 2c |archive |utility,|
|00001010| 20 61 6e 64 20 69 73 20 | 75 73 65 64 20 74 6f 20 | and is |used to |
|00001020| 6d 61 69 6e 74 61 69 6e | 0a 20 20 20 20 20 20 20 |maintain|. |
|00001030| 20 20 61 6e 20 61 72 63 | 68 69 76 65 20 6f 66 20 | an arc|hive of |
|00001040| 66 69 6c 65 73 2e 20 20 | 41 6e 20 22 61 72 63 68 |files. |An "arch|
|00001050| 69 76 65 22 20 69 73 20 | 61 20 73 69 6e 67 6c 65 |ive" is |a single|
|00001060| 20 66 69 6c 65 20 74 68 | 61 74 20 63 6f 6d 62 69 | file th|at combi|
|00001070| 6e 65 73 0a 20 20 20 20 | 20 20 20 20 20 6d 61 6e |nes. | man|
|00001080| 79 20 66 69 6c 65 73 2c | 20 72 65 64 75 63 69 6e |y files,| reducin|
|00001090| 67 20 73 74 6f 72 61 67 | 65 20 73 70 61 63 65 20 |g storag|e space |
|000010a0| 61 6e 64 20 61 6c 6c 6f | 77 69 6e 67 20 6d 75 6c |and allo|wing mul|
|000010b0| 74 69 70 6c 65 20 66 69 | 6c 65 73 20 74 6f 0a 20 |tiple fi|les to. |
|000010c0| 20 20 20 20 20 20 20 20 | 62 65 20 68 61 6e 64 6c | |be handl|
|000010d0| 65 64 20 61 73 20 6f 6e | 65 2e 0a 0a 20 20 20 20 |ed as on|e... |
|000010e0| 49 6e 73 74 72 75 63 74 | 69 6f 6e 73 3a 0a 20 20 |Instruct|ions:. |
|000010f0| 20 20 20 20 20 20 20 52 | 75 6e 20 74 68 69 73 20 | R|un this |
|00001100| 70 72 6f 67 72 61 6d 20 | 77 69 74 68 20 6e 6f 20 |program |with no |
|00001110| 61 72 67 75 6d 65 6e 74 | 73 20 66 6f 72 20 63 6f |argument|s for co|
|00001120| 6d 70 6c 65 74 65 20 69 | 6e 73 74 72 75 63 74 69 |mplete i|nstructi|
|00001130| 6f 6e 73 2e 0a 0a 20 20 | 20 20 50 72 6f 67 72 61 |ons... | Progra|
|00001140| 6d 6d 69 6e 67 20 6e 6f | 74 65 73 3a 0a 20 20 20 |mming no|tes:. |
|00001150| 20 20 20 20 20 20 41 52 | 43 20 56 65 72 73 69 6f | AR|C Versio|
|00001160| 6e 20 32 20 64 69 66 66 | 65 72 73 20 66 72 6f 6d |n 2 diff|ers from|
|00001170| 20 76 65 72 73 69 6f 6e | 20 31 20 69 6e 20 74 68 | version| 1 in th|
|00001180| 61 74 20 61 72 63 68 69 | 76 65 20 65 6e 74 72 69 |at archi|ve entri|
|00001190| 65 73 0a 20 20 20 20 20 | 20 20 20 20 61 72 65 20 |es. | are |
|000011a0| 61 75 74 6f 6d 61 74 69 | 63 61 6c 6c 79 20 63 6f |automati|cally co|
|000011b0| 6d 70 72 65 73 73 65 64 | 20 77 68 65 6e 20 74 68 |mpressed| when th|
|000011c0| 65 79 20 61 72 65 20 61 | 64 64 65 64 20 74 6f 20 |ey are a|dded to |
|000011d0| 74 68 65 20 61 72 63 68 | 69 76 65 2c 0a 20 20 20 |the arch|ive,. |
|000011e0| 20 20 20 20 20 20 6d 61 | 6b 69 6e 67 20 61 20 73 | ma|king a s|
|000011f0| 65 70 61 72 61 74 65 20 | 63 6f 6d 70 72 65 73 73 |eparate |compress|
|00001200| 69 6f 6e 20 73 74 65 70 | 20 75 6e 65 63 65 73 73 |ion step| unecess|
|00001210| 61 72 79 2e 20 20 54 68 | 65 20 6e 61 74 75 72 65 |ary. Th|e nature|
|00001220| 20 6f 66 20 74 68 65 0a | 20 20 20 20 20 20 20 20 | of the.| |
|00001230| 20 63 6f 6d 70 72 65 73 | 73 69 6f 6e 20 69 73 20 | compres|sion is |
|00001240| 69 6e 64 69 63 61 74 65 | 64 20 62 79 20 74 68 65 |indicate|d by the|
|00001250| 20 68 65 61 64 65 72 20 | 76 65 72 73 69 6f 6e 20 | header |version |
|00001260| 6e 75 6d 62 65 72 20 70 | 6c 61 63 65 64 20 69 6e |number p|laced in|
|00001270| 0a 20 20 20 20 20 20 20 | 20 20 65 61 63 68 20 61 |. | each a|
|00001280| 72 63 68 69 76 65 20 65 | 6e 74 72 79 2c 20 61 73 |rchive e|ntry, as|
|00001290| 20 66 6f 6c 6c 6f 77 73 | 3a 0a 0a 20 20 20 20 20 | follows|:.. |
|000012a0| 20 20 20 20 31 20 3d 20 | 4f 6c 64 20 73 74 79 6c | 1 = |Old styl|
|000012b0| 65 2c 20 6e 6f 20 63 6f | 6d 70 72 65 73 73 69 6f |e, no co|mpressio|
|000012c0| 6e 0a 20 20 20 20 20 20 | 20 20 20 32 20 3d 20 4e |n. | 2 = N|
|000012d0| 65 77 20 73 74 79 6c 65 | 2c 20 6e 6f 20 63 6f 6d |ew style|, no com|
|000012e0| 70 72 65 73 73 69 6f 6e | 0a 20 20 20 20 20 20 20 |pression|. |
|000012f0| 20 20 33 20 3d 20 43 6f | 6d 70 72 65 73 73 69 6f | 3 = Co|mpressio|
|00001300| 6e 20 6f 66 20 72 65 70 | 65 61 74 65 64 20 63 68 |n of rep|eated ch|
|00001310| 61 72 61 63 74 65 72 73 | 20 6f 6e 6c 79 0a 20 20 |aracters| only. |
|00001320| 20 20 20 20 20 20 20 34 | 20 3d 20 43 6f 6d 70 72 | 4| = Compr|
|00001330| 65 73 73 69 6f 6e 20 6f | 66 20 72 65 70 65 61 74 |ession o|f repeat|
|00001340| 65 64 20 63 68 61 72 61 | 63 74 65 72 73 20 70 6c |ed chara|cters pl|
|00001350| 75 73 20 48 75 66 66 6d | 61 6e 20 53 51 75 65 65 |us Huffm|an SQuee|
|00001360| 7a 69 6e 67 0a 20 20 20 | 20 20 20 20 20 20 35 20 |zing. | 5 |
|00001370| 3d 20 4c 65 6d 70 65 6c | 2d 5a 65 76 20 70 61 63 |= Lempel|-Zev pac|
|00001380| 6b 69 6e 67 20 6f 66 20 | 72 65 70 65 61 74 65 64 |king of |repeated|
|00001390| 20 73 74 72 69 6e 67 73 | 20 28 6f 6c 64 20 73 74 | strings| (old st|
|000013a0| 79 6c 65 29 0a 20 20 20 | 20 20 20 20 20 20 36 20 |yle). | 6 |
|000013b0| 3d 20 4c 65 6d 70 65 6c | 2d 5a 65 76 20 70 61 63 |= Lempel|-Zev pac|
|000013c0| 6b 69 6e 67 20 6f 66 20 | 72 65 70 65 61 74 65 64 |king of |repeated|
|000013d0| 20 73 74 72 69 6e 67 73 | 20 28 6e 65 77 20 73 74 | strings| (new st|
|000013e0| 79 6c 65 29 0a 20 20 20 | 20 20 20 20 20 20 37 20 |yle). | 7 |
|000013f0| 3d 20 4c 65 6d 70 65 6c | 2d 5a 65 76 20 57 69 6c |= Lempel|-Zev Wil|
|00001400| 6c 69 61 6d 73 20 70 61 | 63 6b 69 6e 67 20 77 69 |liams pa|cking wi|
|00001410| 74 68 20 69 6d 70 72 6f | 76 65 64 20 68 61 73 20 |th impro|ved has |
|00001420| 66 75 6e 63 74 69 6f 6e | 0a 20 20 20 20 20 20 20 |function|. |
|00001430| 20 20 38 20 3d 20 44 79 | 6e 61 6d 69 63 20 4c 65 | 8 = Dy|namic Le|
|00001440| 6d 70 65 6c 2d 5a 65 76 | 20 70 61 63 6b 69 6e 67 |mpel-Zev| packing|
|00001450| 20 77 69 74 68 20 61 64 | 61 70 74 69 76 65 20 72 | with ad|aptive r|
|00001460| 65 73 65 74 0a 09 20 39 | 20 3d 20 53 71 75 61 73 |eset.. 9| = Squas|
|00001470| 68 69 6e 67 0a 0a 20 20 | 20 20 20 20 20 20 20 54 |hing.. | T|
|00001480| 79 70 65 20 35 2c 20 4c | 65 6d 70 65 6c 2d 5a 65 |ype 5, L|empel-Ze|
|00001490| 76 20 70 61 63 6b 69 6e | 67 2c 20 77 61 73 20 61 |v packin|g, was a|
|000014a0| 64 64 65 64 20 61 73 20 | 6f 66 20 76 65 72 73 69 |dded as |of versi|
|000014b0| 6f 6e 20 34 2e 30 0a 0a | 20 20 20 20 20 20 20 20 |on 4.0..| |
|000014c0| 20 54 79 70 65 20 36 20 | 69 73 20 4c 65 6d 70 65 | Type 6 |is Lempe|
|000014d0| 6c 2d 5a 65 76 20 70 61 | 63 6b 69 6e 67 20 77 68 |l-Zev pa|cking wh|
|000014e0| 65 72 65 20 72 75 6e 73 | 20 6f 66 20 72 65 70 65 |ere runs| of repe|
|000014f0| 61 74 65 64 20 63 68 61 | 72 61 63 74 65 72 73 0a |ated cha|racters.|
|00001500| 20 20 20 20 20 20 20 20 | 20 68 61 76 65 20 62 65 | | have be|
|00001510| 65 6e 20 63 6f 6c 6c 61 | 70 73 65 64 2c 20 61 6e |en colla|psed, an|
|00001520| 64 20 77 61 73 20 61 64 | 64 65 64 20 61 73 20 6f |d was ad|ded as o|
|00001530| 66 20 76 65 72 73 69 6f | 6e 20 34 2e 31 0a 0a 20 |f versio|n 4.1.. |
|00001540| 20 20 20 20 20 20 20 20 | 54 79 70 65 20 37 20 69 | |Type 7 i|
|00001550| 73 20 61 20 76 61 72 69 | 61 74 69 6f 6e 20 6f 66 |s a vari|ation of|
|00001560| 20 4c 65 6d 70 65 6c 2d | 5a 65 76 20 75 73 69 6e | Lempel-|Zev usin|
|00001570| 67 20 61 20 64 69 66 66 | 65 72 65 6e 74 20 68 61 |g a diff|erent ha|
|00001580| 73 68 0a 20 20 20 20 20 | 20 20 20 20 66 75 6e 63 |sh. | func|
|00001590| 74 69 6f 6e 20 77 68 69 | 63 68 20 79 69 65 6c 64 |tion whi|ch yield|
|000015a0| 73 20 73 70 65 65 64 20 | 69 6d 70 72 6f 76 65 6d |s speed |improvem|
|000015b0| 65 6e 74 73 20 6f 66 20 | 32 30 2d 32 35 25 2c 20 |ents of |20-25%, |
|000015c0| 61 6e 64 20 77 61 73 0a | 20 20 20 20 20 20 20 20 |and was.| |
|000015d0| 20 61 64 64 65 64 20 61 | 73 20 6f 66 20 76 65 72 | added a|s of ver|
|000015e0| 73 69 6f 6e 20 34 2e 36 | 0a 0a 20 20 20 20 20 20 |sion 4.6|.. |
|000015f0| 20 20 20 54 79 70 65 20 | 38 20 69 73 20 61 20 64 | Type |8 is a d|
|00001600| 69 66 66 65 72 65 6e 74 | 20 69 6d 70 6c 65 6d 65 |ifferent| impleme|
|00001610| 6e 74 61 74 69 6f 6e 20 | 6f 66 20 4c 65 6d 70 65 |ntation |of Lempe|
|00001620| 6c 2d 5a 65 76 2c 20 75 | 73 69 6e 67 20 61 0a 20 |l-Zev, u|sing a. |
|00001630| 20 20 20 20 20 20 20 20 | 76 61 72 69 61 62 6c 65 | |variable|
|00001640| 20 63 6f 64 65 20 73 69 | 7a 65 20 61 6e 64 20 61 | code si|ze and a|
|00001650| 6e 20 61 64 61 70 74 69 | 76 65 20 62 6c 6f 63 6b |n adapti|ve block|
|00001660| 20 72 65 73 65 74 2c 20 | 61 6e 64 20 77 61 73 20 | reset, |and was |
|00001670| 61 64 64 65 64 0a 20 20 | 20 20 20 20 20 20 20 61 |added. | a|
|00001680| 73 20 6f 66 20 76 65 72 | 73 69 6f 6e 20 35 2e 30 |s of ver|sion 5.0|
|00001690| 0a 0a 20 20 20 20 20 20 | 20 20 20 56 65 72 69 6f |.. | Verio|
|000016a0| 6e 20 34 2e 33 20 69 6e | 74 72 6f 64 75 63 65 64 |n 4.3 in|troduced|
|000016b0| 20 61 20 74 65 6d 70 6f | 72 61 72 79 20 66 69 6c | a tempo|rary fil|
|000016c0| 65 20 66 6f 72 20 68 6f | 6c 64 69 6e 67 20 74 68 |e for ho|lding th|
|000016d0| 65 20 72 65 73 75 6c 74 | 0a 20 20 20 20 20 20 20 |e result|. |
|000016e0| 20 20 6f 66 20 74 68 65 | 20 66 69 72 73 74 20 63 | of the| first c|
|000016f0| 72 75 6e 63 68 20 70 61 | 73 73 2c 20 74 68 75 73 |runch pa|ss, thus|
|00001700| 20 73 70 65 65 64 69 6e | 67 20 75 70 20 63 72 75 | speedin|g up cru|
|00001710| 6e 63 68 69 6e 67 2e 0a | 0a 20 20 20 20 20 20 20 |nching..|. |
|00001720| 20 20 56 65 72 73 69 6f | 6e 20 34 2e 34 20 69 6e | Versio|n 4.4 in|
|00001730| 74 72 6f 64 75 63 65 64 | 20 74 68 65 20 41 52 43 |troduced| the ARC|
|00001740| 54 45 4d 50 20 65 6e 76 | 69 72 6f 6e 6d 65 6e 74 |TEMP env|ironment|
|00001750| 20 73 74 72 69 6e 67 2c | 20 73 6f 20 74 68 61 74 | string,| so that|
|00001760| 0a 20 20 20 20 20 20 20 | 20 20 74 68 65 20 74 65 |. | the te|
|00001770| 6d 70 6f 72 61 72 79 20 | 63 72 75 6e 63 68 20 66 |mporary |crunch f|
|00001780| 69 6c 65 20 6d 61 79 20 | 62 65 20 70 6c 61 63 65 |ile may |be place|
|00001790| 64 20 6f 6e 20 61 20 72 | 61 6d 64 69 73 6b 2e 20 |d on a r|amdisk. |
|000017a0| 20 41 6c 73 6f 0a 20 20 | 20 20 20 20 20 20 20 61 | Also. | a|
|000017b0| 64 64 65 64 20 77 61 73 | 20 74 68 65 20 64 69 73 |dded was| the dis|
|000017c0| 74 69 6e 63 74 69 6f 6e | 20 62 65 77 74 65 65 6e |tinction| bewteen|
|000017d0| 20 41 64 64 69 6e 67 20 | 61 20 66 69 6c 65 20 69 | Adding |a file i|
|000017e0| 6e 20 61 6c 6c 20 63 61 | 73 65 73 2c 0a 20 20 20 |n all ca|ses,. |
|000017f0| 20 20 20 20 20 20 61 6e | 64 20 55 70 64 61 74 69 | an|d Updati|
|00001800| 6e 67 20 61 20 66 69 6c | 65 20 6f 6e 6c 79 20 69 |ng a fil|e only i|
|00001810| 66 20 74 68 65 20 64 69 | 73 6b 20 66 69 6c 65 20 |f the di|sk file |
|00001820| 69 73 20 6e 65 77 65 72 | 20 74 68 61 6e 20 74 68 |is newer| than th|
|00001830| 65 0a 20 20 20 20 20 20 | 20 20 20 63 6f 72 72 65 |e. | corre|
|00001840| 73 70 6f 6e 64 69 6e 67 | 20 61 72 63 68 69 76 65 |sponding| archive|
|00001850| 20 65 6e 74 72 79 2e 0a | 0a 20 20 20 20 20 20 20 | entry..|. |
|00001860| 20 20 54 68 65 20 63 6f | 6d 70 72 65 73 73 69 6f | The co|mpressio|
|00001870| 6e 20 6d 65 74 68 6f 64 | 20 74 6f 20 75 73 65 20 |n method| to use |
|00001880| 69 73 20 64 65 74 65 72 | 6d 69 6e 65 64 20 77 68 |is deter|mined wh|
|00001890| 65 6e 20 74 68 65 20 66 | 69 6c 65 20 69 73 0a 20 |en the f|ile is. |
|000018a0| 20 20 20 20 20 20 20 20 | 61 64 64 65 64 2c 20 62 | |added, b|
|000018b0| 61 73 65 64 20 6f 6e 20 | 77 68 69 63 68 65 76 65 |ased on |whicheve|
|000018c0| 72 20 6d 65 74 68 6f 64 | 20 79 69 65 6c 64 73 20 |r method| yields |
|000018d0| 74 68 65 20 73 6d 61 6c | 6c 65 73 74 20 72 65 73 |the smal|lest res|
|000018e0| 75 6c 74 2e 0a 0a 20 20 | 20 20 4c 61 6e 67 75 61 |ult... | Langua|
|000018f0| 67 65 3a 0a 20 20 20 20 | 20 20 20 20 20 43 6f 6d |ge:. | Com|
|00001900| 70 75 74 65 72 20 49 6e | 6e 6f 76 61 74 69 6f 6e |puter In|novation|
|00001910| 73 20 4f 70 74 69 6d 69 | 7a 69 6e 67 20 43 38 36 |s Optimi|zing C86|
|00001920| 0a 2a 2f 0a 23 69 6e 63 | 6c 75 64 65 20 3c 73 74 |.*/.#inc|lude <st|
|00001930| 64 69 6f 2e 68 3e 0a 23 | 69 6e 63 6c 75 64 65 20 |dio.h>.#|include |
|00001940| 22 61 72 63 2e 68 22 0a | 0a 6d 61 69 6e 28 6e 75 |"arc.h".|.main(nu|
|00001950| 6d 2c 61 72 67 29 20 20 | 20 20 20 20 20 20 20 20 |m,arg) | |
|00001960| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001970| 2f 2a 20 73 79 73 74 65 | 6d 20 65 6e 74 72 79 20 |/* syste|m entry |
|00001980| 70 6f 69 6e 74 20 2a 2f | 0a 49 4e 54 20 6e 75 6d |point */|.INT num|
|00001990| 3b 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |; | |
|000019a0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000019b0| 2f 2a 20 6e 75 6d 62 65 | 72 20 6f 66 20 61 72 67 |/* numbe|r of arg|
|000019c0| 75 6d 65 6e 74 73 20 2a | 2f 0a 63 68 61 72 20 2a |uments *|/.char *|
|000019d0| 61 72 67 5b 5d 3b 20 20 | 20 20 20 20 20 20 20 20 |arg[]; | |
|000019e0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000019f0| 20 2f 2a 20 70 6f 69 6e | 74 65 72 73 20 74 6f 20 | /* poin|ters to |
|00001a00| 61 72 67 75 6d 65 6e 74 | 73 20 2a 2f 0a 7b 0a 20 |argument|s */.{. |
|00001a10| 20 20 20 63 68 61 72 20 | 6f 70 74 20 3d 20 30 3b | char |opt = 0;|
|00001a20| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001a30| 20 20 20 20 20 20 2f 2a | 20 73 65 6c 65 63 74 65 | /*| selecte|
|00001a40| 64 20 61 63 74 69 6f 6e | 20 2a 2f 0a 20 20 20 20 |d action| */. |
|00001a50| 63 68 61 72 20 2a 61 3b | 20 20 20 20 20 20 20 20 |char *a;| |
|00001a60| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001a70| 20 20 20 2f 2a 20 6f 70 | 74 69 6f 6e 20 70 6f 69 | /* op|tion poi|
|00001a80| 6e 74 65 72 20 2a 2f 0a | 20 20 20 20 63 68 61 72 |nter */.| char|
|00001a90| 20 2a 6d 61 6b 65 66 6e | 61 6d 28 29 3b 20 20 20 | *makefn|am(); |
|00001aa0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 2f | | /|
|00001ab0| 2a 20 66 69 6c 65 6e 61 | 6d 65 20 66 69 78 75 70 |* filena|me fixup|
|00001ac0| 20 72 6f 75 74 69 6e 65 | 20 2a 2f 0a 20 20 20 20 | routine| */. |
|00001ad0| 63 68 61 72 20 2a 75 70 | 70 65 72 28 29 3b 20 20 |char *up|per(); |
|00001ae0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001af0| 20 20 20 2f 2a 20 63 61 | 73 65 20 63 6f 6e 76 65 | /* ca|se conve|
|00001b00| 72 73 69 6f 6e 20 72 6f | 75 74 69 6e 65 20 2a 2f |rsion ro|utine */|
|00001b10| 0a 20 20 20 20 63 68 61 | 72 20 2a 69 6e 64 65 78 |. cha|r *index|
|00001b20| 28 29 3b 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |(); | |
|00001b30| 20 20 20 20 20 20 20 20 | 2f 2a 20 73 74 72 69 6e | |/* strin|
|00001b40| 67 20 69 6e 64 65 78 20 | 75 74 69 6c 69 74 79 20 |g index |utility |
|00001b50| 2a 2f 0a 20 20 20 20 63 | 68 61 72 20 2a 65 6e 76 |*/. c|har *env|
|00001b60| 66 69 6e 64 28 29 3b 20 | 20 20 20 20 20 20 20 20 |find(); | |
|00001b70| 20 20 20 20 20 20 20 20 | 20 20 2f 2a 20 65 6e 76 | | /* env|
|00001b80| 69 72 6f 6e 6d 65 6e 74 | 20 73 65 61 72 63 68 65 |ironment| searche|
|00001b90| 72 20 2a 2f 0a 20 20 20 | 20 49 4e 54 20 6e 3b 20 |r */. | INT n; |
|00001ba0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001bb0| 20 20 20 20 20 20 20 20 | 20 20 20 20 2f 2a 20 61 | | /* a|
|00001bc0| 72 67 75 6d 65 6e 74 20 | 69 6e 64 65 78 20 2a 2f |rgument |index */|
|00001bd0| 0a 20 20 20 20 63 68 61 | 72 20 2a 61 72 63 74 65 |. cha|r *arcte|
|00001be0| 6d 70 32 3b 0a 20 20 20 | 20 6c 6f 6e 67 20 67 65 |mp2;. | long ge|
|00001bf0| 74 70 69 64 28 29 3b 0a | 0a 20 20 20 20 77 61 72 |tpid();.|. war|
|00001c00| 6e 20 3d 20 31 3b 0a 20 | 20 20 20 6e 6f 74 65 20 |n = 1;. | note |
|00001c10| 3d 20 31 3b 0a 20 20 20 | 20 69 66 28 6e 75 6d 3c |= 1;. | if(num<|
|00001c20| 33 29 0a 20 20 20 20 7b | 20 2f 2a 20 70 72 69 6e |3). {| /* prin|
|00001c30| 74 66 28 22 41 52 43 20 | 2d 20 41 72 63 68 69 76 |tf("ARC |- Archiv|
|00001c40| 65 20 75 74 69 6c 69 74 | 79 2c 20 24 76 65 72 73 |e utilit|y, $vers|
|00001c50| 69 6f 6e 5c 6e 22 29 3b | 0a 20 20 20 20 20 20 20 |ion\n");|. |
|00001c60| 20 20 70 72 69 6e 74 66 | 28 22 28 43 29 20 43 4f | printf|("(C) CO|
|00001c70| 50 59 52 49 47 48 54 20 | 31 39 38 35 2c 38 36 20 |PYRIGHT |1985,86 |
|00001c80| 62 79 20 53 79 73 74 65 | 6d 20 45 6e 68 61 6e 63 |by Syste|m Enhanc|
|00001c90| 65 6d 65 6e 74 20 41 73 | 73 6f 63 69 61 74 65 73 |ement As|sociates|
|00001ca0| 3b 22 29 3b 0a 20 20 20 | 20 20 20 20 20 20 70 72 |;");. | pr|
|00001cb0| 69 6e 74 66 28 22 20 41 | 4c 4c 20 52 49 47 48 54 |intf(" A|LL RIGHT|
|00001cc0| 53 20 52 45 53 45 52 56 | 45 44 5c 6e 5c 6e 22 29 |S RESERV|ED\n\n")|
|00001cd0| 3b 0a 20 20 20 20 20 20 | 20 20 20 70 72 69 6e 74 |;. | print|
|00001ce0| 66 28 22 50 6c 65 61 73 | 65 20 72 65 66 65 72 20 |f("Pleas|e refer |
|00001cf0| 61 6c 6c 20 69 6e 71 75 | 69 72 69 65 73 20 74 6f |all inqu|iries to|
|00001d00| 3a 5c 6e 5c 6e 22 29 3b | 0a 20 20 20 20 20 20 20 |:\n\n");|. |
|00001d10| 20 20 70 72 69 6e 74 66 | 28 22 20 20 20 20 20 20 | printf|(" |
|00001d20| 20 53 79 73 74 65 6d 20 | 45 6e 68 61 6e 63 65 6d | System |Enhancem|
|00001d30| 65 6e 74 20 41 73 73 6f | 63 69 61 74 65 73 5c 6e |ent Asso|ciates\n|
|00001d40| 22 29 3b 0a 20 20 20 20 | 20 20 20 20 20 70 72 69 |");. | pri|
|00001d50| 6e 74 66 28 22 20 20 20 | 20 20 20 20 32 31 20 4e |ntf(" | 21 N|
|00001d60| 65 77 20 53 74 72 65 65 | 74 2c 20 57 61 79 6e 65 |ew Stree|t, Wayne|
|00001d70| 20 4e 4a 20 30 37 34 37 | 30 5c 6e 5c 6e 22 29 3b | NJ 0747|0\n\n");|
|00001d80| 0a 20 20 20 20 20 20 20 | 20 20 70 72 69 6e 74 66 |. | printf|
|00001d90| 28 22 59 6f 75 20 6d 61 | 79 20 63 6f 70 79 20 61 |("You ma|y copy a|
|00001da0| 6e 64 20 64 69 73 74 72 | 69 62 75 74 65 20 74 68 |nd distr|ibute th|
|00001db0| 69 73 20 70 72 6f 67 72 | 61 6d 20 66 72 65 65 6c |is progr|am freel|
|00001dc0| 79 2c 22 29 3b 0a 20 20 | 20 20 20 20 20 20 20 70 |y,");. | p|
|00001dd0| 72 69 6e 74 66 28 22 20 | 70 72 6f 76 69 64 65 64 |rintf(" |provided|
|00001de0| 20 74 68 61 74 3a 5c 6e | 22 29 3b 0a 20 20 20 20 | that:\n|");. |
|00001df0| 20 20 20 20 20 70 72 69 | 6e 74 66 28 22 20 20 20 | pri|ntf(" |
|00001e00| 20 31 29 20 20 20 4e 6f | 20 66 65 65 20 69 73 20 | 1) No| fee is |
|00001e10| 63 68 61 72 67 65 64 20 | 66 6f 72 20 73 75 63 68 |charged |for such|
|00001e20| 20 63 6f 70 79 69 6e 67 | 20 61 6e 64 22 29 3b 0a | copying| and");.|
|00001e30| 20 20 20 20 20 20 20 20 | 20 70 72 69 6e 74 66 28 | | printf(|
|00001e40| 22 20 64 69 73 74 72 69 | 62 75 74 69 6f 6e 2c 20 |" distri|bution, |
|00001e50| 61 6e 64 5c 6e 22 29 3b | 0a 20 20 20 20 20 20 20 |and\n");|. |
|00001e60| 20 20 70 72 69 6e 74 66 | 28 22 20 20 20 20 32 29 | printf|(" 2)|
|00001e70| 20 20 20 49 74 20 69 73 | 20 64 69 73 74 72 69 62 | It is| distrib|
|00001e80| 75 74 65 64 20 4f 4e 4c | 59 20 69 6e 20 69 74 73 |uted ONL|Y in its|
|00001e90| 20 6f 72 69 67 69 6e 61 | 6c 2c 22 29 3b 0a 20 20 | origina|l,");. |
|00001ea0| 20 20 20 20 20 20 20 70 | 72 69 6e 74 66 28 22 20 | p|rintf(" |
|00001eb0| 75 6e 6d 6f 64 69 66 69 | 65 64 20 73 74 61 74 65 |unmodifi|ed state|
|00001ec0| 2e 5c 6e 5c 6e 22 29 3b | 0a 20 20 20 20 20 20 20 |.\n\n");|. |
|00001ed0| 20 20 70 72 69 6e 74 66 | 28 22 49 66 20 79 6f 75 | printf|("If you|
|00001ee0| 20 6c 69 6b 65 20 74 68 | 69 73 20 70 72 6f 67 72 | like th|is progr|
|00001ef0| 61 6d 2c 20 61 6e 64 20 | 66 69 6e 64 20 69 74 20 |am, and |find it |
|00001f00| 6f 66 20 75 73 65 2c 20 | 74 68 65 6e 20 79 6f 75 |of use, |then you|
|00001f10| 72 22 29 3b 0a 20 20 20 | 20 20 20 20 20 20 70 72 |r");. | pr|
|00001f20| 69 6e 74 66 28 22 20 63 | 6f 6e 74 72 69 62 75 74 |intf(" c|ontribut|
|00001f30| 69 6f 6e 20 77 69 6c 6c | 5c 6e 22 29 3b 0a 20 20 |ion will|\n");. |
|00001f40| 20 20 20 20 20 20 20 70 | 72 69 6e 74 66 28 22 62 | p|rintf("b|
|00001f50| 65 20 61 70 70 72 65 63 | 69 61 74 65 64 2e 20 20 |e apprec|iated. |
|00001f60| 59 6f 75 20 6d 61 79 20 | 6e 6f 74 20 75 73 65 20 |You may |not use |
|00001f70| 74 68 69 73 20 70 72 6f | 64 75 63 74 20 69 6e 20 |this pro|duct in |
|00001f80| 61 22 29 3b 0a 20 20 20 | 20 20 20 20 20 20 70 72 |a");. | pr|
|00001f90| 69 6e 74 66 28 22 20 63 | 6f 6d 6d 65 72 63 69 61 |intf(" c|ommercia|
|00001fa0| 6c 20 65 6e 76 69 72 6f | 6e 6d 65 6e 74 5c 6e 22 |l enviro|nment\n"|
|00001fb0| 29 3b 0a 20 20 20 20 20 | 20 20 20 20 70 72 69 6e |);. | prin|
|00001fc0| 74 66 28 22 6f 72 20 61 | 20 67 6f 76 65 72 6e 6d |tf("or a| governm|
|00001fd0| 65 6e 74 61 6c 20 6f 72 | 67 61 6e 69 7a 61 74 69 |ental or|ganizati|
|00001fe0| 6f 6e 20 77 69 74 68 6f | 75 74 20 70 61 79 69 6e |on witho|ut payin|
|00001ff0| 67 20 61 20 6c 69 63 65 | 6e 73 65 22 29 3b 0a 20 |g a lice|nse");. |
|00002000| 20 20 20 20 20 20 20 20 | 70 72 69 6e 74 66 28 22 | |printf("|
|00002010| 20 66 65 65 20 6f 66 20 | 24 33 35 2e 20 20 53 69 | fee of |$35. Si|
|00002020| 74 65 5c 6e 22 29 3b 0a | 20 20 20 20 20 20 20 20 |te\n");.| |
|00002030| 20 70 72 69 6e 74 66 28 | 22 6c 69 63 65 6e 73 65 | printf(|"license|
|00002040| 73 20 61 6e 64 20 63 6f | 6d 6d 65 72 63 69 61 6c |s and co|mmercial|
|00002050| 20 64 69 73 74 72 69 62 | 75 74 69 6f 6e 20 6c 69 | distrib|ution li|
|00002060| 63 65 6e 73 65 73 20 61 | 72 65 22 29 3b 0a 20 20 |censes a|re");. |
|00002070| 20 20 20 20 20 20 20 70 | 72 69 6e 74 66 28 22 20 | p|rintf(" |
|00002080| 61 76 61 69 6c 61 62 6c | 65 2e 20 20 41 20 70 72 |availabl|e. A pr|
|00002090| 6f 67 72 61 6d 5c 6e 22 | 29 3b 0a 20 20 20 20 20 |ogram\n"|);. |
|000020a0| 20 20 20 20 70 72 69 6e | 74 66 28 22 64 69 73 6b | prin|tf("disk|
|000020b0| 20 61 6e 64 20 70 72 69 | 6e 74 65 64 20 64 6f 63 | and pri|nted doc|
|000020c0| 75 6d 65 6e 74 61 74 69 | 6f 6e 20 61 72 65 20 61 |umentati|on are a|
|000020d0| 76 61 69 6c 61 62 6c 65 | 20 66 6f 72 20 24 35 30 |vailable| for $50|
|000020e0| 2e 5c 6e 22 29 3b 0a 20 | 20 20 20 20 20 20 20 20 |.\n");. | |
|000020f0| 70 72 69 6e 74 66 28 22 | 5c 6e 49 66 20 79 6f 75 |printf("|\nIf you|
|00002100| 20 66 61 69 6c 20 74 6f | 20 61 62 69 64 65 20 62 | fail to| abide b|
|00002110| 79 20 74 68 65 20 74 65 | 72 6d 73 20 6f 66 20 74 |y the te|rms of t|
|00002120| 68 69 73 20 6c 69 63 65 | 6e 73 65 2c 20 22 29 3b |his lice|nse, ");|
|00002130| 0a 20 20 20 20 20 20 20 | 20 20 70 72 69 6e 74 66 |. | printf|
|00002140| 28 22 20 74 68 65 6e 20 | 79 6f 75 72 20 63 6f 6e |(" then |your con|
|00002150| 73 63 69 65 6e 63 65 5c | 6e 22 29 3b 0a 20 20 20 |science\|n");. |
|00002160| 20 20 20 20 20 20 70 72 | 69 6e 74 66 28 22 77 69 | pr|intf("wi|
|00002170| 6c 6c 20 68 61 75 6e 74 | 20 79 6f 75 20 66 6f 72 |ll haunt| you for|
|00002180| 20 74 68 65 20 72 65 73 | 74 20 6f 66 20 79 6f 75 | the res|t of you|
|00002190| 72 20 6c 69 66 65 2e 5c | 6e 5c 6e 22 29 3b 20 20 |r life.\|n\n"); |
|000021a0| 20 20 20 20 20 20 20 20 | 20 20 2a 2f 0a 20 20 20 | | */. |
|000021b0| 20 20 20 20 20 20 70 72 | 69 6e 74 66 28 22 55 73 | pr|intf("Us|
|000021c0| 61 67 65 3a 20 41 52 43 | 20 7b 61 6d 75 66 64 78 |age: ARC| {amufdx|
|000021d0| 65 72 70 6c 76 74 63 7d | 5b 62 73 77 6e 5d 5b 67 |erplvtc}|[bswn][g|
|000021e0| 3c 70 61 73 73 77 6f 72 | 64 3e 5d 22 29 3b 0a 20 |<passwor|d>]");. |
|000021f0| 20 20 20 20 20 20 20 20 | 70 72 69 6e 74 66 28 22 | |printf("|
|00002200| 20 3c 61 72 63 68 69 76 | 65 3e 20 5b 3c 66 69 6c | <archiv|e> [<fil|
|00002210| 65 6e 61 6d 65 3e 20 2e | 20 2e 20 2e 5d 5c 6e 22 |ename> .| . .]\n"|
|00002220| 29 3b 0a 20 20 20 20 20 | 20 20 20 20 70 72 69 6e |);. | prin|
|00002230| 74 66 28 22 57 68 65 72 | 65 3a 20 20 20 61 20 20 |tf("Wher|e: a |
|00002240| 20 3d 20 61 64 64 20 66 | 69 6c 65 73 20 74 6f 20 | = add f|iles to |
|00002250| 61 72 63 68 69 76 65 5c | 6e 22 29 3b 0a 20 20 20 |archive\|n");. |
|00002260| 20 20 20 20 20 20 70 72 | 69 6e 74 66 28 22 20 20 | pr|intf(" |
|00002270| 20 20 20 20 20 20 20 6d | 20 20 20 3d 20 6d 6f 76 | m| = mov|
|00002280| 65 20 66 69 6c 65 73 20 | 74 6f 20 61 72 63 68 69 |e files |to archi|
|00002290| 76 65 5c 6e 22 29 3b 0a | 20 20 20 20 20 20 20 20 |ve\n");.| |
|000022a0| 20 70 72 69 6e 74 66 28 | 22 20 20 20 20 20 20 20 | printf(|" |
|000022b0| 20 20 75 20 20 20 3d 20 | 75 70 64 61 74 65 20 66 | u = |update f|
|000022c0| 69 6c 65 73 20 69 6e 20 | 61 72 63 68 69 76 65 5c |iles in |archive\|
|000022d0| 6e 22 29 3b 0a 20 20 20 | 20 20 20 20 20 20 70 72 |n");. | pr|
|000022e0| 69 6e 74 66 28 22 20 20 | 20 20 20 20 20 20 20 66 |intf(" | f|
|000022f0| 20 20 20 3d 20 66 72 65 | 73 68 65 6e 20 66 69 6c | = fre|shen fil|
|00002300| 65 73 20 69 6e 20 61 72 | 63 68 69 76 65 5c 6e 22 |es in ar|chive\n"|
|00002310| 29 3b 0a 20 20 20 20 20 | 20 20 20 20 70 72 69 6e |);. | prin|
|00002320| 74 66 28 22 20 20 20 20 | 20 20 20 20 20 64 20 20 |tf(" | d |
|00002330| 20 3d 20 64 65 6c 65 74 | 65 20 66 69 6c 65 73 20 | = delet|e files |
|00002340| 66 72 6f 6d 20 61 72 63 | 68 69 76 65 5c 6e 22 29 |from arc|hive\n")|
|00002350| 3b 0a 20 20 20 20 20 20 | 20 20 20 70 72 69 6e 74 |;. | print|
|00002360| 66 28 22 20 20 20 20 20 | 20 20 20 20 78 2c 65 20 |f(" | x,e |
|00002370| 3d 20 65 78 74 72 61 63 | 74 20 66 69 6c 65 73 20 |= extrac|t files |
|00002380| 66 72 6f 6d 20 61 72 63 | 68 69 76 65 5c 6e 22 29 |from arc|hive\n")|
|00002390| 3b 0a 20 20 20 20 20 20 | 20 20 20 70 72 69 6e 74 |;. | print|
|000023a0| 66 28 22 20 20 20 20 20 | 20 20 20 20 72 20 20 20 |f(" | r |
|000023b0| 3d 20 72 75 6e 20 66 69 | 6c 65 73 20 66 72 6f 6d |= run fi|les from|
|000023c0| 20 61 72 63 68 69 76 65 | 5c 6e 22 29 3b 0a 20 20 | archive|\n");. |
|000023d0| 20 20 20 20 20 20 20 70 | 72 69 6e 74 66 28 22 20 | p|rintf(" |
|000023e0| 20 20 20 20 20 20 20 20 | 70 20 20 20 3d 20 63 6f | |p = co|
|000023f0| 70 79 20 66 69 6c 65 73 | 20 66 72 6f 6d 20 61 72 |py files| from ar|
|00002400| 63 68 69 76 65 20 74 6f | 22 29 3b 0a 20 20 20 20 |chive to|");. |
|00002410| 20 20 20 20 20 70 72 69 | 6e 74 66 28 22 20 73 74 | pri|ntf(" st|
|00002420| 61 6e 64 61 72 64 20 6f | 75 74 70 75 74 5c 6e 22 |andard o|utput\n"|
|00002430| 29 3b 0a 20 20 20 20 20 | 20 20 20 20 70 72 69 6e |);. | prin|
|00002440| 74 66 28 22 20 20 20 20 | 20 20 20 20 20 6c 20 20 |tf(" | l |
|00002450| 20 3d 20 6c 69 73 74 20 | 66 69 6c 65 73 20 69 6e | = list |files in|
|00002460| 20 61 72 63 68 69 76 65 | 5c 6e 22 29 3b 0a 20 20 | archive|\n");. |
|00002470| 20 20 20 20 20 20 20 70 | 72 69 6e 74 66 28 22 20 | p|rintf(" |
|00002480| 20 20 20 20 20 20 20 20 | 76 20 20 20 3d 20 76 65 | |v = ve|
|00002490| 72 62 6f 73 65 20 6c 69 | 73 74 69 6e 67 20 6f 66 |rbose li|sting of|
|000024a0| 20 66 69 6c 65 73 20 69 | 6e 20 61 72 63 68 69 76 | files i|n archiv|
|000024b0| 65 5c 6e 22 29 3b 0a 20 | 20 20 20 20 20 20 20 20 |e\n");. | |
|000024c0| 70 72 69 6e 74 66 28 22 | 20 20 20 20 20 20 20 20 |printf("| |
|000024d0| 20 74 20 20 20 3d 20 74 | 65 73 74 20 61 72 63 68 | t = t|est arch|
|000024e0| 69 76 65 20 69 6e 74 65 | 67 72 69 74 79 5c 6e 22 |ive inte|grity\n"|
|000024f0| 29 3b 0a 20 20 20 20 20 | 20 20 20 20 70 72 69 6e |);. | prin|
|00002500| 74 66 28 22 20 20 20 20 | 20 20 20 20 20 63 20 20 |tf(" | c |
|00002510| 20 3d 20 63 6f 6e 76 65 | 72 74 20 65 6e 74 72 79 | = conve|rt entry|
|00002520| 20 74 6f 20 6e 65 77 20 | 70 61 63 6b 69 6e 67 20 | to new |packing |
|00002530| 6d 65 74 68 6f 64 5c 6e | 22 29 3b 0a 20 20 20 20 |method\n|");. |
|00002540| 20 20 20 20 20 70 72 69 | 6e 74 66 28 22 20 20 20 | pri|ntf(" |
|00002550| 20 20 20 20 20 20 62 20 | 20 20 3d 20 72 65 74 61 | b | = reta|
|00002560| 69 6e 20 62 61 63 6b 75 | 70 20 63 6f 70 79 20 6f |in backu|p copy o|
|00002570| 66 20 61 72 63 68 69 76 | 65 5c 6e 22 29 3b 0a 20 |f archiv|e\n");. |
|00002580| 20 20 20 20 20 20 20 20 | 70 72 69 6e 74 66 28 22 | |printf("|
|00002590| 20 20 20 20 20 20 20 20 | 20 73 20 20 20 3d 20 73 | | s = s|
|000025a0| 75 70 70 72 65 73 73 20 | 63 6f 6d 70 72 65 73 73 |uppress |compress|
|000025b0| 69 6f 6e 20 28 73 74 6f | 72 65 20 6f 6e 6c 79 29 |ion (sto|re only)|
|000025c0| 5c 6e 22 29 3b 0a 20 20 | 20 20 20 20 20 20 20 70 |\n");. | p|
|000025d0| 72 69 6e 74 66 28 22 20 | 20 20 20 20 20 20 20 20 |rintf(" | |
|000025e0| 77 20 20 20 3d 20 73 75 | 70 70 72 65 73 73 20 77 |w = su|ppress w|
|000025f0| 61 72 6e 69 6e 67 20 6d | 65 73 73 61 67 65 73 5c |arning m|essages\|
|00002600| 6e 22 29 3b 0a 20 20 20 | 20 20 20 20 20 20 70 72 |n");. | pr|
|00002610| 69 6e 74 66 28 22 20 20 | 20 20 20 20 20 20 20 6e |intf(" | n|
|00002620| 20 20 20 3d 20 73 75 70 | 70 72 65 73 73 20 6e 6f | = sup|press no|
|00002630| 74 65 73 20 61 6e 64 20 | 63 6f 6d 6d 65 6e 74 73 |tes and |comments|
|00002640| 5c 6e 22 29 3b 0a 20 20 | 20 20 20 20 20 20 20 70 |\n");. | p|
|00002650| 72 69 6e 74 66 28 22 20 | 20 20 20 20 20 20 20 20 |rintf(" | |
|00002660| 67 20 20 20 3d 20 45 6e | 63 72 79 70 74 2f 64 65 |g = En|crypt/de|
|00002670| 63 72 79 70 74 20 61 72 | 63 68 69 76 65 20 65 6e |crypt ar|chive en|
|00002680| 74 72 79 5c 6e 22 29 3b | 0a 20 20 20 20 20 20 20 |try\n");|. |
|00002690| 20 20 70 72 69 6e 74 66 | 28 22 20 20 20 20 20 20 | printf|(" |
|000026a0| 20 20 20 71 20 20 20 3d | 20 73 71 75 61 73 68 20 | q =| squash |
|000026b0| 69 6e 73 74 65 61 64 20 | 6f 66 20 63 72 75 6e 63 |instead |of crunc|
|000026c0| 68 69 6e 67 5c 6e 5c 6e | 22 29 3b 0a 2f 2a 20 20 |hing\n\n|");./* |
|000026d0| 20 20 20 20 20 70 72 69 | 6e 74 66 28 22 5c 6e 50 | pri|ntf("\nP|
|000026e0| 6c 65 61 73 65 20 72 65 | 66 65 72 20 74 6f 20 74 |lease re|fer to t|
|000026f0| 68 65 20 70 72 6f 67 72 | 61 6d 20 64 6f 63 75 6d |he progr|am docum|
|00002700| 65 6e 74 61 74 69 6f 6e | 20 66 6f 72 22 29 3b 20 |entation| for"); |
|00002710| 20 20 20 20 20 20 20 20 | 20 2a 2f 0a 2f 2a 20 20 | | */./* |
|00002720| 20 20 20 20 20 70 72 69 | 6e 74 66 28 22 20 63 6f | pri|ntf(" co|
|00002730| 6d 70 6c 65 74 65 20 69 | 6e 73 74 72 75 63 74 69 |mplete i|nstructi|
|00002740| 6f 6e 73 2e 5c 6e 22 29 | 3b 20 20 20 20 20 20 20 |ons.\n")|; |
|00002750| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002760| 20 20 20 20 20 20 20 20 | 20 2a 2f 0a 20 20 20 20 | | */. |
|00002770| 20 20 20 20 20 72 65 74 | 75 72 6e 20 31 3b 0a 20 | ret|urn 1;. |
|00002780| 20 20 20 7d 0a 0a 20 20 | 20 20 2f 2a 20 73 65 65 | }.. | /* see|
|00002790| 20 77 68 65 72 65 20 74 | 65 6d 70 20 66 69 6c 65 | where t|emp file|
|000027a0| 73 20 67 6f 20 2a 2f 0a | 20 20 20 20 2f 2a 20 75 |s go */.| /* u|
|000027b0| 73 65 20 70 72 6f 63 65 | 73 73 20 69 64 20 74 6f |se proce|ss id to|
|000027c0| 20 22 65 6e 68 61 6e 63 | 65 20 75 6e 69 71 75 69 | "enhanc|e uniqui|
|000027d0| 74 79 22 20 6f 66 20 74 | 65 6d 70 20 66 69 6c 65 |ty" of t|emp file|
|000027e0| 6e 61 6d 65 73 20 2a 2f | 0a 20 20 20 20 2f 2a 20 |names */|. /* |
|000027f0| 28 61 76 6f 69 64 73 20 | 6d 75 6c 74 69 2d 75 73 |(avoids |multi-us|
|00002800| 65 72 20 6f 72 20 62 61 | 63 6b 67 72 6f 75 6e 64 |er or ba|ckground|
|00002810| 20 66 6f 6f 6c 69 73 68 | 6e 65 73 73 29 20 2a 2f | foolish|ness) */|
|00002820| 0a 0a 20 20 20 20 69 66 | 28 21 28 61 72 63 74 65 |.. if|(!(arcte|
|00002830| 6d 70 32 20 3d 20 65 6e | 76 66 69 6e 64 28 22 41 |mp2 = en|vfind("A|
|00002840| 52 43 54 45 4d 50 22 29 | 29 29 0a 20 20 20 20 20 |RCTEMP")|)). |
|00002850| 20 20 20 20 61 72 63 74 | 65 6d 70 32 20 3d 20 65 | arct|emp2 = e|
|00002860| 6e 76 66 69 6e 64 28 22 | 54 45 4d 50 22 29 3b 0a |nvfind("|TEMP");.|
|00002870| 20 20 20 20 69 66 20 28 | 61 72 63 74 65 6d 70 32 | if (|arctemp2|
|00002880| 29 20 73 70 72 69 6e 74 | 66 28 61 72 63 74 65 6d |) sprint|f(arctem|
|00002890| 70 2c 22 25 73 2e 41 72 | 63 25 6c 64 22 2c 61 72 |p,"%s.Ar|c%ld",ar|
|000028a0| 63 74 65 6d 70 32 2c 67 | 65 74 70 69 64 28 29 29 |ctemp2,g|etpid())|
|000028b0| 3b 0a 20 20 20 20 65 6c | 73 65 20 73 70 72 69 6e |;. el|se sprin|
|000028c0| 74 66 28 61 72 63 74 65 | 6d 70 2c 22 2e 41 72 63 |tf(arcte|mp,".Arc|
|000028d0| 25 6c 64 22 2c 67 65 74 | 70 69 64 28 29 29 3b 0a |%ld",get|pid());.|
|000028e0| 0a 23 69 66 20 4d 53 44 | 4f 53 20 0a 20 20 20 20 |.#if MSD|OS . |
|000028f0| 2f 2a 20 61 76 6f 69 64 | 20 61 6e 79 20 63 61 73 |/* avoid| any cas|
|00002900| 65 20 70 72 6f 62 6c 65 | 6d 73 20 77 69 74 68 20 |e proble|ms with |
|00002910| 61 72 67 75 6d 65 6e 74 | 73 20 2a 2f 0a 0a 20 20 |argument|s */.. |
|00002920| 20 20 66 6f 72 28 6e 3d | 31 3b 20 6e 3c 6e 75 6d | for(n=|1; n<num|
|00002930| 3b 20 6e 2b 2b 29 20 20 | 20 20 20 20 20 20 20 20 |; n++) | |
|00002940| 20 20 20 20 20 2f 2a 20 | 66 6f 72 20 65 61 63 68 | /* |for each|
|00002950| 20 61 72 67 75 6d 65 6e | 74 20 2a 2f 0a 20 20 20 | argumen|t */. |
|00002960| 20 20 20 20 20 20 75 70 | 70 65 72 28 61 72 67 5b | up|per(arg[|
|00002970| 6e 5d 29 3b 20 20 20 20 | 20 20 20 20 20 20 20 20 |n]); | |
|00002980| 20 20 20 20 2f 2a 20 63 | 6f 6e 76 65 72 74 20 69 | /* c|onvert i|
|00002990| 74 20 74 6f 20 75 70 70 | 65 72 63 61 73 65 20 2a |t to upp|ercase *|
|000029a0| 2f 0a 23 65 6e 64 69 66 | 0a 23 69 66 20 42 53 44 |/.#endif|.#if BSD|
|000029b0| 20 7c 20 53 54 0a 20 20 | 20 20 2f 2a 20 61 76 6f | | ST. | /* avo|
|000029c0| 69 64 20 61 6e 79 20 63 | 61 73 65 20 70 72 6f 62 |id any c|ase prob|
|000029d0| 6c 65 6d 73 20 77 69 74 | 68 20 63 6f 6d 6d 61 6e |lems wit|h comman|
|000029e0| 64 20 6f 70 74 69 6f 6e | 73 20 2a 2f 0a 0a 20 20 |d option|s */.. |
|000029f0| 20 20 20 20 20 20 20 75 | 70 70 65 72 28 61 72 67 | u|pper(arg|
|00002a00| 5b 31 5d 29 3b 20 20 20 | 20 20 20 20 20 20 20 20 |[1]); | |
|00002a10| 20 20 20 20 20 2f 2a 20 | 63 6f 6e 76 65 72 74 20 | /* |convert |
|00002a20| 69 74 20 74 6f 20 75 70 | 70 65 72 63 61 73 65 20 |it to up|percase |
|00002a30| 2a 2f 0a 23 65 6e 64 69 | 66 0a 0a 20 20 20 20 2f |*/.#endi|f.. /|
|00002a40| 2a 20 63 72 65 61 74 65 | 20 61 72 63 68 69 76 65 |* create| archive|
|00002a50| 20 6e 61 6d 65 73 2c 20 | 73 75 70 70 6c 79 69 6e | names, |supplyin|
|00002a60| 67 20 64 65 66 61 75 6c | 74 73 20 2a 2f 0a 0a 23 |g defaul|ts */..#|
|00002a70| 69 66 20 4d 53 44 4f 53 | 0a 20 20 20 20 6d 61 6b |if MSDOS|. mak|
|00002a80| 65 66 6e 61 6d 28 61 72 | 67 5b 32 5d 2c 22 2e 41 |efnam(ar|g[2],".A|
|00002a90| 52 43 22 2c 61 72 63 6e | 61 6d 65 29 3b 0a 23 65 |RC",arcn|ame);.#e|
|00002aa0| 6e 64 69 66 0a 23 69 66 | 20 42 53 44 20 7c 20 53 |ndif.#if| BSD | S|
|00002ab0| 54 0a 20 20 20 20 6d 61 | 6b 65 66 6e 61 6d 28 61 |T. ma|kefnam(a|
|00002ac0| 72 67 5b 32 5d 2c 22 2e | 61 72 63 22 2c 61 72 63 |rg[2],".|arc",arc|
|00002ad0| 6e 61 6d 65 29 3b 0a 23 | 65 6e 64 69 66 0a 2f 2a |name);.#|endif./*|
|00002ae0| 20 20 6d 61 6b 65 66 6e | 61 6d 28 22 2e 24 24 24 | makefn|am(".$$$|
|00002af0| 24 22 2c 61 72 63 6e 61 | 6d 65 2c 6e 65 77 6e 61 |$",arcna|me,newna|
|00002b00| 6d 65 29 3b 20 2a 2f 0a | 20 20 20 20 73 70 72 69 |me); */.| spri|
|00002b10| 6e 74 66 28 6e 65 77 6e | 61 6d 65 2c 22 25 73 2e |ntf(newn|ame,"%s.|
|00002b20| 41 52 43 22 2c 61 72 63 | 74 65 6d 70 29 3b 0a 20 |ARC",arc|temp);. |
|00002b30| 20 20 20 6d 61 6b 65 66 | 6e 61 6d 28 22 2e 42 41 | makef|nam(".BA|
|00002b40| 4b 22 2c 61 72 63 6e 61 | 6d 65 2c 62 61 6b 6e 61 |K",arcna|me,bakna|
|00002b50| 6d 65 29 3b 0a 0a 20 20 | 20 20 2f 2a 20 6e 6f 77 |me);.. | /* now|
|00002b60| 20 73 63 61 6e 20 74 68 | 65 20 63 6f 6d 6d 61 6e | scan th|e comman|
|00002b70| 64 20 61 6e 64 20 73 65 | 65 20 77 68 61 74 20 77 |d and se|e what w|
|00002b80| 65 20 61 72 65 20 74 6f | 20 64 6f 20 2a 2f 0a 0a |e are to| do */..|
|00002b90| 20 20 20 20 66 6f 72 28 | 61 3d 61 72 67 5b 31 5d | for(|a=arg[1]|
|00002ba0| 3b 20 2a 61 3b 20 61 2b | 2b 29 20 20 20 20 20 20 |; *a; a+|+) |
|00002bb0| 20 20 20 20 20 20 20 2f | 2a 20 73 63 61 6e 20 74 | /|* scan t|
|00002bc0| 68 65 20 6f 70 74 69 6f | 6e 20 66 6c 61 67 73 20 |he optio|n flags |
|00002bd0| 2a 2f 0a 20 20 20 20 7b | 20 20 20 20 69 66 28 69 |*/. {| if(i|
|00002be0| 6e 64 65 78 28 22 41 4d | 55 46 44 58 45 50 4c 56 |ndex("AM|UFDXEPLV|
|00002bf0| 54 43 52 22 2c 2a 61 29 | 29 20 2f 2a 20 69 66 20 |TCR",*a)|) /* if |
|00002c00| 61 20 6b 6e 6f 77 6e 20 | 63 6f 6d 6d 61 6e 64 20 |a known |command |
|00002c10| 2a 2f 0a 20 20 20 20 20 | 20 20 20 20 7b 20 20 20 |*/. | { |
|00002c20| 20 69 66 28 6f 70 74 29 | 20 20 20 20 20 20 20 20 | if(opt)| |
|00002c30| 20 20 20 20 20 20 20 20 | 20 20 2f 2a 20 64 6f 20 | | /* do |
|00002c40| 77 65 20 68 61 76 65 20 | 6f 6e 65 20 79 65 74 3f |we have |one yet?|
|00002c50| 20 2a 2f 0a 20 20 20 20 | 20 20 20 20 20 20 20 20 | */. | |
|00002c60| 20 20 20 20 20 20 20 61 | 62 6f 72 74 28 22 43 61 | a|bort("Ca|
|00002c70| 6e 6e 6f 74 20 6d 69 78 | 20 25 63 20 61 6e 64 20 |nnot mix| %c and |
|00002c80| 25 63 22 2c 6f 70 74 2c | 2a 61 29 3b 0a 20 20 20 |%c",opt,|*a);. |
|00002c90| 20 20 20 20 20 20 20 20 | 20 20 20 6f 70 74 20 3d | | opt =|
|00002ca0| 20 2a 61 3b 20 20 20 20 | 20 20 20 20 20 20 20 20 | *a; | |
|00002cb0| 20 20 20 20 2f 2a 20 65 | 6c 73 65 20 72 65 6d 65 | /* e|lse reme|
|00002cc0| 6d 62 65 72 20 69 74 20 | 2a 2f 0a 20 20 20 20 20 |mber it |*/. |
|00002cd0| 20 20 20 20 7d 0a 0a 20 | 20 20 20 20 20 20 20 20 | }.. | |
|00002ce0| 65 6c 73 65 20 69 66 28 | 2a 61 3d 3d 27 42 27 29 |else if(|*a=='B')|
|00002cf0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 2f 2a | | /*|
|00002d00| 20 72 65 74 61 69 6e 20 | 62 61 63 6b 75 70 20 63 | retain |backup c|
|00002d10| 6f 70 79 20 2a 2f 0a 20 | 20 20 20 20 20 20 20 20 |opy */. | |
|00002d20| 20 20 20 20 20 6b 65 65 | 70 62 61 6b 20 3d 20 31 | kee|pbak = 1|
|00002d30| 3b 0a 0a 20 20 20 20 20 | 20 20 20 20 65 6c 73 65 |;.. | else|
|00002d40| 20 69 66 28 2a 61 3d 3d | 27 57 27 29 20 20 20 20 | if(*a==|'W') |
|00002d50| 20 20 20 20 20 20 20 20 | 20 20 2f 2a 20 73 75 70 | | /* sup|
|00002d60| 70 72 65 73 73 20 77 61 | 72 6e 69 6e 67 73 20 2a |press wa|rnings *|
|00002d70| 2f 0a 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |/. | |
|00002d80| 77 61 72 6e 20 3d 20 30 | 3b 0a 0a 20 20 20 20 20 |warn = 0|;.. |
|00002d90| 20 20 20 20 65 6c 73 65 | 20 69 66 28 2a 61 3d 3d | else| if(*a==|
|00002da0| 27 4e 27 29 20 20 20 20 | 20 20 20 20 20 20 20 20 |'N') | |
|00002db0| 20 20 2f 2a 20 73 75 70 | 70 72 65 73 73 20 6e 6f | /* sup|press no|
|00002dc0| 74 65 73 20 61 6e 64 20 | 63 6f 6d 6d 65 6e 74 73 |tes and |comments|
|00002dd0| 20 2a 2f 0a 20 20 20 20 | 20 20 20 20 20 20 20 20 | */. | |
|00002de0| 20 20 6e 6f 74 65 20 3d | 20 30 3b 0a 0a 20 20 20 | note =| 0;.. |
|00002df0| 20 20 20 20 20 20 65 6c | 73 65 20 69 66 28 2a 61 | el|se if(*a|
|00002e00| 3d 3d 27 47 27 29 20 20 | 20 20 20 20 20 20 20 20 |=='G') | |
|00002e10| 20 20 20 20 2f 2a 20 67 | 61 72 62 6c 65 20 2a 2f | /* g|arble */|
|00002e20| 0a 20 20 20 20 20 20 20 | 20 20 7b 20 20 20 20 70 |. | { p|
|00002e30| 61 73 73 77 6f 72 64 20 | 3d 20 61 2b 31 3b 0a 20 |assword |= a+1;. |
|00002e40| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 77 68 69 | | whi|
|00002e50| 6c 65 28 2a 61 29 0a 20 | 20 20 20 20 20 20 20 20 |le(*a). | |
|00002e60| 20 20 20 20 20 20 20 20 | 20 20 61 2b 2b 3b 0a 20 | | a++;. |
|00002e70| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 61 2d 2d | | a--|
|00002e80| 3b 0a 20 20 20 20 20 20 | 20 20 20 7d 0a 0a 20 20 |;. | }.. |
|00002e90| 20 20 20 20 20 20 20 65 | 6c 73 65 20 69 66 28 2a | e|lse if(*|
|00002ea0| 61 3d 3d 27 53 27 29 20 | 20 20 20 20 20 20 20 20 |a=='S') | |
|00002eb0| 20 20 20 20 20 2f 2a 20 | 73 74 6f 72 61 67 65 20 | /* |storage |
|00002ec0| 6b 6c 75 64 67 65 20 2a | 2f 0a 20 20 20 20 20 20 |kludge *|/. |
|00002ed0| 20 20 20 20 20 20 20 20 | 6e 6f 63 6f 6d 70 20 3d | |nocomp =|
|00002ee0| 20 31 3b 0a 0a 20 20 20 | 20 20 20 20 20 20 65 6c | 1;.. | el|
|00002ef0| 73 65 20 69 66 28 2a 61 | 3d 3d 27 4b 27 29 20 20 |se if(*a|=='K') |
|00002f00| 20 20 20 20 20 20 20 20 | 20 20 20 20 2f 2a 20 73 | | /* s|
|00002f10| 70 65 63 69 61 6c 20 6b | 6c 75 64 67 65 20 2a 2f |pecial k|ludge */|
|00002f20| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 6b |. | k|
|00002f30| 6c 75 64 67 65 20 3d 20 | 31 3b 0a 0a 09 20 65 6c |ludge = |1;... el|
|00002f40| 73 65 20 69 66 28 2a 61 | 3d 3d 27 51 27 29 0a 09 |se if(*a|=='Q')..|
|00002f50| 20 20 20 20 20 20 64 6f | 73 71 75 61 73 68 20 3d | do|squash =|
|00002f60| 20 31 3b 0a 0a 20 20 20 | 20 20 20 20 20 20 65 6c | 1;.. | el|
|00002f70| 73 65 20 69 66 28 2a 61 | 3d 3d 27 2d 27 20 7c 7c |se if(*a|=='-' |||
|00002f80| 20 2a 61 3d 3d 27 2f 27 | 29 20 20 20 2f 2a 20 55 | *a=='/'|) /* U|
|00002f90| 4e 49 58 20 61 6e 64 20 | 50 43 2d 44 4f 53 20 6f |NIX and |PC-DOS o|
|00002fa0| 70 74 69 6f 6e 20 6d 61 | 72 6b 65 72 73 20 2a 2f |ption ma|rkers */|
|00002fb0| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 3b |. | ;|
|00002fc0| 0a 0a 20 20 20 20 20 20 | 20 20 20 65 6c 73 65 20 |.. | else |
|00002fd0| 61 62 6f 72 74 28 22 25 | 63 20 69 73 20 61 6e 20 |abort("%|c is an |
|00002fe0| 75 6e 6b 6e 6f 77 6e 20 | 63 6f 6d 6d 61 6e 64 22 |unknown |command"|
|00002ff0| 2c 2a 61 29 3b 0a 20 20 | 20 20 7d 0a 0a 20 20 20 |,*a);. | }.. |
|00003000| 20 69 66 28 21 6f 70 74 | 29 0a 20 20 20 20 20 20 | if(!opt|). |
|00003010| 20 20 20 61 62 6f 72 74 | 28 22 49 20 68 61 76 65 | abort|("I have|
|00003020| 20 6e 6f 74 68 69 6e 67 | 20 74 6f 20 64 6f 21 22 | nothing| to do!"|
|00003030| 29 3b 0a 0a 20 20 20 20 | 2f 2a 20 61 63 74 20 6f |);.. |/* act o|
|00003040| 6e 20 77 68 61 74 65 76 | 65 72 20 61 63 74 69 6f |n whatev|er actio|
|00003050| 6e 20 63 6f 6d 6d 61 6e | 64 20 77 61 73 20 67 69 |n comman|d was gi|
|00003060| 76 65 6e 20 2a 2f 0a 0a | 20 20 20 20 73 77 69 74 |ven */..| swit|
|00003070| 63 68 28 6f 70 74 29 20 | 20 20 20 20 20 20 20 20 |ch(opt) | |
|00003080| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 2f | | /|
|00003090| 2a 20 61 63 74 69 6f 6e | 20 64 65 70 65 6e 64 73 |* action| depends|
|000030a0| 20 6f 6e 20 63 6f 6d 6d | 61 6e 64 20 2a 2f 0a 20 | on comm|and */. |
|000030b0| 20 20 20 7b 0a 20 20 20 | 20 63 61 73 65 20 27 41 | {. | case 'A|
|000030c0| 27 3a 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |': | |
|000030d0| 20 20 20 20 20 20 20 20 | 20 20 20 20 2f 2a 20 41 | | /* A|
|000030e0| 64 64 20 2a 2f 0a 20 20 | 20 20 63 61 73 65 20 27 |dd */. | case '|
|000030f0| 4d 27 3a 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |M': | |
|00003100| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 2f 2a 20 | | /* |
|00003110| 4d 6f 76 65 20 2a 2f 0a | 20 20 20 20 63 61 73 65 |Move */.| case|
|00003120| 20 27 55 27 3a 20 20 20 | 20 20 20 20 20 20 20 20 | 'U': | |
|00003130| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 2f | | /|
|00003140| 2a 20 55 70 64 61 74 65 | 20 2a 2f 0a 20 20 20 20 |* Update| */. |
|00003150| 63 61 73 65 20 27 46 27 | 3a 20 20 20 20 20 20 20 |case 'F'|: |
|00003160| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003170| 20 20 20 2f 2a 20 46 72 | 65 73 68 65 6e 20 2a 2f | /* Fr|eshen */|
|00003180| 0a 20 20 20 20 20 20 20 | 20 20 61 64 64 61 72 63 |. | addarc|
|00003190| 28 6e 75 6d 2d 33 2c 26 | 61 72 67 5b 33 5d 2c 28 |(num-3,&|arg[3],(|
|000031a0| 6f 70 74 3d 3d 27 4d 27 | 29 2c 28 6f 70 74 3d 3d |opt=='M'|),(opt==|
|000031b0| 27 55 27 29 2c 28 6f 70 | 74 3d 3d 27 46 27 29 29 |'U'),(op|t=='F'))|
|000031c0| 3b 0a 20 20 20 20 20 20 | 20 20 20 62 72 65 61 6b |;. | break|
|000031d0| 3b 0a 0a 20 20 20 20 63 | 61 73 65 20 27 44 27 3a |;.. c|ase 'D':|
|000031e0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000031f0| 20 20 20 20 20 20 20 20 | 20 20 2f 2a 20 44 65 6c | | /* Del|
|00003200| 65 74 65 20 2a 2f 0a 20 | 20 20 20 20 20 20 20 20 |ete */. | |
|00003210| 64 65 6c 61 72 63 28 6e | 75 6d 2d 33 2c 26 61 72 |delarc(n|um-3,&ar|
|00003220| 67 5b 33 5d 29 3b 0a 20 | 20 20 20 20 20 20 20 20 |g[3]);. | |
|00003230| 62 72 65 61 6b 3b 0a 0a | 20 20 20 20 63 61 73 65 |break;..| case|
|00003240| 20 27 45 27 3a 20 20 20 | 20 20 20 20 20 20 20 20 | 'E': | |
|00003250| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 2f | | /|
|00003260| 2a 20 45 78 74 72 61 63 | 74 20 2a 2f 0a 20 20 20 |* Extrac|t */. |
|00003270| 20 63 61 73 65 20 27 58 | 27 3a 20 20 20 20 20 20 | case 'X|': |
|00003280| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003290| 20 20 20 20 2f 2a 20 65 | 58 74 72 61 63 74 20 2a | /* e|Xtract *|
|000032a0| 2f 0a 20 20 20 20 63 61 | 73 65 20 27 50 27 3a 20 |/. ca|se 'P': |
|000032b0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000032c0| 20 20 20 20 20 20 20 20 | 20 2f 2a 20 50 72 69 6e | | /* Prin|
|000032d0| 74 20 2a 2f 0a 20 20 20 | 20 20 20 20 20 20 65 78 |t */. | ex|
|000032e0| 74 61 72 63 28 6e 75 6d | 2d 33 2c 26 61 72 67 5b |tarc(num|-3,&arg[|
|000032f0| 33 5d 2c 28 6f 70 74 3d | 3d 27 50 27 29 29 3b 0a |3],(opt=|='P'));.|
|00003300| 20 20 20 20 20 20 20 20 | 20 62 72 65 61 6b 3b 0a | | break;.|
|00003310| 0a 20 20 20 20 63 61 73 | 65 20 27 56 27 3a 20 20 |. cas|e 'V': |
|00003320| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003330| 20 20 20 20 20 20 20 20 | 2f 2a 20 56 65 72 62 6f | |/* Verbo|
|00003340| 73 65 20 6c 69 73 74 20 | 2a 2f 0a 20 20 20 20 20 |se list |*/. |
|00003350| 20 20 20 20 62 6f 73 65 | 20 3d 20 31 3b 0a 20 20 | bose| = 1;. |
|00003360| 20 20 63 61 73 65 20 27 | 4c 27 3a 20 20 20 20 20 | case '|L': |
|00003370| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003380| 20 20 20 20 20 2f 2a 20 | 4c 69 73 74 20 2a 2f 0a | /* |List */.|
|00003390| 20 20 20 20 20 20 20 20 | 20 6c 73 74 61 72 63 28 | | lstarc(|
|000033a0| 6e 75 6d 2d 33 2c 26 61 | 72 67 5b 33 5d 29 3b 0a |num-3,&a|rg[3]);.|
|000033b0| 20 20 20 20 20 20 20 20 | 20 62 72 65 61 6b 3b 0a | | break;.|
|000033c0| 0a 20 20 20 20 63 61 73 | 65 20 27 54 27 3a 20 20 |. cas|e 'T': |
|000033d0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000033e0| 20 20 20 20 20 20 20 20 | 2f 2a 20 54 65 73 74 20 | |/* Test |
|000033f0| 2a 2f 0a 20 20 20 20 20 | 20 20 20 20 74 73 74 61 |*/. | tsta|
|00003400| 72 63 28 29 3b 0a 20 20 | 20 20 20 20 20 20 20 62 |rc();. | b|
|00003410| 72 65 61 6b 3b 0a 0a 20 | 20 20 20 63 61 73 65 20 |reak;.. | case |
|00003420| 27 43 27 3a 20 20 20 20 | 20 20 20 20 20 20 20 20 |'C': | |
|00003430| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 2f 2a | | /*|
|00003440| 20 43 6f 6e 76 65 72 74 | 20 2a 2f 0a 20 20 20 20 | Convert| */. |
|00003450| 20 20 20 20 20 63 76 74 | 61 72 63 28 6e 75 6d 2d | cvt|arc(num-|
|00003460| 33 2c 26 61 72 67 5b 33 | 5d 29 3b 0a 20 20 20 20 |3,&arg[3|]);. |
|00003470| 20 20 20 20 20 62 72 65 | 61 6b 3b 0a 0a 20 20 20 | bre|ak;.. |
|00003480| 20 63 61 73 65 20 27 52 | 27 3a 20 20 20 20 20 20 | case 'R|': |
|00003490| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000034a0| 20 20 20 20 2f 2a 20 52 | 75 6e 20 2a 2f 0a 20 20 | /* R|un */. |
|000034b0| 20 20 20 20 20 20 20 72 | 75 6e 61 72 63 28 6e 75 | r|unarc(nu|
|000034c0| 6d 2d 33 2c 26 61 72 67 | 5b 33 5d 29 3b 0a 20 20 |m-3,&arg|[3]);. |
|000034d0| 20 20 20 20 20 20 20 62 | 72 65 61 6b 3b 0a 0a 20 | b|reak;.. |
|000034e0| 20 20 20 64 65 66 61 75 | 6c 74 3a 0a 20 20 20 20 | defau|lt:. |
|000034f0| 20 20 20 20 20 61 62 6f | 72 74 28 22 49 20 64 6f | abo|rt("I do|
|00003500| 6e 27 74 20 6b 6e 6f 77 | 20 68 6f 77 20 74 6f 20 |n't know| how to |
|00003510| 64 6f 20 25 63 20 79 65 | 74 21 22 2c 6f 70 74 29 |do %c ye|t!",opt)|
|00003520| 3b 0a 20 20 20 20 7d 0a | 0a 20 20 20 20 72 65 74 |;. }.|. ret|
|00003530| 75 72 6e 20 6e 65 72 72 | 73 3b 0a 7d 0a 53 48 41 |urn nerr|s;.}.SHA|
|00003540| 52 5f 45 4f 46 0a 63 68 | 6d 6f 64 20 2b 78 20 27 |R_EOF.ch|mod +x '|
|00003550| 61 72 63 2e 63 27 0a 66 | 69 20 23 20 65 6e 64 20 |arc.c'.f|i # end |
|00003560| 6f 66 20 6f 76 65 72 77 | 72 69 74 69 6e 67 20 63 |of overw|riting c|
|00003570| 68 65 63 6b 0a 69 66 20 | 74 65 73 74 20 2d 66 20 |heck.if |test -f |
|00003580| 27 61 72 63 2e 68 27 0a | 74 68 65 6e 0a 09 65 63 |'arc.h'.|then..ec|
|00003590| 68 6f 20 73 68 61 72 3a | 20 77 69 6c 6c 20 6e 6f |ho shar:| will no|
|000035a0| 74 20 6f 76 65 72 2d 77 | 72 69 74 65 20 65 78 69 |t over-w|rite exi|
|000035b0| 73 74 69 6e 67 20 66 69 | 6c 65 20 22 27 61 72 63 |sting fi|le "'arc|
|000035c0| 2e 68 27 22 0a 65 6c 73 | 65 0a 63 61 74 20 3c 3c |.h'".els|e.cat <<|
|000035d0| 20 5c 53 48 41 52 5f 45 | 4f 46 20 3e 20 27 61 72 | \SHAR_E|OF > 'ar|
|000035e0| 63 2e 68 27 0a 2f 2a 0a | 20 2a 20 24 48 65 61 64 |c.h'./*.| * $Head|
|000035f0| 65 72 3a 20 61 72 63 2e | 68 2c 76 20 31 2e 32 20 |er: arc.|h,v 1.2 |
|00003600| 38 36 2f 30 37 2f 31 35 | 20 30 37 3a 35 32 3a 33 |86/07/15| 07:52:3|
|00003610| 34 20 74 75 72 6e 65 72 | 20 45 78 70 20 24 0a 20 |4 turner| Exp $. |
|00003620| 2a 2f 0a 0a 2f 2a 0a 20 | 2a 20 24 4c 6f 67 3a 09 |*/../*. |* $Log:.|
|00003630| 61 72 63 2e 68 2c 76 20 | 24 0a 20 2a 20 48 61 63 |arc.h,v |$. * Hac|
|00003640| 6b 2d 61 74 74 61 63 6b | 20 31 2e 33 20 20 38 36 |k-attack| 1.3 86|
|00003650| 2f 31 32 2f 32 30 20 20 | 30 31 3a 32 33 3a 34 35 |/12/20 |01:23:45|
|00003660| 20 20 77 69 6c 68 69 74 | 65 40 75 73 63 65 61 73 | wilhit|e@usceas|
|00003670| 74 2e 75 75 63 70 0a 20 | 2a 20 09 42 6c 75 64 67 |t.uucp. |* .Bludg|
|00003680| 65 6f 6e 65 64 20 69 6e | 74 6f 20 73 75 62 6d 69 |eoned in|to submi|
|00003690| 73 73 69 6f 6e 20 66 6f | 72 20 56 41 58 20 31 31 |ssion fo|r VAX 11|
|000036a0| 2f 37 38 30 20 42 53 44 | 34 2e 32 0a 20 2a 09 28 |/780 BSD|4.2. *.(|
|000036b0| 75 67 6c 79 20 63 6f 64 | 65 2c 20 62 75 74 20 66 |ugly cod|e, but f|
|000036c0| 65 77 65 72 20 63 6f 72 | 65 20 64 75 6d 70 73 29 |ewer cor|e dumps)|
|000036d0| 0a 20 2a 0a 20 2a 20 52 | 65 76 69 73 69 6f 6e 20 |. *. * R|evision |
|000036e0| 31 2e 32 20 20 38 36 2f | 30 37 2f 31 35 20 20 30 |1.2 86/|07/15 0|
|000036f0| 37 3a 35 32 3a 33 34 20 | 20 74 75 72 6e 65 72 0a |7:52:34 | turner.|
|00003700| 20 2a 20 0a 20 2a 20 52 | 65 76 69 73 69 6f 6e 20 | * . * R|evision |
|00003710| 31 2e 31 20 20 38 36 2f | 30 36 2f 32 36 20 20 31 |1.1 86/|06/26 1|
|00003720| 35 3a 30 31 3a 32 33 20 | 20 74 75 72 6e 65 72 0a |5:01:23 | turner.|
|00003730| 20 2a 20 69 6e 69 74 69 | 61 6c 20 76 65 72 73 69 | * initi|al versi|
|00003740| 6f 6e 0a 20 2a 20 0a 20 | 2a 2f 0a 0a 23 64 65 66 |on. * . |*/..#def|
|00003750| 69 6e 65 09 53 54 09 30 | 09 2f 2a 20 41 74 61 72 |ine.ST.0|./* Atar|
|00003760| 69 20 35 32 30 53 54 20 | 6f 72 20 31 30 34 30 20 |i 520ST |or 1040 |
|00003770| 09 09 20 2a 2f 0a 23 64 | 65 66 69 6e 65 20 42 53 |.. */.#d|efine BS|
|00003780| 44 09 31 09 2f 2a 20 42 | 53 44 34 2e 32 20 6f 6e |D.1./* B|SD4.2 on|
|00003790| 20 61 20 76 61 78 09 09 | 20 2a 2f 0a 23 64 65 66 | a vax..| */.#def|
|000037a0| 69 6e 65 20 4d 53 44 4f | 53 09 30 09 2f 2a 20 4d |ine MSDO|S.0./* M|
|000037b0| 53 44 4f 53 20 6f 6e 20 | 61 6e 20 49 42 4d 20 50 |SDOS on |an IBM P|
|000037c0| 43 20 6f 72 20 57 61 6e | 6e 61 62 65 20 2a 2f 0a |C or Wan|nabe */.|
|000037d0| 0a 23 69 66 20 53 54 0a | 23 64 65 66 69 6e 65 20 |.#if ST.|#define |
|000037e0| 45 58 54 45 52 4e 0a 23 | 64 65 66 69 6e 65 20 49 |EXTERN.#|define I|
|000037f0| 4e 54 20 73 68 6f 72 74 | 0a 23 65 6e 64 69 66 0a |NT short|.#endif.|
|00003800| 0a 23 69 66 20 42 53 44 | 0a 23 69 6e 63 6c 75 64 |.#if BSD|.#includ|
|00003810| 65 20 3c 63 74 79 70 65 | 2e 68 3e 09 2f 2a 20 66 |e <ctype|.h>./* f|
|00003820| 6f 72 20 69 73 75 70 70 | 65 72 20 65 74 63 2e 20 |or isupp|er etc. |
|00003830| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003840| 20 2a 2f 0a 23 64 65 66 | 69 6e 65 20 45 58 54 45 | */.#def|ine EXTE|
|00003850| 52 4e 0a 23 64 65 66 69 | 6e 65 20 49 4e 54 20 73 |RN.#defi|ne INT s|
|00003860| 68 6f 72 74 0a 23 64 65 | 66 69 6e 65 20 65 6e 76 |hort.#de|fine env|
|00003870| 66 69 6e 64 20 67 65 74 | 65 6e 76 0a 23 65 6e 64 |find get|env.#end|
|00003880| 69 66 0a 0a 23 69 66 20 | 4d 53 44 4f 53 0a 23 64 |if..#if |MSDOS.#d|
|00003890| 65 66 69 6e 65 20 45 58 | 54 45 52 4e 20 65 78 74 |efine EX|TERN ext|
|000038a0| 65 72 6e 0a 23 64 65 66 | 69 6e 65 20 49 4e 54 20 |ern.#def|ine INT |
|000038b0| 69 6e 74 0a 23 65 6e 64 | 69 66 0a 0a 2f 2a 0a 20 |int.#end|if../*. |
|000038c0| 2a 20 61 64 64 65 64 20 | 6d 61 63 72 6f 20 64 65 |* added |macro de|
|000038d0| 66 27 73 20 69 6e 20 43 | 20 66 6f 72 6d 61 74 20 |f's in C| format |
|000038e0| 36 2f 32 36 2f 38 36 20 | 6a 6d 74 20 0a 20 2a 2f |6/26/86 |jmt . */|
|000038f0| 0a 23 69 6e 63 6c 75 64 | 65 20 22 61 72 63 6d 2e |.#includ|e "arcm.|
|00003900| 68 22 0a 0a 2f 2a 20 20 | 41 52 43 20 2d 20 41 72 |h"../* |ARC - Ar|
|00003910| 63 68 69 76 65 20 75 74 | 69 6c 69 74 79 20 2d 20 |chive ut|ility - |
|00003920| 41 52 43 20 48 65 61 64 | 65 72 0a 0a 20 20 20 20 |ARC Head|er.. |
|00003930| 56 65 72 73 69 6f 6e 20 | 32 2e 31 34 2c 20 63 72 |Version |2.14, cr|
|00003940| 65 61 74 65 64 20 6f 6e | 20 30 32 2f 30 33 2f 38 |eated on| 02/03/8|
|00003950| 36 20 61 74 20 32 32 3a | 34 38 3a 32 39 0a 0a 28 |6 at 22:|48:29..(|
|00003960| 43 29 20 43 4f 50 59 52 | 49 47 48 54 20 31 39 38 |C) COPYR|IGHT 198|
|00003970| 35 20 62 79 20 53 79 73 | 74 65 6d 20 45 6e 68 61 |5 by Sys|tem Enha|
|00003980| 6e 63 65 6d 65 6e 74 20 | 41 73 73 6f 63 69 61 74 |ncement |Associat|
|00003990| 65 73 3b 20 41 4c 4c 20 | 52 49 47 48 54 53 20 52 |es; ALL |RIGHTS R|
|000039a0| 45 53 45 52 56 45 44 0a | 0a 20 20 20 20 42 79 3a |ESERVED.|. By:|
|000039b0| 20 20 54 68 6f 6d 20 48 | 65 6e 64 65 72 73 6f 6e | Thom H|enderson|
|000039c0| 0a 0a 20 20 20 20 44 65 | 73 63 72 69 70 74 69 6f |.. De|scriptio|
|000039d0| 6e 3a 20 0a 20 20 20 20 | 20 20 20 20 20 54 68 69 |n: . | Thi|
|000039e0| 73 20 69 73 20 74 68 65 | 20 68 65 61 64 65 72 20 |s is the| header |
|000039f0| 66 69 6c 65 20 66 6f 72 | 20 74 68 65 20 41 52 43 |file for| the ARC|
|00003a00| 20 61 72 63 68 69 76 65 | 20 75 74 69 6c 69 74 79 | archive| utility|
|00003a10| 2e 20 20 49 74 20 64 65 | 66 69 6e 65 73 0a 20 20 |. It de|fines. |
|00003a20| 20 20 20 20 20 20 20 67 | 6c 6f 62 61 6c 20 70 61 | g|lobal pa|
|00003a30| 72 61 6d 65 74 65 72 73 | 20 61 6e 64 20 74 68 65 |rameters| and the|
|00003a40| 20 72 65 66 65 72 65 6e | 63 65 73 20 74 6f 20 74 | referen|ces to t|
|00003a50| 68 65 20 65 78 74 65 72 | 6e 61 6c 20 64 61 74 61 |he exter|nal data|
|00003a60| 2e 0a 0a 20 20 20 20 4c | 61 6e 67 75 61 67 65 3a |... L|anguage:|
|00003a70| 0a 20 20 20 20 20 20 20 | 20 20 43 6f 6d 70 75 74 |. | Comput|
|00003a80| 65 72 20 49 6e 6e 6f 76 | 61 74 69 6f 6e 73 20 4f |er Innov|ations O|
|00003a90| 70 74 69 6d 69 7a 69 6e | 67 20 43 38 36 0a 20 2a |ptimizin|g C86. *|
|00003aa0| 2f 0a 0a 23 69 6e 63 6c | 75 64 65 20 22 61 72 63 |/..#incl|ude "arc|
|00003ab0| 73 2e 68 22 0a 0a 45 58 | 54 45 52 4e 20 49 4e 54 |s.h"..EX|TERN INT|
|00003ac0| 20 6b 65 65 70 62 61 6b | 3b 20 20 20 20 20 20 20 | keepbak|; |
|00003ad0| 20 20 20 20 20 20 2f 2a | 20 74 72 75 65 20 69 66 | /*| true if|
|00003ae0| 20 73 61 76 69 6e 67 20 | 74 68 65 20 6f 6c 64 20 | saving |the old |
|00003af0| 61 72 63 68 69 76 65 20 | 2a 2f 0a 45 58 54 45 52 |archive |*/.EXTER|
|00003b00| 4e 20 49 4e 54 20 77 61 | 72 6e 3b 20 20 20 20 20 |N INT wa|rn; |
|00003b10| 20 20 20 20 20 20 20 20 | 20 20 20 2f 2a 20 74 72 | | /* tr|
|00003b20| 75 65 20 74 6f 20 70 72 | 69 6e 74 20 77 61 72 6e |ue to pr|int warn|
|00003b30| 69 6e 67 73 20 2a 2f 0a | 45 58 54 45 52 4e 20 49 |ings */.|EXTERN I|
|00003b40| 4e 54 20 6e 6f 74 65 3b | 20 20 20 20 20 20 20 20 |NT note;| |
|00003b50| 20 20 20 20 20 20 20 20 | 2f 2a 20 74 72 75 65 20 | |/* true |
|00003b60| 74 6f 20 70 72 69 6e 74 | 20 63 6f 6d 6d 65 6e 74 |to print| comment|
|00003b70| 73 20 2a 2f 0a 45 58 54 | 45 52 4e 20 49 4e 54 20 |s */.EXT|ERN INT |
|00003b80| 62 6f 73 65 3b 20 20 20 | 20 20 20 20 20 20 20 20 |bose; | |
|00003b90| 20 20 20 20 20 2f 2a 20 | 74 72 75 65 20 74 6f 20 | /* |true to |
|00003ba0| 62 65 20 76 65 72 62 6f | 73 65 20 2a 2f 0a 45 58 |be verbo|se */.EX|
|00003bb0| 54 45 52 4e 20 49 4e 54 | 20 6e 6f 63 6f 6d 70 3b |TERN INT| nocomp;|
|00003bc0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 2f 2a | | /*|
|00003bd0| 20 74 72 75 65 20 74 6f | 20 73 75 70 70 72 65 73 | true to| suppres|
|00003be0| 73 20 63 6f 6d 70 72 65 | 73 73 69 6f 6e 20 2a 2f |s compre|ssion */|
|00003bf0| 0a 45 58 54 45 52 4e 20 | 49 4e 54 20 6b 6c 75 64 |.EXTERN |INT klud|
|00003c00| 67 65 3b 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |ge; | |
|00003c10| 20 2f 2a 20 6b 6c 75 64 | 67 65 20 66 6c 61 67 20 | /* klud|ge flag |
|00003c20| 2a 2f 0a 45 58 54 45 52 | 4e 20 63 68 61 72 20 61 |*/.EXTER|N char a|
|00003c30| 72 63 74 65 6d 70 5b 53 | 54 52 4c 45 4e 5d 3b 20 |rctemp[S|TRLEN]; |
|00003c40| 20 20 20 20 20 20 2f 2a | 20 61 72 63 20 74 65 6d | /*| arc tem|
|00003c50| 70 20 66 69 6c 65 20 70 | 72 65 66 69 78 20 2a 2f |p file p|refix */|
|00003c60| 0a 45 58 54 45 52 4e 20 | 63 68 61 72 20 2a 70 61 |.EXTERN |char *pa|
|00003c70| 73 73 77 6f 72 64 3b 20 | 20 20 20 20 20 20 20 20 |ssword; | |
|00003c80| 20 2f 2a 20 65 6e 63 72 | 79 70 74 69 6f 6e 20 70 | /* encr|yption p|
|00003c90| 61 73 73 77 6f 72 64 20 | 70 6f 69 6e 74 65 72 20 |assword |pointer |
|00003ca0| 2a 2f 0a 45 58 54 45 52 | 4e 20 49 4e 54 20 6e 65 |*/.EXTER|N INT ne|
|00003cb0| 72 72 73 3b 20 20 20 20 | 20 20 20 20 20 20 20 20 |rrs; | |
|00003cc0| 20 20 20 2f 2a 20 6e 75 | 6d 62 65 72 20 6f 66 20 | /* nu|mber of |
|00003cd0| 65 72 72 6f 72 73 20 65 | 6e 63 6f 75 6e 74 65 72 |errors e|ncounter|
|00003ce0| 65 64 20 2a 2f 0a 0a 45 | 58 54 45 52 4e 20 63 68 |ed */..E|XTERN ch|
|00003cf0| 61 72 20 68 64 72 76 65 | 72 3b 20 20 20 20 20 20 |ar hdrve|r; |
|00003d00| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003d10| 2f 2a 20 68 65 61 64 65 | 72 20 76 65 72 73 69 6f |/* heade|r versio|
|00003d20| 6e 20 2a 2f 0a 0a 45 58 | 54 45 52 4e 20 46 49 4c |n */..EX|TERN FIL|
|00003d30| 45 20 2a 61 72 63 3b 20 | 20 20 20 20 20 20 20 20 |E *arc; | |
|00003d40| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 2f | | /|
|00003d50| 2a 20 74 68 65 20 6f 6c | 64 20 61 72 63 68 69 76 |* the ol|d archiv|
|00003d60| 65 20 2a 2f 0a 45 58 54 | 45 52 4e 20 46 49 4c 45 |e */.EXT|ERN FILE|
|00003d70| 20 2a 6e 65 77 3b 20 20 | 20 20 20 20 20 20 20 20 | *new; | |
|00003d80| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 2f 2a | | /*|
|00003d90| 20 74 68 65 20 6e 65 77 | 20 61 72 63 68 69 76 65 | the new| archive|
|00003da0| 20 2a 2f 0a 0a 45 58 54 | 45 52 4e 20 63 68 61 72 | */..EXT|ERN char|
|00003db0| 20 61 72 63 6e 61 6d 65 | 5b 53 54 52 4c 45 4e 5d | arcname|[STRLEN]|
|00003dc0| 3b 20 20 20 20 20 20 20 | 20 20 20 20 2f 2a 20 73 |; | /* s|
|00003dd0| 74 6f 72 61 67 65 20 66 | 6f 72 20 61 72 63 68 69 |torage f|or archi|
|00003de0| 76 65 20 6e 61 6d 65 20 | 2a 2f 0a 45 58 54 45 52 |ve name |*/.EXTER|
|00003df0| 4e 20 63 68 61 72 20 62 | 61 6b 6e 61 6d 65 5b 53 |N char b|akname[S|
|00003e00| 54 52 4c 45 4e 5d 3b 20 | 20 20 20 20 20 20 20 20 |TRLEN]; | |
|00003e10| 20 20 2f 2a 20 73 74 6f | 72 61 67 65 20 66 6f 72 | /* sto|rage for|
|00003e20| 20 62 61 63 6b 75 70 20 | 63 6f 70 79 20 6e 61 6d | backup |copy nam|
|00003e30| 65 20 2a 2f 0a 45 58 54 | 45 52 4e 20 63 68 61 72 |e */.EXT|ERN char|
|00003e40| 20 6e 65 77 6e 61 6d 65 | 5b 53 54 52 4c 45 4e 5d | newname|[STRLEN]|
|00003e50| 3b 20 20 20 20 20 20 20 | 20 20 20 20 2f 2a 20 73 |; | /* s|
|00003e60| 74 6f 72 61 67 65 20 66 | 6f 72 20 6e 65 77 20 61 |torage f|or new a|
|00003e70| 72 63 68 69 76 65 20 6e | 61 6d 65 20 2a 2f 0a 45 |rchive n|ame */.E|
|00003e80| 58 54 45 52 4e 20 75 6e | 73 69 67 6e 65 64 20 49 |XTERN un|signed I|
|00003e90| 4e 54 20 61 72 63 64 61 | 74 65 3b 20 20 20 20 2f |NT arcda|te; /|
|00003ea0| 2a 20 61 72 63 68 69 76 | 65 20 64 61 74 65 20 73 |* archiv|e date s|
|00003eb0| 74 61 6d 70 20 2a 2f 0a | 45 58 54 45 52 4e 20 75 |tamp */.|EXTERN u|
|00003ec0| 6e 73 69 67 6e 65 64 20 | 49 4e 54 20 61 72 63 74 |nsigned |INT arct|
|00003ed0| 69 6d 65 3b 20 20 20 20 | 2f 2a 20 61 72 63 68 69 |ime; |/* archi|
|00003ee0| 76 65 20 74 69 6d 65 20 | 73 74 61 6d 70 20 2a 2f |ve time |stamp */|
|00003ef0| 0a 45 58 54 45 52 4e 20 | 69 6e 74 20 64 6f 73 71 |.EXTERN |int dosq|
|00003f00| 75 61 73 68 3b 0a 53 48 | 41 52 5f 45 4f 46 0a 63 |uash;.SH|AR_EOF.c|
|00003f10| 68 6d 6f 64 20 2b 78 20 | 27 61 72 63 2e 68 27 0a |hmod +x |'arc.h'.|
|00003f20| 66 69 20 23 20 65 6e 64 | 20 6f 66 20 6f 76 65 72 |fi # end| of over|
|00003f30| 77 72 69 74 69 6e 67 20 | 63 68 65 63 6b 0a 69 66 |writing |check.if|
|00003f40| 20 74 65 73 74 20 2d 66 | 20 27 61 72 63 61 64 64 | test -f| 'arcadd|
|00003f50| 2e 63 27 0a 74 68 65 6e | 0a 09 65 63 68 6f 20 73 |.c'.then|..echo s|
|00003f60| 68 61 72 3a 20 77 69 6c | 6c 20 6e 6f 74 20 6f 76 |har: wil|l not ov|
|00003f70| 65 72 2d 77 72 69 74 65 | 20 65 78 69 73 74 69 6e |er-write| existin|
|00003f80| 67 20 66 69 6c 65 20 22 | 27 61 72 63 61 64 64 2e |g file "|'arcadd.|
|00003f90| 63 27 22 0a 65 6c 73 65 | 0a 63 61 74 20 3c 3c 20 |c'".else|.cat << |
|00003fa0| 5c 53 48 41 52 5f 45 4f | 46 20 3e 20 27 61 72 63 |\SHAR_EO|F > 'arc|
|00003fb0| 61 64 64 2e 63 27 0a 73 | 74 61 74 69 63 20 63 68 |add.c'.s|tatic ch|
|00003fc0| 61 72 20 2a 52 43 53 69 | 64 20 3d 20 22 24 48 65 |ar *RCSi|d = "$He|
|00003fd0| 61 64 65 72 3a 20 61 72 | 63 61 64 64 2e 63 2c 76 |ader: ar|cadd.c,v|
|00003fe0| 20 31 2e 32 20 38 36 2f | 30 37 2f 31 35 20 30 37 | 1.2 86/|07/15 07|
|00003ff0| 3a 35 32 3a 33 37 20 74 | 75 72 6e 65 72 20 45 78 |:52:37 t|urner Ex|
|00004000| 70 20 24 22 3b 0a 0a 2f | 2a 0a 20 2a 20 24 4c 6f |p $";../|*. * $Lo|
|00004010| 67 3a 09 61 72 63 61 64 | 64 2e 63 2c 76 20 24 0a |g:.arcad|d.c,v $.|
|00004020| 20 2a 20 48 61 63 6b 2d | 61 74 74 61 63 6b 20 31 | * Hack-|attack 1|
|00004030| 2e 33 20 20 38 36 2f 31 | 32 2f 32 30 20 20 30 31 |.3 86/1|2/20 01|
|00004040| 3a 32 33 3a 34 35 20 20 | 77 69 6c 68 69 74 65 40 |:23:45 |wilhite@|
|00004050| 75 73 63 65 61 73 74 2e | 75 75 63 70 0a 20 2a 20 |usceast.|uucp. * |
|00004060| 09 42 6c 75 64 67 65 6f | 6e 65 64 20 69 6e 74 6f |.Bludgeo|ned into|
|00004070| 20 73 75 62 6d 69 73 73 | 69 6f 6e 20 66 6f 72 20 | submiss|ion for |
|00004080| 56 41 58 20 31 31 2f 37 | 38 30 20 42 53 44 34 2e |VAX 11/7|80 BSD4.|
|00004090| 32 0a 20 2a 09 28 75 67 | 6c 79 20 63 6f 64 65 2c |2. *.(ug|ly code,|
|000040a0| 20 62 75 74 20 66 65 77 | 65 72 20 63 6f 72 65 20 | but few|er core |
|000040b0| 64 75 6d 70 73 29 0a 20 | 2a 0a 20 2a 20 52 65 76 |dumps). |*. * Rev|
|000040c0| 69 73 69 6f 6e 20 31 2e | 32 20 20 38 36 2f 30 37 |ision 1.|2 86/07|
|000040d0| 2f 31 35 20 20 30 37 3a | 35 32 3a 33 37 20 20 74 |/15 07:|52:37 t|
|000040e0| 75 72 6e 65 72 0a 20 2a | 20 0a 20 2a 20 52 65 76 |urner. *| . * Rev|
|000040f0| 69 73 69 6f 6e 20 31 2e | 31 20 20 38 36 2f 30 36 |ision 1.|1 86/06|
|00004100| 2f 32 36 20 20 31 34 3a | 35 39 3a 33 37 20 20 74 |/26 14:|59:37 t|
|00004110| 75 72 6e 65 72 0a 20 2a | 20 69 6e 69 74 69 61 6c |urner. *| initial|
|00004120| 20 76 65 72 73 69 6f 6e | 0a 20 2a 20 0a 20 2a 2f | version|. * . */|
|00004130| 0a 0a 2f 2a 20 20 41 52 | 43 20 2d 20 41 72 63 68 |../* AR|C - Arch|
|00004140| 69 76 65 20 75 74 69 6c | 69 74 79 20 2d 20 41 52 |ive util|ity - AR|
|00004150| 43 41 44 44 0a 0a 24 64 | 65 66 69 6e 65 28 74 61 |CADD..$d|efine(ta|
|00004160| 67 2c 24 24 73 65 67 6d | 65 6e 74 28 40 31 2c 24 |g,$$segm|ent(@1,$|
|00004170| 24 69 6e 64 65 78 28 40 | 31 2c 3d 29 2b 31 29 29 |$index(@|1,=)+1))|
|00004180| 23 0a 24 64 65 66 69 6e | 65 28 76 65 72 73 69 6f |#.$defin|e(versio|
|00004190| 6e 2c 56 65 72 73 69 6f | 6e 20 24 74 61 67 28 0a |n,Versio|n $tag(.|
|000041a0| 54 45 44 5f 56 45 52 53 | 49 4f 4e 20 44 42 20 3d |TED_VERS|ION DB =|
|000041b0| 33 2e 33 39 29 2c 20 63 | 72 65 61 74 65 64 20 6f |3.39), c|reated o|
|000041c0| 6e 20 24 74 61 67 28 0a | 54 45 44 5f 44 41 54 45 |n $tag(.|TED_DATE|
|000041d0| 20 44 42 20 3d 30 32 2f | 30 35 2f 38 36 29 20 61 | DB =02/|05/86) a|
|000041e0| 74 20 24 74 61 67 28 0a | 54 45 44 5f 54 49 4d 45 |t $tag(.|TED_TIME|
|000041f0| 20 44 42 20 3d 32 32 3a | 32 31 3a 35 33 29 29 23 | DB =22:|21:53))#|
|00004200| 0a 24 75 6e 64 65 66 69 | 6e 65 28 74 61 67 29 23 |.$undefi|ne(tag)#|
|00004210| 0a 20 20 20 20 24 76 65 | 72 73 69 6f 6e 0a 0a 28 |. $ve|rsion..(|
|00004220| 43 29 20 43 4f 50 59 52 | 49 47 48 54 20 31 39 38 |C) COPYR|IGHT 198|
|00004230| 35 20 62 79 20 53 79 73 | 74 65 6d 20 45 6e 68 61 |5 by Sys|tem Enha|
|00004240| 6e 63 65 6d 65 6e 74 20 | 41 73 73 6f 63 69 61 74 |ncement |Associat|
|00004250| 65 73 3b 20 41 4c 4c 20 | 52 49 47 48 54 53 20 52 |es; ALL |RIGHTS R|
|00004260| 45 53 45 52 56 45 44 0a | 0a 20 20 20 20 42 79 3a |ESERVED.|. By:|
|00004270| 20 20 54 68 6f 6d 20 48 | 65 6e 64 65 72 73 6f 6e | Thom H|enderson|
|00004280| 0a 0a 20 20 20 20 44 65 | 73 63 72 69 70 74 69 6f |.. De|scriptio|
|00004290| 6e 3a 0a 20 20 20 20 20 | 20 20 20 20 54 68 69 73 |n:. | This|
|000042a0| 20 66 69 6c 65 20 63 6f | 6e 74 61 69 6e 73 20 74 | file co|ntains t|
|000042b0| 68 65 20 72 6f 75 74 69 | 6e 65 73 20 75 73 65 64 |he routi|nes used|
|000042c0| 20 74 6f 20 61 64 64 20 | 66 69 6c 65 73 20 74 6f | to add |files to|
|000042d0| 20 61 6e 20 61 72 63 68 | 69 76 65 2e 0a 0a 20 20 | an arch|ive... |
|000042e0| 20 20 4c 61 6e 67 75 61 | 67 65 3a 0a 20 20 20 20 | Langua|ge:. |
|000042f0| 20 20 20 20 20 43 6f 6d | 70 75 74 65 72 20 49 6e | Com|puter In|
|00004300| 6e 6f 76 61 74 69 6f 6e | 73 20 4f 70 74 69 6d 69 |novation|s Optimi|
|00004310| 7a 69 6e 67 20 43 38 36 | 0a 2a 2f 0a 23 69 6e 63 |zing C86|.*/.#inc|
|00004320| 6c 75 64 65 20 3c 73 74 | 64 69 6f 2e 68 3e 0a 23 |lude <st|dio.h>.#|
|00004330| 69 6e 63 6c 75 64 65 20 | 22 61 72 63 2e 68 22 0a |include |"arc.h".|
|00004340| 0a 49 4e 54 20 61 64 64 | 61 72 63 28 6e 75 6d 2c |.INT add|arc(num,|
|00004350| 61 72 67 2c 6d 6f 76 65 | 2c 75 70 64 61 74 65 2c |arg,move|,update,|
|00004360| 66 72 65 73 68 29 20 20 | 20 20 20 20 2f 2a 20 61 |fresh) | /* a|
|00004370| 64 64 20 66 69 6c 65 73 | 20 74 6f 20 61 72 63 68 |dd files| to arch|
|00004380| 69 76 65 20 2a 2f 0a 49 | 4e 54 20 6e 75 6d 3b 20 |ive */.I|NT num; |
|00004390| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000043a0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 2f 2a | | /*|
|000043b0| 20 6e 75 6d 62 65 72 20 | 6f 66 20 61 72 67 75 6d | number |of argum|
|000043c0| 65 6e 74 73 20 2a 2f 0a | 63 68 61 72 20 2a 61 72 |ents */.|char *ar|
|000043d0| 67 5b 5d 3b 20 20 20 20 | 20 20 20 20 20 20 20 20 |g[]; | |
|000043e0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 2f | | /|
|000043f0| 2a 20 70 6f 69 6e 74 65 | 72 73 20 74 6f 20 61 72 |* pointe|rs to ar|
|00004400| 67 75 6d 65 6e 74 73 20 | 2a 2f 0a 49 4e 54 20 6d |guments |*/.INT m|
|00004410| 6f 76 65 3b 20 20 20 20 | 20 20 20 20 20 20 20 20 |ove; | |
|00004420| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00004430| 20 20 2f 2a 20 74 72 75 | 65 20 69 66 20 6d 6f 76 | /* tru|e if mov|
|00004440| 69 6e 67 20 66 69 6c 65 | 20 2a 2f 0a 49 4e 54 20 |ing file| */.INT |
|00004450| 75 70 64 61 74 65 3b 20 | 20 20 20 20 20 20 20 20 |update; | |
|00004460| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00004470| 20 20 20 2f 2a 20 74 72 | 75 65 20 69 66 20 75 70 | /* tr|ue if up|
|00004480| 64 61 74 69 6e 67 20 2a | 2f 0a 49 4e 54 20 66 72 |dating *|/.INT fr|
|00004490| 65 73 68 3b 20 20 20 20 | 20 20 20 20 20 20 20 20 |esh; | |
|000044a0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000044b0| 20 2f 2a 20 74 72 75 65 | 20 69 66 20 66 72 65 73 | /* true| if fres|
|000044c0| 68 65 6e 69 6e 67 20 2a | 2f 0a 7b 0a 20 20 20 20 |hening *|/.{. |
|000044d0| 63 68 61 72 20 2a 64 2c | 20 2a 64 69 72 28 29 3b |char *d,| *dir();|
|000044e0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000044f0| 20 20 20 2f 2a 20 64 69 | 72 65 63 74 6f 72 79 20 | /* di|rectory |
|00004500| 6a 75 6e 6b 20 2a 2f 0a | 20 20 20 20 63 68 61 72 |junk */.| char|
|00004510| 20 2a 4e 61 6d 65 4c 69 | 73 74 3b 09 2f 2a 20 41 | *NameLi|st;./* A|
|00004520| 6e 79 20 70 6f 69 6e 74 | 65 72 2e 20 20 55 73 65 |ny point|er. Use|
|00004530| 64 20 74 6f 20 70 61 73 | 73 20 66 69 6c 65 20 6e |d to pas|s file n|
|00004540| 61 6d 65 73 20 61 72 6f | 75 6e 64 20 2a 2f 0a 20 |ames aro|und */. |
|00004550| 20 20 20 63 68 61 72 20 | 62 75 66 5b 53 54 52 4c | char |buf[STRL|
|00004560| 45 4e 5d 3b 20 20 20 20 | 20 20 20 20 20 20 20 20 |EN]; | |
|00004570| 20 20 20 20 20 2f 2a 20 | 70 61 74 68 6e 61 6d 65 | /* |pathname|
|00004580| 20 62 75 66 66 65 72 20 | 2a 2f 0a 20 20 20 20 63 | buffer |*/. c|
|00004590| 68 61 72 20 2a 2a 70 61 | 74 68 20 3d 20 4e 55 4c |har **pa|th = NUL|
|000045a0| 4c 3b 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |L; | |
|000045b0| 20 20 2f 2a 20 70 6f 69 | 6e 74 65 72 20 74 6f 20 | /* poi|nter to |
|000045c0| 70 6f 69 6e 74 65 72 73 | 20 74 6f 20 70 61 74 68 |pointers| to path|
|000045d0| 73 20 2a 2f 0a 20 20 20 | 20 63 68 61 72 20 2a 2a |s */. | char **|
|000045e0| 6e 61 6d 65 20 3d 20 4e | 55 4c 4c 3b 20 20 20 20 |name = N|ULL; |
|000045f0| 20 20 20 20 20 20 20 20 | 20 20 20 20 2f 2a 20 70 | | /* p|
|00004600| 6f 69 6e 74 65 72 20 74 | 6f 20 70 6f 69 6e 74 65 |ointer t|o pointe|
|00004610| 72 73 20 74 6f 20 6e 61 | 6d 65 73 20 2a 2f 0a 20 |rs to na|mes */. |
|00004620| 49 4e 54 20 6e 66 69 6c | 65 73 20 3d 20 30 3b 20 |INT nfil|es = 0; |
|00004630| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00004640| 20 20 20 2f 2a 20 6e 75 | 6d 62 65 72 20 6f 66 20 | /* nu|mber of |
|00004650| 66 69 6c 65 73 20 69 6e | 20 6c 69 73 74 73 20 2a |files in| lists *|
|00004660| 2f 0a 20 49 4e 54 20 6e | 6f 74 65 6d 70 3b 20 20 |/. INT n|otemp; |
|00004670| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00004680| 20 20 20 20 20 20 2f 2a | 20 74 72 75 65 20 75 6e | /*| true un|
|00004690| 74 69 6c 20 61 20 74 65 | 6d 70 6c 61 74 65 20 77 |til a te|mplate w|
|000046a0| 6f 72 6b 73 20 2a 2f 0a | 20 49 4e 54 20 6e 6f 77 |orks */.| INT now|
|000046b0| 6f 72 6b 20 3d 20 31 3b | 20 20 20 20 20 20 20 20 |ork = 1;| |
|000046c0| 20 20 20 20 20 20 20 20 | 20 20 20 20 2f 2a 20 74 | | /* t|
|000046d0| 72 75 65 20 75 6e 74 69 | 6c 20 66 69 6c 65 73 20 |rue unti|l files |
|000046e0| 61 72 65 20 61 64 64 65 | 64 20 2a 2f 0a 20 20 20 |are adde|d */. |
|000046f0| 20 63 68 61 72 20 2a 69 | 2c 20 2a 72 69 6e 64 65 | char *i|, *rinde|
|00004700| 78 28 29 3b 20 20 20 20 | 20 20 20 20 20 20 20 20 |x(); | |
|00004710| 20 20 20 20 2f 2a 20 73 | 74 72 69 6e 67 20 69 6e | /* s|tring in|
|00004720| 64 65 78 69 6e 67 20 6a | 75 6e 6b 20 2a 2f 0a 20 |dexing j|unk */. |
|00004730| 20 20 20 63 68 61 72 20 | 2a 6d 61 6c 6c 6f 63 28 | char |*malloc(|
|00004740| 29 2c 20 2a 72 65 61 6c | 6c 6f 63 28 29 3b 20 20 |), *real|loc(); |
|00004750| 20 20 20 20 20 20 20 2f | 2a 20 6d 65 6d 6f 72 79 | /|* memory|
|00004760| 20 61 6c 6c 6f 63 61 74 | 6f 72 73 20 2a 2f 0a 20 | allocat|ors */. |
|00004770| 49 4e 54 20 6d 2c 20 6e | 3b 20 20 20 20 20 20 20 |INT m, n|; |
|00004780| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00004790| 20 20 20 2f 2a 20 69 6e | 64 69 63 65 73 20 2a 2f | /* in|dices */|
|000047a0| 0a 20 20 20 20 75 6e 73 | 69 67 6e 65 64 20 49 4e |. uns|igned IN|
|000047b0| 54 20 63 6f 72 65 6c 65 | 66 74 28 29 3b 20 20 20 |T corele|ft(); |
|000047c0| 20 20 20 20 20 20 20 20 | 2f 2a 20 72 65 6d 61 69 | |/* remai|
|000047d0| 6e 69 6e 67 20 6d 65 6d | 6f 72 79 20 72 65 70 6f |ning mem|ory repo|
|000047e0| 72 74 65 72 20 2a 2f 0a | 20 20 20 20 49 4e 54 20 |rter */.| INT |
|000047f0| 61 64 64 62 75 6e 63 68 | 28 29 3b 0a 0a 20 20 20 |addbunch|();.. |
|00004800| 20 69 66 28 6e 75 6d 3c | 31 29 20 20 20 20 20 20 | if(num<|1) |
|00004810| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00004820| 20 20 20 20 2f 2a 20 69 | 66 20 6e 6f 20 66 69 6c | /* i|f no fil|
|00004830| 65 73 20 6e 61 6d 65 64 | 20 2a 2f 0a 20 20 20 20 |es named| */. |
|00004840| 7b 20 20 20 20 6e 75 6d | 20 3d 20 31 3b 20 20 20 |{ num| = 1; |
|00004850| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00004860| 20 20 20 2f 2a 20 74 68 | 65 6e 20 66 61 6b 65 20 | /* th|en fake |
|00004870| 6f 6e 65 20 2a 2f 0a 20 | 20 20 20 20 20 20 20 20 |one */. | |
|00004880| 61 72 67 5b 30 5d 20 3d | 20 22 2a 2e 2a 22 3b 20 |arg[0] =| "*.*"; |
|00004890| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 2f 2a | | /*|
|000048a0| 20 61 64 64 20 65 76 65 | 72 79 74 68 69 6e 67 20 | add eve|rything |
|000048b0| 2a 2f 0a 20 20 20 20 7d | 0a 0a 20 20 20 20 66 6f |*/. }|.. fo|
|000048c0| 72 28 6e 3d 30 3b 20 6e | 3c 6e 75 6d 3b 20 6e 2b |r(n=0; n|<num; n+|
|000048d0| 2b 29 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |+) | |
|000048e0| 20 2f 2a 20 66 6f 72 20 | 65 61 63 68 20 74 65 6d | /* for |each tem|
|000048f0| 70 6c 61 74 65 20 73 75 | 70 70 6c 69 65 64 20 2a |plate su|pplied *|
|00004900| 2f 0a 20 20 20 20 7b 0a | 20 20 20 20 20 20 20 20 |/. {.| |
|00004910| 20 73 74 72 63 70 79 28 | 62 75 66 2c 61 72 67 5b | strcpy(|buf,arg[|
|00004920| 6e 5d 29 3b 20 20 20 20 | 20 20 20 20 20 20 20 2f |n]); | /|
|00004930| 2a 20 67 65 74 20 72 65 | 61 64 79 20 74 6f 20 66 |* get re|ady to f|
|00004940| 69 78 20 70 61 74 68 20 | 2a 2f 0a 20 20 20 20 20 |ix path |*/. |
|00004950| 20 20 20 20 69 66 28 21 | 28 69 3d 72 69 6e 64 65 | if(!|(i=rinde|
|00004960| 78 28 62 75 66 2c 27 5c | 5c 27 29 29 29 0a 20 20 |x(buf,'\|\'))). |
|00004970| 20 20 20 20 20 20 20 20 | 20 20 20 20 69 66 28 21 | | if(!|
|00004980| 28 69 3d 72 69 6e 64 65 | 78 28 62 75 66 2c 27 2f |(i=rinde|x(buf,'/|
|00004990| 27 29 29 29 0a 20 20 20 | 20 20 20 20 20 20 20 20 |'))). | |
|000049a0| 20 20 20 20 20 20 20 20 | 69 66 28 21 28 69 3d 72 | |if(!(i=r|
|000049b0| 69 6e 64 65 78 28 62 75 | 66 2c 27 3a 27 29 29 29 |index(bu|f,':')))|
|000049c0| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |. | |
|000049d0| 20 20 20 20 20 20 20 20 | 20 69 20 3d 20 62 75 66 | | i = buf|
|000049e0| 2d 31 3b 0a 20 20 20 20 | 20 20 20 20 20 69 2b 2b |-1;. | i++|
|000049f0| 3b 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |; | |
|00004a00| 20 20 20 20 20 20 20 20 | 20 20 20 2f 2a 20 70 6f | | /* po|
|00004a10| 69 6e 74 65 72 20 74 6f | 20 77 68 65 72 65 20 6e |inter to| where n|
|00004a20| 61 6d 65 20 67 6f 65 73 | 20 2a 2f 0a 0a 20 20 20 |ame goes| */.. |
|00004a30| 20 20 20 20 20 20 6e 6f | 74 65 6d 70 20 3d 20 31 | no|temp = 1|
|00004a40| 3b 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |; | |
|00004a50| 20 20 20 20 2f 2a 20 72 | 65 73 65 74 20 66 69 6c | /* r|eset fil|
|00004a60| 65 73 20 66 6c 61 67 20 | 2a 2f 0a 20 20 20 20 20 |es flag |*/. |
|00004a70| 20 20 20 20 4e 61 6d 65 | 4c 69 73 74 20 3d 20 28 | Name|List = (|
|00004a80| 63 68 61 72 20 2a 29 20 | 6d 61 6c 6c 6f 63 28 73 |char *) |malloc(s|
|00004a90| 69 7a 65 6f 66 28 63 68 | 61 72 20 2a 29 29 3b 0a |izeof(ch|ar *));.|
|00004aa0| 20 20 20 20 20 20 20 20 | 20 66 6f 72 28 64 3d 64 | | for(d=d|
|00004ab0| 69 72 28 61 72 67 5b 6e | 5d 2c 30 2c 4e 61 6d 65 |ir(arg[n|],0,Name|
|00004ac0| 4c 69 73 74 29 3b 20 64 | 3b 20 64 3d 64 69 72 28 |List); d|; d=dir(|
|00004ad0| 4e 55 4c 4c 2c 30 2c 4e | 61 6d 65 4c 69 73 74 29 |NULL,0,N|ameList)|
|00004ae0| 29 0a 20 20 20 20 20 20 | 20 20 20 7b 20 20 20 20 |). | { |
|00004af0| 6e 6f 74 65 6d 70 20 3d | 20 30 3b 20 20 20 20 20 |notemp =| 0; |
|00004b00| 20 20 20 20 20 20 20 20 | 20 2f 2a 20 74 65 6d 70 | | /* temp|
|00004b10| 6c 61 74 65 20 69 73 20 | 67 69 76 69 6e 67 20 72 |late is |giving r|
|00004b20| 65 73 75 6c 74 73 20 2a | 2f 0a 20 20 20 20 20 20 |esults *|/. |
|00004b30| 20 20 20 20 20 20 20 20 | 6e 66 69 6c 65 73 2b 2b | |nfiles++|
|00004b40| 3b 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |; | |
|00004b50| 20 2f 2a 20 61 64 64 20 | 65 61 63 68 20 6d 61 74 | /* add |each mat|
|00004b60| 63 68 69 6e 67 20 66 69 | 6c 65 20 2a 2f 0a 20 20 |ching fi|le */. |
|00004b70| 20 20 20 20 20 20 20 20 | 20 20 20 20 70 61 74 68 | | path|
|00004b80| 20 3d 20 28 63 68 61 72 | 20 2a 2a 29 72 65 61 6c | = (char| **)real|
|00004b90| 6c 6f 63 28 70 61 74 68 | 2c 6e 66 69 6c 65 73 2a |loc(path|,nfiles*|
|00004ba0| 73 69 7a 65 6f 66 28 63 | 68 61 72 20 2a 2a 29 29 |sizeof(c|har **))|
|00004bb0| 3b 0a 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |;. | |
|00004bc0| 6e 61 6d 65 20 3d 20 28 | 63 68 61 72 20 2a 2a 29 |name = (|char **)|
|00004bd0| 72 65 61 6c 6c 6f 63 28 | 6e 61 6d 65 2c 6e 66 69 |realloc(|name,nfi|
|00004be0| 6c 65 73 2a 73 69 7a 65 | 6f 66 28 63 68 61 72 20 |les*size|of(char |
|00004bf0| 2a 2a 29 29 3b 0a 20 20 | 20 20 20 20 20 20 20 20 |**));. | |
|00004c00| 20 20 20 20 73 74 72 63 | 70 79 28 69 2c 64 29 3b | strc|py(i,d);|
|00004c10| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 2f 2a 20 | | /* |
|00004c20| 70 75 74 20 6e 61 6d 65 | 20 69 6e 20 70 61 74 68 |put name| in path|
|00004c30| 20 2a 2f 0a 20 20 20 20 | 20 20 20 20 20 20 20 20 | */. | |
|00004c40| 20 20 70 61 74 68 5b 6e | 66 69 6c 65 73 2d 31 5d | path[n|files-1]|
|00004c50| 20 3d 20 6d 61 6c 6c 6f | 63 28 73 74 72 6c 65 6e | = mallo|c(strlen|
|00004c60| 28 62 75 66 29 2b 31 29 | 3b 0a 20 20 20 20 20 20 |(buf)+1)|;. |
|00004c70| 20 20 20 20 20 20 20 20 | 73 74 72 63 70 79 28 70 | |strcpy(p|
|00004c80| 61 74 68 5b 6e 66 69 6c | 65 73 2d 31 5d 2c 62 75 |ath[nfil|es-1],bu|
|00004c90| 66 29 3b 0a 20 20 20 20 | 20 20 20 20 20 20 20 20 |f);. | |
|00004ca0| 20 20 6e 61 6d 65 5b 6e | 66 69 6c 65 73 2d 31 5d | name[n|files-1]|
|00004cb0| 20 3d 20 64 3b 20 20 20 | 20 20 20 2f 2a 20 73 61 | = d; | /* sa|
|00004cc0| 76 65 20 6e 61 6d 65 20 | 2a 2f 0a 0a 23 69 66 20 |ve name |*/..#if |
|00004cd0| 4d 53 44 4f 53 0a 20 20 | 20 20 20 20 20 20 20 20 |MSDOS. | |
|00004ce0| 20 20 20 20 69 66 28 63 | 6f 72 65 6c 65 66 74 28 | if(c|oreleft(|
|00004cf0| 29 3c 35 31 32 30 29 0a | 20 20 20 20 20 20 20 20 |)<5120).| |
|00004d00| 20 20 20 20 20 20 7b 20 | 20 20 20 6e 66 69 6c 65 | { | nfile|
|00004d10| 73 20 3d 20 61 64 64 62 | 75 6e 63 68 28 6e 66 69 |s = addb|unch(nfi|
|00004d20| 6c 65 73 2c 70 61 74 68 | 2c 6e 61 6d 65 2c 6d 6f |les,path|,name,mo|
|00004d30| 76 65 2c 75 70 64 61 74 | 65 2c 66 72 65 73 68 29 |ve,updat|e,fresh)|
|00004d40| 3b 0a 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |;. | |
|00004d50| 20 20 20 20 20 6e 6f 77 | 6f 72 6b 20 3d 20 6e 6f | now|ork = no|
|00004d60| 77 6f 72 6b 20 26 26 20 | 21 6e 66 69 6c 65 73 3b |work && |!nfiles;|
|00004d70| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |. | |
|00004d80| 20 20 20 20 77 68 69 6c | 65 28 6e 66 69 6c 65 73 | whil|e(nfiles|
|00004d90| 29 0a 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |). | |
|00004da0| 20 20 20 20 20 7b 20 20 | 20 20 66 72 65 65 28 70 | { | free(p|
|00004db0| 61 74 68 5b 2d 2d 6e 66 | 69 6c 65 73 5d 29 3b 0a |ath[--nf|iles]);.|
|00004dc0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00004dd0| 20 20 20 20 20 20 20 20 | 66 72 65 65 28 6e 61 6d | |free(nam|
|00004de0| 65 5b 6e 66 69 6c 65 73 | 5d 29 3b 0a 20 20 20 20 |e[nfiles|]);. |
|00004df0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 7d | | }|
|00004e00| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |. | |
|00004e10| 20 20 20 20 66 72 65 65 | 28 70 61 74 68 29 3b 20 | free|(path); |
|00004e20| 66 72 65 65 28 6e 61 6d | 65 29 3b 0a 20 20 20 20 |free(nam|e);. |
|00004e30| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 70 | | p|
|00004e40| 61 74 68 20 3d 20 6e 61 | 6d 65 20 3d 20 4e 55 4c |ath = na|me = NUL|
|00004e50| 4c 3b 0a 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |L;. | |
|00004e60| 20 7d 0a 23 65 6e 64 69 | 66 0a 20 20 20 20 20 20 | }.#endi|f. |
|00004e70| 20 20 20 7d 0a 20 20 20 | 20 20 20 20 20 20 69 66 | }. | if|
|00004e80| 28 6e 6f 74 65 6d 70 20 | 26 26 20 77 61 72 6e 29 |(notemp |&& warn)|
|00004e90| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 70 |. | p|
|00004ea0| 72 69 6e 74 66 28 22 4e | 6f 20 66 69 6c 65 73 20 |rintf("N|o files |
|00004eb0| 6d 61 74 63 68 3a 20 25 | 73 5c 6e 22 2c 61 72 67 |match: %|s\n",arg|
|00004ec0| 5b 6e 5d 29 3b 0a 20 20 | 20 20 7d 0a 0a 20 20 20 |[n]);. | }.. |
|00004ed0| 20 69 66 28 6e 66 69 6c | 65 73 29 0a 20 20 20 20 | if(nfil|es). |
|00004ee0| 7b 20 20 20 20 6e 66 69 | 6c 65 73 20 3d 20 61 64 |{ nfi|les = ad|
|00004ef0| 64 62 75 6e 63 68 28 6e | 66 69 6c 65 73 2c 70 61 |dbunch(n|files,pa|
|00004f00| 74 68 2c 6e 61 6d 65 2c | 6d 6f 76 65 2c 75 70 64 |th,name,|move,upd|
|00004f10| 61 74 65 2c 66 72 65 73 | 68 29 3b 0a 20 20 20 20 |ate,fres|h);. |
|00004f20| 20 20 20 20 20 6e 6f 77 | 6f 72 6b 20 3d 20 6e 6f | now|ork = no|
|00004f30| 77 6f 72 6b 20 26 26 20 | 21 6e 66 69 6c 65 73 3b |work && |!nfiles;|
|00004f40| 0a 20 20 20 20 20 20 20 | 20 20 77 68 69 6c 65 28 |. | while(|
|00004f50| 6e 66 69 6c 65 73 29 0a | 20 20 20 20 20 20 20 20 |nfiles).| |
|00004f60| 20 7b 20 20 20 20 66 72 | 65 65 28 70 61 74 68 5b | { fr|ee(path[|
|00004f70| 2d 2d 6e 66 69 6c 65 73 | 5d 29 3b 0a 20 20 20 20 |--nfiles|]);. |
|00004f80| 20 20 20 20 20 20 20 20 | 20 20 66 72 65 65 28 6e | | free(n|
|00004f90| 61 6d 65 5b 6e 66 69 6c | 65 73 5d 29 3b 0a 20 20 |ame[nfil|es]);. |
|00004fa0| 20 20 20 20 20 20 20 7d | 0a 20 20 20 20 20 20 20 | }|. |
|00004fb0| 20 20 66 72 65 65 28 70 | 61 74 68 29 3b 20 66 72 | free(p|ath); fr|
|00004fc0| 65 65 28 6e 61 6d 65 29 | 3b 0a 20 20 20 20 7d 0a |ee(name)|;. }.|
|00004fd0| 0a 20 20 20 20 69 66 28 | 6e 6f 77 6f 72 6b 20 26 |. if(|nowork &|
|00004fe0| 26 20 77 61 72 6e 29 0a | 20 20 20 20 20 20 20 20 |& warn).| |
|00004ff0| 20 70 72 69 6e 74 66 28 | 22 4e 6f 20 66 69 6c 65 | printf(|"No file|
|00005000| 73 20 77 65 72 65 20 61 | 64 64 65 64 2e 5c 6e 22 |s were a|dded.\n"|
|00005010| 29 3b 0a 7d 0a 0a 49 4e | 54 20 61 64 64 62 75 6e |);.}..IN|T addbun|
|00005020| 63 68 28 6e 66 69 6c 65 | 73 2c 70 61 74 68 2c 6e |ch(nfile|s,path,n|
|00005030| 61 6d 65 2c 6d 6f 76 65 | 2c 75 70 64 61 74 65 2c |ame,move|,update,|
|00005040| 66 72 65 73 68 29 20 2f | 2a 20 61 64 64 20 61 20 |fresh) /|* add a |
|00005050| 62 75 6e 63 68 20 6f 66 | 20 66 69 6c 65 73 20 2a |bunch of| files *|
|00005060| 2f 0a 49 4e 54 20 6e 66 | 69 6c 65 73 3b 20 20 20 |/.INT nf|iles; |
|00005070| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00005080| 20 20 20 20 20 20 20 20 | 20 2f 2a 20 6e 75 6d 62 | | /* numb|
|00005090| 65 72 20 6f 66 20 66 69 | 6c 65 73 20 74 6f 20 61 |er of fi|les to a|
|000050a0| 64 64 20 2a 2f 0a 63 68 | 61 72 20 2a 2a 70 61 74 |dd */.ch|ar **pat|
|000050b0| 68 3b 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |h; | |
|000050c0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 2f 2a 20 | | /* |
|000050d0| 70 6f 69 6e 74 65 72 73 | 20 74 6f 20 70 61 74 68 |pointers| to path|
|000050e0| 6e 61 6d 65 73 20 2a 2f | 0a 63 68 61 72 20 2a 2a |names */|.char **|
|000050f0| 6e 61 6d 65 3b 20 20 20 | 20 20 20 20 20 20 20 20 |name; | |
|00005100| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00005110| 2f 2a 20 70 6f 69 6e 74 | 65 72 73 20 74 6f 20 66 |/* point|ers to f|
|00005120| 69 6c 65 6e 61 6d 65 73 | 20 2a 2f 0a 49 4e 54 20 |ilenames| */.INT |
|00005130| 6d 6f 76 65 3b 20 20 20 | 20 20 20 20 20 20 20 20 |move; | |
|00005140| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00005150| 20 20 20 2f 2a 20 74 72 | 75 65 20 69 66 20 6d 6f | /* tr|ue if mo|
|00005160| 76 69 6e 67 20 66 69 6c | 65 20 2a 2f 0a 49 4e 54 |ving fil|e */.INT|
|00005170| 20 75 70 64 61 74 65 3b | 20 20 20 20 20 20 20 20 | update;| |
|00005180| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00005190| 20 20 20 20 2f 2a 20 74 | 72 75 65 20 69 66 20 75 | /* t|rue if u|
|000051a0| 70 64 61 74 69 6e 67 20 | 2a 2f 0a 49 4e 54 20 66 |pdating |*/.INT f|
|000051b0| 72 65 73 68 3b 20 20 20 | 20 20 20 20 20 20 20 20 |resh; | |
|000051c0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000051d0| 20 20 2f 2a 20 74 72 75 | 65 20 69 66 20 66 72 65 | /* tru|e if fre|
|000051e0| 73 68 65 6e 69 6e 67 20 | 2a 2f 0a 7b 0a 20 20 20 |shening |*/.{. |
|000051f0| 20 63 68 61 72 20 62 75 | 66 5b 53 54 52 4c 45 4e | char bu|f[STRLEN|
|00005200| 5d 3b 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |]; | |
|00005210| 20 20 20 2f 2a 20 70 61 | 74 68 6e 61 6d 65 20 62 | /* pa|thname b|
|00005220| 75 66 66 65 72 20 2a 2f | 0a 20 49 4e 54 20 6d 2c |uffer */|. INT m,|
|00005230| 20 6e 3b 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | n; | |
|00005240| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 2f 2a 20 | | /* |
|00005250| 69 6e 64 69 63 65 73 20 | 2a 2f 0a 20 20 20 20 63 |indices |*/. c|
|00005260| 68 61 72 20 2a 64 3b 20 | 20 20 20 20 20 20 20 20 |har *d; | |
|00005270| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00005280| 20 20 2f 2a 20 73 77 61 | 70 20 70 6f 69 6e 74 65 | /* swa|p pointe|
|00005290| 72 20 2a 2f 0a 20 20 20 | 20 73 74 72 75 63 74 20 |r */. | struct |
|000052a0| 68 65 61 64 73 20 68 64 | 72 3b 20 20 20 20 20 20 |heads hd|r; |
|000052b0| 20 20 20 20 20 20 20 20 | 20 20 20 20 2f 2a 20 66 | | /* f|
|000052c0| 69 6c 65 20 68 65 61 64 | 65 72 20 64 61 74 61 20 |ile head|er data |
|000052d0| 73 74 6f 72 61 67 65 20 | 2a 2f 0a 20 20 20 20 49 |storage |*/. I|
|000052e0| 4e 54 20 61 64 64 66 69 | 6c 65 28 29 3b 0a 20 20 |NT addfi|le();. |
|000052f0| 20 20 49 4e 54 20 69 7a | 61 64 69 72 28 29 3b 09 | INT iz|adir();.|
|00005300| 09 20 20 20 2f 2a 20 75 | 73 65 64 20 74 6f 20 77 |. /* u|sed to w|
|00005310| 65 65 64 2d 6f 75 74 20 | 64 69 72 65 63 74 6f 72 |eed-out |director|
|00005320| 69 65 73 20 2a 2f 0a 0a | 20 20 20 20 66 6f 72 28 |ies */..| for(|
|00005330| 6e 3d 30 3b 20 6e 3c 6e | 66 69 6c 65 73 2d 31 3b |n=0; n<n|files-1;|
|00005340| 20 6e 2b 2b 29 20 20 20 | 20 20 20 20 20 20 20 2f | n++) | /|
|00005350| 2a 20 73 6f 72 74 20 74 | 68 65 20 6c 69 73 74 20 |* sort t|he list |
|00005360| 6f 66 20 6e 61 6d 65 73 | 20 2a 2f 0a 20 20 20 20 |of names| */. |
|00005370| 7b 20 20 20 20 66 6f 72 | 28 6d 3d 6e 2b 31 3b 20 |{ for|(m=n+1; |
|00005380| 6d 3c 6e 66 69 6c 65 73 | 3b 20 6d 2b 2b 29 0a 20 |m<nfiles|; m++). |
|00005390| 20 20 20 20 20 20 20 20 | 7b 20 20 20 20 69 66 28 | |{ if(|
|000053a0| 73 74 72 63 6d 70 28 6e | 61 6d 65 5b 6e 5d 2c 6e |strcmp(n|ame[n],n|
|000053b0| 61 6d 65 5b 6d 5d 29 3e | 30 29 0a 20 20 20 20 20 |ame[m])>|0). |
|000053c0| 20 20 20 20 20 20 20 20 | 20 7b 20 20 20 20 64 20 | | { d |
|000053d0| 3d 20 70 61 74 68 5b 6e | 5d 3b 0a 20 20 20 20 20 |= path[n|];. |
|000053e0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 70 61 | | pa|
|000053f0| 74 68 5b 6e 5d 20 3d 20 | 70 61 74 68 5b 6d 5d 3b |th[n] = |path[m];|
|00005400| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |. | |
|00005410| 20 20 20 20 70 61 74 68 | 5b 6d 5d 20 3d 20 64 3b | path|[m] = d;|
|00005420| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |. | |
|00005430| 20 20 20 20 64 20 3d 20 | 6e 61 6d 65 5b 6e 5d 3b | d = |name[n];|
|00005440| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |. | |
|00005450| 20 20 20 20 6e 61 6d 65 | 5b 6e 5d 20 3d 20 6e 61 | name|[n] = na|
|00005460| 6d 65 5b 6d 5d 3b 0a 20 | 20 20 20 20 20 20 20 20 |me[m];. | |
|00005470| 20 20 20 20 20 20 20 20 | 20 20 6e 61 6d 65 5b 6d | | name[m|
|00005480| 5d 20 3d 20 64 3b 0a 20 | 20 20 20 20 20 20 20 20 |] = d;. | |
|00005490| 20 20 20 20 20 7d 0a 20 | 20 20 20 20 20 20 20 20 | }. | |
|000054a0| 7d 0a 20 20 20 20 7d 0a | 0a 20 20 20 20 66 6f 72 |}. }.|. for|
|000054b0| 28 6e 3d 30 3b 20 6e 3c | 6e 66 69 6c 65 73 2d 31 |(n=0; n<|nfiles-1|
|000054c0| 3b 20 29 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |; ) | |
|000054d0| 2f 2a 20 63 6f 6e 73 6f | 6c 69 64 61 74 65 20 74 |/* conso|lidate t|
|000054e0| 68 65 20 6c 69 73 74 20 | 6f 66 20 6e 61 6d 65 73 |he list |of names|
|000054f0| 20 2a 2f 0a 20 20 20 20 | 7b 20 20 20 20 69 66 28 | */. |{ if(|
|00005500| 21 73 74 72 63 6d 70 28 | 70 61 74 68 5b 6e 5d 2c |!strcmp(|path[n],|
|00005510| 70 61 74 68 5b 6e 2b 31 | 5d 29 20 2f 2a 20 69 66 |path[n+1|]) /* if|
|00005520| 20 64 75 70 6c 69 63 61 | 74 65 20 6e 61 6d 65 73 | duplica|te names|
|00005530| 20 2a 2f 0a 20 20 20 20 | 20 20 20 20 20 7c 7c 20 | */. | || |
|00005540| 21 73 74 72 63 6d 70 28 | 70 61 74 68 5b 6e 5d 2c |!strcmp(|path[n],|
|00005550| 61 72 63 6e 61 6d 65 29 | 20 20 20 2f 2a 20 6f 72 |arcname)| /* or|
|00005560| 20 74 68 69 73 20 61 72 | 63 68 69 76 65 20 2a 2f | this ar|chive */|
|00005570| 0a 20 20 20 20 20 20 20 | 20 20 7c 7c 20 69 7a 61 |. | || iza|
|00005580| 64 69 72 28 70 61 74 68 | 5b 6e 5d 29 20 20 20 20 |dir(path|[n]) |
|00005590| 20 20 20 20 20 20 20 20 | 2f 2a 20 6f 72 20 64 69 | |/* or di|
|000055a0| 72 65 63 74 6f 72 79 20 | 2a 2f 0a 20 20 20 20 20 |rectory |*/. |
|000055b0| 20 20 20 20 7c 7c 20 21 | 73 74 72 63 6d 70 28 70 | || !|strcmp(p|
|000055c0| 61 74 68 5b 6e 5d 2c 6e | 65 77 6e 61 6d 65 29 20 |ath[n],n|ewname) |
|000055d0| 20 20 2f 2a 20 6f 72 20 | 74 68 65 20 6e 65 77 20 | /* or |the new |
|000055e0| 76 65 72 73 69 6f 6e 20 | 2a 2f 0a 20 20 20 20 20 |version |*/. |
|000055f0| 20 20 20 20 7c 7c 20 21 | 73 74 72 63 6d 70 28 70 | || !|strcmp(p|
|00005600| 61 74 68 5b 6e 5d 2c 62 | 61 6b 6e 61 6d 65 29 29 |ath[n],b|akname))|
|00005610| 20 20 2f 2a 20 6f 72 20 | 69 74 73 20 62 61 63 6b | /* or |its back|
|00005620| 75 70 20 2a 2f 0a 20 20 | 20 20 20 20 20 20 20 7b |up */. | {|
|00005630| 20 20 20 20 66 72 65 65 | 28 70 61 74 68 5b 6e 5d | free|(path[n]|
|00005640| 29 3b 20 20 20 20 20 20 | 20 20 20 20 20 2f 2a 20 |); | /* |
|00005650| 74 68 65 6e 20 66 6f 72 | 67 65 74 20 74 68 65 20 |then for|get the |
|00005660| 66 69 6c 65 20 2a 2f 0a | 20 20 20 20 20 20 20 20 |file */.| |
|00005670| 20 20 20 20 20 20 66 72 | 65 65 28 6e 61 6d 65 5b | fr|ee(name[|
|00005680| 6e 5d 29 3b 0a 20 20 20 | 20 20 20 20 20 20 20 20 |n]);. | |
|00005690| 20 20 20 66 6f 72 28 6d | 3d 6e 3b 20 6d 3c 6e 66 | for(m|=n; m<nf|
|000056a0| 69 6c 65 73 2d 31 3b 20 | 6d 2b 2b 29 0a 20 20 20 |iles-1; |m++). |
|000056b0| 20 20 20 20 20 20 20 20 | 20 20 20 7b 20 20 20 20 | | { |
|000056c0| 70 61 74 68 5b 6d 5d 20 | 3d 20 70 61 74 68 5b 6d |path[m] |= path[m|
|000056d0| 2b 31 5d 3b 0a 20 20 20 | 20 20 20 20 20 20 20 20 |+1];. | |
|000056e0| 20 20 20 20 20 20 20 20 | 6e 61 6d 65 5b 6d 5d 20 | |name[m] |
|000056f0| 3d 20 6e 61 6d 65 5b 6d | 2b 31 5d 3b 0a 20 20 20 |= name[m|+1];. |
|00005700| 20 20 20 20 20 20 20 20 | 20 20 20 7d 0a 20 20 20 | | }. |
|00005710| 20 20 20 20 20 20 20 20 | 20 20 20 6e 66 69 6c 65 | | nfile|
|00005720| 73 2d 2d 3b 0a 20 20 20 | 20 20 20 20 20 20 7d 0a |s--;. | }.|
|00005730| 20 20 20 20 20 20 20 20 | 20 65 6c 73 65 20 6e 2b | | else n+|
|00005740| 2b 3b 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |+; | |
|00005750| 20 20 20 20 20 20 20 2f | 2a 20 65 6c 73 65 20 74 | /|* else t|
|00005760| 65 73 74 20 74 68 65 20 | 6e 65 78 74 20 6f 6e 65 |est the |next one|
|00005770| 20 2a 2f 0a 20 20 20 20 | 7d 0a 0a 20 20 20 20 69 | */. |}.. i|
|00005780| 66 28 21 73 74 72 63 6d | 70 28 70 61 74 68 5b 6e |f(!strcm|p(path[n|
|00005790| 5d 2c 61 72 63 6e 61 6d | 65 29 20 20 20 20 20 20 |],arcnam|e) |
|000057a0| 20 20 2f 2a 20 73 70 65 | 63 69 61 6c 20 63 68 65 | /* spe|cial che|
|000057b0| 63 6b 20 66 6f 72 20 6c | 61 73 74 20 66 69 6c 65 |ck for l|ast file|
|000057c0| 20 2a 2f 0a 20 20 20 20 | 7c 7c 20 21 73 74 72 63 | */. ||| !strc|
|000057d0| 6d 70 28 70 61 74 68 5b | 6e 5d 2c 6e 65 77 6e 61 |mp(path[|n],newna|
|000057e0| 6d 65 29 20 20 20 20 20 | 20 20 20 2f 2a 20 63 6f |me) | /* co|
|000057f0| 75 72 74 65 73 79 20 6f | 66 20 52 69 63 6b 20 4d |urtesy o|f Rick M|
|00005800| 6f 6f 72 65 20 2a 2f 0a | 20 20 20 20 7c 7c 20 69 |oore */.| || i|
|00005810| 7a 61 64 69 72 28 70 61 | 74 68 5b 6e 5d 29 0a 20 |zadir(pa|th[n]). |
|00005820| 20 20 20 7c 7c 20 21 73 | 74 72 63 6d 70 28 70 61 | || !s|trcmp(pa|
|00005830| 74 68 5b 6e 5d 2c 62 61 | 6b 6e 61 6d 65 29 29 0a |th[n],ba|kname)).|
|00005840| 20 20 20 20 7b 20 20 20 | 20 66 72 65 65 28 70 61 | { | free(pa|
|00005850| 74 68 5b 6e 5d 29 3b 0a | 20 20 20 20 20 20 20 20 |th[n]);.| |
|00005860| 20 66 72 65 65 28 6e 61 | 6d 65 5b 6e 5d 29 3b 0a | free(na|me[n]);.|
|00005870| 20 20 20 20 20 20 20 20 | 20 6e 66 69 6c 65 73 2d | | nfiles-|
|00005880| 2d 3b 0a 20 20 20 20 7d | 0a 0a 20 20 20 20 69 66 |-;. }|.. if|
|00005890| 28 21 6e 66 69 6c 65 73 | 29 20 20 20 20 20 20 20 |(!nfiles|) |
|000058a0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000058b0| 20 2f 2a 20 6d 61 6b 65 | 20 73 75 72 65 20 77 65 | /* make| sure we|
|000058c0| 20 67 6f 74 20 73 6f 6d | 65 20 2a 2f 0a 20 20 20 | got som|e */. |
|000058d0| 20 20 20 20 20 20 72 65 | 74 75 72 6e 20 30 3b 0a | re|turn 0;.|
|000058e0| 0a 20 20 20 20 66 6f 72 | 28 6e 3d 30 3b 20 6e 3c |. for|(n=0; n<|
|000058f0| 6e 66 69 6c 65 73 2d 31 | 3b 20 6e 2b 2b 29 20 20 |nfiles-1|; n++) |
|00005900| 20 20 20 20 20 20 20 20 | 2f 2a 20 77 61 74 63 68 | |/* watch|
|00005910| 20 6f 75 74 20 66 6f 72 | 20 64 75 70 6c 69 63 61 | out for| duplica|
|00005920| 74 65 20 6e 61 6d 65 73 | 20 2a 2f 0a 20 20 20 20 |te names| */. |
|00005930| 20 20 20 20 20 69 66 28 | 21 73 74 72 63 6d 70 28 | if(|!strcmp(|
|00005940| 6e 61 6d 65 5b 6e 5d 2c | 6e 61 6d 65 5b 6e 2b 31 |name[n],|name[n+1|
|00005950| 5d 29 29 0a 20 20 20 20 | 20 20 20 20 20 20 20 20 |])). | |
|00005960| 20 20 61 62 6f 72 74 28 | 22 44 75 70 6c 69 63 61 | abort(|"Duplica|
|00005970| 74 65 20 66 69 6c 65 6e | 61 6d 65 73 3a 5c 6e 20 |te filen|ames:\n |
|00005980| 20 25 73 5c 6e 20 20 25 | 73 22 2c 70 61 74 68 5b | %s\n %|s",path[|
|00005990| 6e 5d 2c 70 61 74 68 5b | 6e 2b 31 5d 29 3b 0a 0a |n],path[|n+1]);..|
|000059a0| 20 20 20 20 6f 70 65 6e | 61 72 63 28 31 29 3b 20 | open|arc(1); |
|000059b0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000059c0| 20 20 20 20 20 20 20 2f | 2a 20 6f 70 65 6e 20 61 | /|* open a|
|000059d0| 72 63 68 69 76 65 20 66 | 6f 72 20 63 68 61 6e 67 |rchive f|or chang|
|000059e0| 65 73 20 2a 2f 0a 0a 20 | 20 20 20 66 6f 72 28 6e |es */.. | for(n|
|000059f0| 3d 30 3b 20 6e 3c 6e 66 | 69 6c 65 73 3b 20 6e 2b |=0; n<nf|iles; n+|
|00005a00| 2b 29 20 20 20 20 20 20 | 20 20 20 20 20 20 2f 2a |+) | /*|
|00005a10| 20 61 64 64 20 65 61 63 | 68 20 66 69 6c 65 20 69 | add eac|h file i|
|00005a20| 6e 20 74 68 65 20 6c 69 | 73 74 20 2a 2f 0a 20 20 |n the li|st */. |
|00005a30| 20 20 20 20 20 20 20 61 | 64 64 66 69 6c 65 28 70 | a|ddfile(p|
|00005a40| 61 74 68 5b 6e 5d 2c 6e | 61 6d 65 5b 6e 5d 2c 75 |ath[n],n|ame[n],u|
|00005a50| 70 64 61 74 65 2c 66 72 | 65 73 68 29 3b 0a 0a 20 |pdate,fr|esh);.. |
|00005a60| 20 20 20 2f 2a 20 6e 6f | 77 20 77 65 20 6d 75 73 | /* no|w we mus|
|00005a70| 74 20 63 6f 70 79 20 6f | 76 65 72 20 61 6c 6c 20 |t copy o|ver all |
|00005a80| 66 69 6c 65 73 20 74 68 | 61 74 20 66 6f 6c 6c 6f |files th|at follo|
|00005a90| 77 20 6f 75 72 20 61 64 | 64 69 74 69 6f 6e 73 20 |w our ad|ditions |
|00005aa0| 2a 2f 0a 0a 20 20 20 20 | 77 68 69 6c 65 28 72 65 |*/.. |while(re|
|00005ab0| 61 64 68 64 72 28 26 68 | 64 72 2c 61 72 63 29 29 |adhdr(&h|dr,arc))|
|00005ac0| 20 20 20 20 20 20 20 20 | 20 20 20 2f 2a 20 77 68 | | /* wh|
|00005ad0| 69 6c 65 20 6d 6f 72 65 | 20 65 6e 74 72 69 65 73 |ile more| entries|
|00005ae0| 20 74 6f 20 63 6f 70 79 | 20 2a 2f 0a 20 20 20 20 | to copy| */. |
|00005af0| 7b 20 20 20 20 77 72 69 | 74 65 68 64 72 28 26 68 |{ wri|tehdr(&h|
|00005b00| 64 72 2c 6e 65 77 29 3b | 0a 20 20 20 20 20 20 20 |dr,new);|. |
|00005b10| 20 20 66 69 6c 65 63 6f | 70 79 28 61 72 63 2c 6e | fileco|py(arc,n|
|00005b20| 65 77 2c 68 64 72 2e 73 | 69 7a 65 29 3b 0a 20 20 |ew,hdr.s|ize);. |
|00005b30| 20 20 7d 0a 20 20 20 20 | 68 64 72 76 65 72 20 3d | }. |hdrver =|
|00005b40| 20 30 3b 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | 0; | |
|00005b50| 20 20 20 20 20 20 20 20 | 20 20 20 2f 2a 20 61 72 | | /* ar|
|00005b60| 63 68 69 76 65 20 45 4f | 46 20 74 79 70 65 20 2a |chive EO|F type *|
|00005b70| 2f 0a 20 20 20 20 77 72 | 69 74 65 68 64 72 28 26 |/. wr|itehdr(&|
|00005b80| 68 64 72 2c 6e 65 77 29 | 3b 20 20 20 20 20 20 20 |hdr,new)|; |
|00005b90| 20 20 20 20 20 20 20 20 | 20 2f 2a 20 77 72 69 74 | | /* writ|
|00005ba0| 65 20 6f 75 74 20 6f 75 | 72 20 65 6e 64 20 6d 61 |e out ou|r end ma|
|00005bb0| 72 6b 65 72 20 2a 2f 0a | 20 20 20 20 63 6c 6f 73 |rker */.| clos|
|00005bc0| 65 61 72 63 28 31 29 3b | 20 20 20 20 20 20 20 20 |earc(1);| |
|00005bd0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 2f | | /|
|00005be0| 2a 20 63 6c 6f 73 65 20 | 61 72 63 68 69 76 65 20 |* close |archive |
|00005bf0| 61 66 74 65 72 20 63 68 | 61 6e 67 65 73 20 2a 2f |after ch|anges */|
|00005c00| 0a 0a 20 20 20 20 69 66 | 28 6d 6f 76 65 29 20 20 |.. if|(move) |
|00005c10| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00005c20| 20 20 20 20 20 20 20 20 | 20 2f 2a 20 69 66 20 74 | | /* if t|
|00005c30| 68 69 73 20 77 61 73 20 | 61 20 6d 6f 76 65 20 2a |his was |a move *|
|00005c40| 2f 0a 20 20 20 20 7b 20 | 20 20 20 66 6f 72 28 6e |/. { | for(n|
|00005c50| 3d 30 3b 20 6e 3c 6e 66 | 69 6c 65 73 3b 20 6e 2b |=0; n<nf|iles; n+|
|00005c60| 2b 29 20 20 20 20 20 20 | 20 2f 2a 20 74 68 65 6e |+) | /* then|
|00005c70| 20 64 65 6c 65 74 65 20 | 65 61 63 68 20 66 69 6c | delete |each fil|
|00005c80| 65 20 61 64 64 65 64 20 | 2a 2f 0a 20 20 20 20 20 |e added |*/. |
|00005c90| 20 20 20 20 7b 20 20 20 | 20 69 66 28 75 6e 6c 69 | { | if(unli|
|00005ca0| 6e 6b 28 70 61 74 68 5b | 6e 5d 29 20 26 26 20 77 |nk(path[|n]) && w|
|00005cb0| 61 72 6e 29 0a 20 20 20 | 20 20 20 20 20 20 20 20 |arn). | |
|00005cc0| 20 20 20 7b 20 20 20 20 | 70 72 69 6e 74 66 28 22 | { |printf("|
|00005cd0| 43 61 6e 6e 6f 74 20 75 | 6e 73 61 76 65 20 25 73 |Cannot u|nsave %s|
|00005ce0| 5c 6e 22 2c 70 61 74 68 | 5b 6e 5d 29 3b 0a 20 20 |\n",path|[n]);. |
|00005cf0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00005d00| 20 6e 65 72 72 73 2b 2b | 3b 0a 20 20 20 20 20 20 | nerrs++|;. |
|00005d10| 20 20 20 20 20 20 20 20 | 7d 0a 20 20 20 20 20 20 | |}. |
|00005d20| 20 20 20 7d 0a 20 20 20 | 20 7d 0a 0a 20 20 20 20 | }. | }.. |
|00005d30| 72 65 74 75 72 6e 20 6e | 66 69 6c 65 73 3b 20 20 |return n|files; |
|00005d40| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00005d50| 20 20 20 2f 2a 20 73 61 | 79 20 68 6f 77 20 6d 61 | /* sa|y how ma|
|00005d60| 6e 79 20 77 65 72 65 20 | 61 64 64 65 64 20 2a 2f |ny were |added */|
|00005d70| 0a 7d 0a 0a 73 74 61 74 | 69 63 20 49 4e 54 20 61 |.}..stat|ic INT a|
|00005d80| 64 64 66 69 6c 65 28 70 | 61 74 68 2c 6e 61 6d 65 |ddfile(p|ath,name|
|00005d90| 2c 75 70 64 61 74 65 2c | 66 72 65 73 68 29 20 2f |,update,|fresh) /|
|00005da0| 2a 20 61 64 64 20 6e 61 | 6d 65 64 20 66 69 6c 65 |* add na|med file|
|00005db0| 20 74 6f 20 61 72 63 68 | 69 76 65 20 2a 2f 0a 63 | to arch|ive */.c|
|00005dc0| 68 61 72 20 2a 70 61 74 | 68 3b 20 20 20 20 20 20 |har *pat|h; |
|00005dd0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00005de0| 20 20 20 20 20 20 2f 2a | 20 70 61 74 68 20 6e 61 | /*| path na|
|00005df0| 6d 65 20 6f 66 20 66 69 | 6c 65 20 74 6f 20 61 64 |me of fi|le to ad|
|00005e00| 64 20 2a 2f 0a 63 68 61 | 72 20 2a 6e 61 6d 65 3b |d */.cha|r *name;|
|00005e10| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00005e20| 20 20 20 20 20 20 20 20 | 20 20 20 20 2f 2a 20 6e | | /* n|
|00005e30| 61 6d 65 20 6f 66 20 66 | 69 6c 65 20 74 6f 20 61 |ame of f|ile to a|
|00005e40| 64 64 20 2a 2f 0a 49 4e | 54 20 75 70 64 61 74 65 |dd */.IN|T update|
|00005e50| 3b 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |; | |
|00005e60| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 2f 2a 20 | | /* |
|00005e70| 74 72 75 65 20 69 66 20 | 75 70 64 61 74 69 6e 67 |true if |updating|
|00005e80| 20 2a 2f 0a 49 4e 54 20 | 66 72 65 73 68 3b 20 20 | */.INT |fresh; |
|00005e90| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00005ea0| 20 20 20 20 20 20 20 20 | 20 20 20 2f 2a 20 74 72 | | /* tr|
|00005eb0| 75 65 20 69 66 20 66 72 | 65 73 68 65 6e 69 6e 67 |ue if fr|eshening|
|00005ec0| 20 2a 2f 0a 7b 0a 20 20 | 20 20 73 74 72 75 63 74 | */.{. | struct|
|00005ed0| 20 68 65 61 64 73 20 6e | 68 64 72 3b 20 20 20 20 | heads n|hdr; |
|00005ee0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 2f 2a 20 | | /* |
|00005ef0| 64 61 74 61 20 72 65 67 | 61 72 64 69 6e 67 20 74 |data reg|arding t|
|00005f00| 68 65 20 6e 65 77 20 66 | 69 6c 65 20 2a 2f 0a 20 |he new f|ile */. |
|00005f10| 20 20 20 73 74 72 75 63 | 74 20 68 65 61 64 73 20 | struc|t heads |
|00005f20| 6f 68 64 72 3b 20 20 20 | 20 20 20 20 20 20 20 20 |ohdr; | |
|00005f30| 20 20 20 20 20 20 2f 2a | 20 64 61 74 61 20 72 65 | /*| data re|
|00005f40| 67 61 72 64 69 6e 67 20 | 61 6e 20 6f 6c 64 20 66 |garding |an old f|
|00005f50| 69 6c 65 20 2a 2f 0a 20 | 20 20 20 46 49 4c 45 20 |ile */. | FILE |
|00005f60| 2a 66 2c 20 2a 66 6f 70 | 65 6e 28 29 3b 20 20 20 |*f, *fop|en(); |
|00005f70| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 2f 2a | | /*|
|00005f80| 20 66 69 6c 65 20 74 6f | 20 61 64 64 2c 20 6f 70 | file to| add, op|
|00005f90| 65 6e 65 72 20 2a 2f 0a | 20 20 20 20 6c 6f 6e 67 |ener */.| long|
|00005fa0| 20 73 74 61 72 74 73 2c | 20 66 74 65 6c 6c 28 29 | starts,| ftell()|
|00005fb0| 3b 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 2f |; | /|
|00005fc0| 2a 20 66 69 6c 65 20 6c | 6f 63 61 74 69 6f 6e 73 |* file l|ocations|
|00005fd0| 20 2a 2f 0a 20 49 4e 54 | 20 63 3b 20 20 20 20 20 | */. INT| c; |
|00005fe0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00005ff0| 20 20 20 20 20 20 20 20 | 2f 2a 20 6f 6e 65 20 63 | |/* one c|
|00006000| 68 61 72 20 6f 66 20 66 | 69 6c 65 20 2a 2f 0a 20 |har of f|ile */. |
|00006010| 49 4e 54 20 75 70 64 20 | 3d 20 30 3b 20 20 20 20 |INT upd |= 0; |
|00006020| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00006030| 20 20 20 2f 2a 20 74 72 | 75 65 20 69 66 20 72 65 | /* tr|ue if re|
|00006040| 70 6c 61 63 69 6e 67 20 | 61 6e 20 65 6e 74 72 79 |placing |an entry|
|00006050| 20 2a 2f 0a 0a 20 20 20 | 20 69 66 28 21 28 66 3d | */.. | if(!(f=|
|00006060| 66 6f 70 65 6e 28 70 61 | 74 68 2c 22 72 22 29 29 |fopen(pa|th,"r"))|
|00006070| 29 0a 20 20 20 20 7b 20 | 20 20 20 69 66 28 77 61 |). { | if(wa|
|00006080| 72 6e 29 0a 20 20 20 20 | 20 20 20 20 20 7b 20 20 |rn). | { |
|00006090| 20 20 70 72 69 6e 74 66 | 28 22 43 61 6e 6e 6f 74 | printf|("Cannot|
|000060a0| 20 72 65 61 64 20 66 69 | 6c 65 3a 20 25 73 5c 6e | read fi|le: %s\n|
|000060b0| 22 2c 70 61 74 68 29 3b | 0a 20 20 20 20 20 20 20 |",path);|. |
|000060c0| 20 20 20 20 20 20 20 6e | 65 72 72 73 2b 2b 3b 0a | n|errs++;.|
|000060d0| 20 20 20 20 20 20 20 20 | 20 7d 0a 20 20 20 20 20 | | }. |
|000060e0| 20 20 20 20 72 65 74 75 | 72 6e 3b 0a 20 20 20 20 | retu|rn;. |
|000060f0| 7d 0a 0a 20 20 20 20 73 | 74 72 63 70 79 28 6e 68 |}.. s|trcpy(nh|
|00006100| 64 72 2e 6e 61 6d 65 2c | 6e 61 6d 65 29 3b 20 20 |dr.name,|name); |
|00006110| 20 20 20 20 20 20 20 20 | 20 20 2f 2a 20 73 61 76 | | /* sav|
|00006120| 65 20 6e 61 6d 65 20 2a | 2f 0a 20 20 20 20 6e 68 |e name *|/. nh|
|00006130| 64 72 2e 73 69 7a 65 20 | 3d 20 30 3b 20 20 20 20 |dr.size |= 0; |
|00006140| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00006150| 20 2f 2a 20 63 6c 65 61 | 72 20 6f 75 74 20 73 69 | /* clea|r out si|
|00006160| 7a 65 20 73 74 6f 72 61 | 67 65 20 2a 2f 0a 20 20 |ze stora|ge */. |
|00006170| 20 20 6e 68 64 72 2e 63 | 72 63 20 3d 20 30 3b 20 | nhdr.c|rc = 0; |
|00006180| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00006190| 20 20 20 20 20 2f 2a 20 | 63 6c 65 61 72 20 6f 75 | /* |clear ou|
|000061a0| 74 20 43 52 43 20 63 68 | 65 63 6b 20 73 74 6f 72 |t CRC ch|eck stor|
|000061b0| 61 67 65 20 2a 2f 0a 20 | 20 20 20 67 65 74 73 74 |age */. | getst|
|000061c0| 61 6d 70 28 66 2c 26 6e | 68 64 72 2e 64 61 74 65 |amp(f,&n|hdr.date|
|000061d0| 2c 26 6e 68 64 72 2e 74 | 69 6d 65 29 3b 0a 0a 20 |,&nhdr.t|ime);.. |
|000061e0| 20 20 20 2f 2a 20 70 6f | 73 69 74 69 6f 6e 20 61 | /* po|sition a|
|000061f0| 72 63 68 69 76 65 20 74 | 6f 20 73 70 6f 74 20 66 |rchive t|o spot f|
|00006200| 6f 72 20 6e 65 77 20 66 | 69 6c 65 20 2a 2f 0a 0a |or new f|ile */..|
|00006210| 20 20 20 20 69 66 28 61 | 72 63 29 20 20 20 20 20 | if(a|rc) |
|00006220| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00006230| 20 20 20 20 20 20 20 2f | 2a 20 69 66 20 61 64 64 | /|* if add|
|00006240| 69 6e 67 20 74 6f 20 65 | 78 69 73 74 69 6e 67 20 |ing to e|xisting |
|00006250| 61 72 63 68 69 76 65 20 | 2a 2f 0a 20 20 20 20 7b |archive |*/. {|
|00006260| 20 20 20 20 73 74 61 72 | 74 73 20 3d 20 66 74 65 | star|ts = fte|
|00006270| 6c 6c 28 61 72 63 29 3b | 20 20 20 20 20 20 20 20 |ll(arc);| |
|00006280| 20 20 2f 2a 20 77 68 65 | 72 65 20 61 72 65 20 77 | /* whe|re are w|
|00006290| 65 3f 20 2a 2f 0a 20 20 | 20 20 20 20 20 20 20 77 |e? */. | w|
|000062a0| 68 69 6c 65 28 72 65 61 | 64 68 64 72 28 26 6f 68 |hile(rea|dhdr(&oh|
|000062b0| 64 72 2c 61 72 63 29 29 | 20 20 20 20 20 2f 2a 20 |dr,arc))| /* |
|000062c0| 77 68 69 6c 65 20 6d 6f | 72 65 20 66 69 6c 65 73 |while mo|re files|
|000062d0| 20 74 6f 20 63 68 65 63 | 6b 20 2a 2f 0a 20 20 20 | to chec|k */. |
|000062e0| 20 20 20 20 20 20 7b 20 | 20 20 20 69 66 28 21 73 | { | if(!s|
|000062f0| 74 72 63 6d 70 28 6f 68 | 64 72 2e 6e 61 6d 65 2c |trcmp(oh|dr.name,|
|00006300| 6e 68 64 72 2e 6e 61 6d | 65 29 29 0a 20 20 20 20 |nhdr.nam|e)). |
|00006310| 20 20 20 20 20 20 20 20 | 20 20 7b 20 20 20 20 75 | | { u|
|00006320| 70 64 20 3d 20 31 3b 20 | 20 20 20 20 20 20 20 20 |pd = 1; | |
|00006330| 20 20 20 2f 2a 20 72 65 | 70 6c 61 63 65 20 65 78 | /* re|place ex|
|00006340| 69 73 74 69 6e 67 20 65 | 6e 74 72 79 20 2a 2f 0a |isting e|ntry */.|
|00006350| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00006360| 20 20 20 69 66 28 75 70 | 64 61 74 65 20 7c 7c 20 | if(up|date || |
|00006370| 66 72 65 73 68 29 20 2f | 2a 20 69 66 20 75 70 64 |fresh) /|* if upd|
|00006380| 61 74 69 6e 67 20 6f 72 | 20 66 72 65 73 68 65 6e |ating or| freshen|
|00006390| 69 6e 67 20 2a 2f 0a 20 | 20 20 20 20 20 20 20 20 |ing */. | |
|000063a0| 20 20 20 20 20 20 20 20 | 20 20 7b 20 20 20 20 69 | | { i|
|000063b0| 66 28 6e 68 64 72 2e 64 | 61 74 65 3c 6f 68 64 72 |f(nhdr.d|ate<ohdr|
|000063c0| 2e 64 61 74 65 0a 20 20 | 20 20 20 20 20 20 20 20 |.date. | |
|000063d0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 7c 7c | | |||
|000063e0| 20 28 6e 68 64 72 2e 64 | 61 74 65 3d 3d 6f 68 64 | (nhdr.d|ate==ohd|
|000063f0| 72 2e 64 61 74 65 20 26 | 26 20 6e 68 64 72 2e 74 |r.date &|& nhdr.t|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.