home *** CD-ROM | disk | FTP | other *** search
open in:
MacOS 8.1
|
Win98
|
DOS
browse contents |
view JSON data
|
view as text
This file was processed as: Tape Archive
(archive/tar).
Confidence | Program | Detection | Match Type | Support
|
---|
100%
| dexvert
| Tape Archive (archive/tar)
| magic
| Supported |
20%
| dexvert
| Extreme Tracker (music/extremeTracker)
| fileSize
| Supported |
100%
| file
| tar archive
| default
| |
99%
| file
| tar archive (V7), file uuencode-1.0/uuencode.c, mode 664 , uid 115 , gid 1752 , size 12320 , seconds 5436210346
| default
| |
98%
| file
| data
| default
| |
100%
| siegfried
| x-fmt/265 Tape Archive Format
| default
| |
100%
| lsar
| Tar
| default
| |
100%
| gt2
| Kopftext: 'uuencode-1.0/uuencode.c'
| default (weak)
| |
100%
| disktype
| Pre-POSIX tar archive
| default
|
|
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 75 75 65 6e 63 6f 64 65 | 2d 31 2e 30 2f 75 75 65 |uuencode|-1.0/uue|
|00000010| 6e 63 6f 64 65 2e 63 00 | 00 00 00 00 00 00 00 00 |ncode.c.|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000050| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000060| 00 00 00 00 20 20 20 36 | 36 34 20 00 20 20 20 31 |.... 6|64 . 1|
|00000070| 31 35 20 00 20 20 31 37 | 35 32 20 00 20 20 20 20 |15 . 17|52 . |
|00000080| 20 20 31 32 33 32 30 20 | 20 35 34 33 36 32 31 30 | 12320 | 5436210|
|00000090| 33 34 36 20 20 31 30 32 | 35 34 00 20 00 00 00 00 |346 102|54. ....|
|000000a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000000b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000000c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000000d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000000e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000000f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000100| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000110| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000120| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000130| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000140| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000150| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000160| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000170| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000180| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000190| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000200| 2f 2a 0a 20 2a 20 43 6f | 70 79 72 69 67 68 74 20 |/*. * Co|pyright |
|00000210| 28 63 29 20 31 39 38 33 | 20 52 65 67 65 6e 74 73 |(c) 1983| Regents|
|00000220| 20 6f 66 20 74 68 65 20 | 55 6e 69 76 65 72 73 69 | of the |Universi|
|00000230| 74 79 20 6f 66 20 43 61 | 6c 69 66 6f 72 6e 69 61 |ty of Ca|lifornia|
|00000240| 2e 0a 20 2a 20 41 6c 6c | 20 72 69 67 68 74 73 20 |.. * All| rights |
|00000250| 72 65 73 65 72 76 65 64 | 2e 0a 20 2a 0a 20 2a 20 |reserved|.. *. * |
|00000260| 52 65 64 69 73 74 72 69 | 62 75 74 69 6f 6e 20 61 |Redistri|bution a|
|00000270| 6e 64 20 75 73 65 20 69 | 6e 20 73 6f 75 72 63 65 |nd use i|n source|
|00000280| 20 61 6e 64 20 62 69 6e | 61 72 79 20 66 6f 72 6d | and bin|ary form|
|00000290| 73 2c 20 77 69 74 68 20 | 6f 72 20 77 69 74 68 6f |s, with |or witho|
|000002a0| 75 74 0a 20 2a 20 6d 6f | 64 69 66 69 63 61 74 69 |ut. * mo|dificati|
|000002b0| 6f 6e 2c 20 61 72 65 20 | 70 65 72 6d 69 74 74 65 |on, are |permitte|
|000002c0| 64 20 70 72 6f 76 69 64 | 65 64 20 74 68 61 74 20 |d provid|ed that |
|000002d0| 74 68 65 20 66 6f 6c 6c | 6f 77 69 6e 67 20 63 6f |the foll|owing co|
|000002e0| 6e 64 69 74 69 6f 6e 73 | 0a 20 2a 20 61 72 65 20 |nditions|. * are |
|000002f0| 6d 65 74 3a 0a 20 2a 20 | 31 2e 20 52 65 64 69 73 |met:. * |1. Redis|
|00000300| 74 72 69 62 75 74 69 6f | 6e 73 20 6f 66 20 73 6f |tributio|ns of so|
|00000310| 75 72 63 65 20 63 6f 64 | 65 20 6d 75 73 74 20 72 |urce cod|e must r|
|00000320| 65 74 61 69 6e 20 74 68 | 65 20 61 62 6f 76 65 20 |etain th|e above |
|00000330| 63 6f 70 79 72 69 67 68 | 74 0a 20 2a 20 20 20 20 |copyrigh|t. * |
|00000340| 6e 6f 74 69 63 65 2c 20 | 74 68 69 73 20 6c 69 73 |notice, |this lis|
|00000350| 74 20 6f 66 20 63 6f 6e | 64 69 74 69 6f 6e 73 20 |t of con|ditions |
|00000360| 61 6e 64 20 74 68 65 20 | 66 6f 6c 6c 6f 77 69 6e |and the |followin|
|00000370| 67 20 64 69 73 63 6c 61 | 69 6d 65 72 2e 0a 20 2a |g discla|imer.. *|
|00000380| 20 32 2e 20 52 65 64 69 | 73 74 72 69 62 75 74 69 | 2. Redi|stributi|
|00000390| 6f 6e 73 20 69 6e 20 62 | 69 6e 61 72 79 20 66 6f |ons in b|inary fo|
|000003a0| 72 6d 20 6d 75 73 74 20 | 72 65 70 72 6f 64 75 63 |rm must |reproduc|
|000003b0| 65 20 74 68 65 20 61 62 | 6f 76 65 20 63 6f 70 79 |e the ab|ove copy|
|000003c0| 72 69 67 68 74 0a 20 2a | 20 20 20 20 6e 6f 74 69 |right. *| noti|
|000003d0| 63 65 2c 20 74 68 69 73 | 20 6c 69 73 74 20 6f 66 |ce, this| list of|
|000003e0| 20 63 6f 6e 64 69 74 69 | 6f 6e 73 20 61 6e 64 20 | conditi|ons and |
|000003f0| 74 68 65 20 66 6f 6c 6c | 6f 77 69 6e 67 20 64 69 |the foll|owing di|
|00000400| 73 63 6c 61 69 6d 65 72 | 20 69 6e 20 74 68 65 0a |sclaimer| in the.|
|00000410| 20 2a 20 20 20 20 64 6f | 63 75 6d 65 6e 74 61 74 | * do|cumentat|
|00000420| 69 6f 6e 20 61 6e 64 2f | 6f 72 20 6f 74 68 65 72 |ion and/|or other|
|00000430| 20 6d 61 74 65 72 69 61 | 6c 73 20 70 72 6f 76 69 | materia|ls provi|
|00000440| 64 65 64 20 77 69 74 68 | 20 74 68 65 20 64 69 73 |ded with| the dis|
|00000450| 74 72 69 62 75 74 69 6f | 6e 2e 0a 20 2a 20 33 2e |tributio|n.. * 3.|
|00000460| 20 41 6c 6c 20 61 64 76 | 65 72 74 69 73 69 6e 67 | All adv|ertising|
|00000470| 20 6d 61 74 65 72 69 61 | 6c 73 20 6d 65 6e 74 69 | materia|ls menti|
|00000480| 6f 6e 69 6e 67 20 66 65 | 61 74 75 72 65 73 20 6f |oning fe|atures o|
|00000490| 72 20 75 73 65 20 6f 66 | 20 74 68 69 73 20 73 6f |r use of| this so|
|000004a0| 66 74 77 61 72 65 0a 20 | 2a 20 20 20 20 6d 75 73 |ftware. |* mus|
|000004b0| 74 20 64 69 73 70 6c 61 | 79 20 74 68 65 20 66 6f |t displa|y the fo|
|000004c0| 6c 6c 6f 77 69 6e 67 20 | 61 63 6b 6e 6f 77 6c 65 |llowing |acknowle|
|000004d0| 64 67 65 6d 65 6e 74 3a | 0a 20 2a 09 54 68 69 73 |dgement:|. *.This|
|000004e0| 20 70 72 6f 64 75 63 74 | 20 69 6e 63 6c 75 64 65 | product| include|
|000004f0| 73 20 73 6f 66 74 77 61 | 72 65 20 64 65 76 65 6c |s softwa|re devel|
|00000500| 6f 70 65 64 20 62 79 20 | 74 68 65 20 55 6e 69 76 |oped by |the Univ|
|00000510| 65 72 73 69 74 79 20 6f | 66 0a 20 2a 09 43 61 6c |ersity o|f. *.Cal|
|00000520| 69 66 6f 72 6e 69 61 2c | 20 42 65 72 6b 65 6c 65 |ifornia,| Berkele|
|00000530| 79 20 61 6e 64 20 69 74 | 73 20 63 6f 6e 74 72 69 |y and it|s contri|
|00000540| 62 75 74 6f 72 73 2e 0a | 20 2a 20 34 2e 20 4e 65 |butors..| * 4. Ne|
|00000550| 69 74 68 65 72 20 74 68 | 65 20 6e 61 6d 65 20 6f |ither th|e name o|
|00000560| 66 20 74 68 65 20 55 6e | 69 76 65 72 73 69 74 79 |f the Un|iversity|
|00000570| 20 6e 6f 72 20 74 68 65 | 20 6e 61 6d 65 73 20 6f | nor the| names o|
|00000580| 66 20 69 74 73 20 63 6f | 6e 74 72 69 62 75 74 6f |f its co|ntributo|
|00000590| 72 73 0a 20 2a 20 20 20 | 20 6d 61 79 20 62 65 20 |rs. * | may be |
|000005a0| 75 73 65 64 20 74 6f 20 | 65 6e 64 6f 72 73 65 20 |used to |endorse |
|000005b0| 6f 72 20 70 72 6f 6d 6f | 74 65 20 70 72 6f 64 75 |or promo|te produ|
|000005c0| 63 74 73 20 64 65 72 69 | 76 65 64 20 66 72 6f 6d |cts deri|ved from|
|000005d0| 20 74 68 69 73 20 73 6f | 66 74 77 61 72 65 0a 20 | this so|ftware. |
|000005e0| 2a 20 20 20 20 77 69 74 | 68 6f 75 74 20 73 70 65 |* wit|hout spe|
|000005f0| 63 69 66 69 63 20 70 72 | 69 6f 72 20 77 72 69 74 |cific pr|ior writ|
|00000600| 74 65 6e 20 70 65 72 6d | 69 73 73 69 6f 6e 2e 0a |ten perm|ission..|
|00000610| 20 2a 0a 20 2a 20 54 48 | 49 53 20 53 4f 46 54 57 | *. * TH|IS SOFTW|
|00000620| 41 52 45 20 49 53 20 50 | 52 4f 56 49 44 45 44 20 |ARE IS P|ROVIDED |
|00000630| 42 59 20 54 48 45 20 52 | 45 47 45 4e 54 53 20 41 |BY THE R|EGENTS A|
|00000640| 4e 44 20 43 4f 4e 54 52 | 49 42 55 54 4f 52 53 20 |ND CONTR|IBUTORS |
|00000650| 60 60 41 53 20 49 53 27 | 27 20 41 4e 44 0a 20 2a |``AS IS'|' AND. *|
|00000660| 20 41 4e 59 20 45 58 50 | 52 45 53 53 20 4f 52 20 | ANY EXP|RESS OR |
|00000670| 49 4d 50 4c 49 45 44 20 | 57 41 52 52 41 4e 54 49 |IMPLIED |WARRANTI|
|00000680| 45 53 2c 20 49 4e 43 4c | 55 44 49 4e 47 2c 20 42 |ES, INCL|UDING, B|
|00000690| 55 54 20 4e 4f 54 20 4c | 49 4d 49 54 45 44 20 54 |UT NOT L|IMITED T|
|000006a0| 4f 2c 20 54 48 45 0a 20 | 2a 20 49 4d 50 4c 49 45 |O, THE. |* IMPLIE|
|000006b0| 44 20 57 41 52 52 41 4e | 54 49 45 53 20 4f 46 20 |D WARRAN|TIES OF |
|000006c0| 4d 45 52 43 48 41 4e 54 | 41 42 49 4c 49 54 59 20 |MERCHANT|ABILITY |
|000006d0| 41 4e 44 20 46 49 54 4e | 45 53 53 20 46 4f 52 20 |AND FITN|ESS FOR |
|000006e0| 41 20 50 41 52 54 49 43 | 55 4c 41 52 20 50 55 52 |A PARTIC|ULAR PUR|
|000006f0| 50 4f 53 45 0a 20 2a 20 | 41 52 45 20 44 49 53 43 |POSE. * |ARE DISC|
|00000700| 4c 41 49 4d 45 44 2e 20 | 20 49 4e 20 4e 4f 20 45 |LAIMED. | IN NO E|
|00000710| 56 45 4e 54 20 53 48 41 | 4c 4c 20 54 48 45 20 52 |VENT SHA|LL THE R|
|00000720| 45 47 45 4e 54 53 20 4f | 52 20 43 4f 4e 54 52 49 |EGENTS O|R CONTRI|
|00000730| 42 55 54 4f 52 53 20 42 | 45 20 4c 49 41 42 4c 45 |BUTORS B|E LIABLE|
|00000740| 0a 20 2a 20 46 4f 52 20 | 41 4e 59 20 44 49 52 45 |. * FOR |ANY DIRE|
|00000750| 43 54 2c 20 49 4e 44 49 | 52 45 43 54 2c 20 49 4e |CT, INDI|RECT, IN|
|00000760| 43 49 44 45 4e 54 41 4c | 2c 20 53 50 45 43 49 41 |CIDENTAL|, SPECIA|
|00000770| 4c 2c 20 45 58 45 4d 50 | 4c 41 52 59 2c 20 4f 52 |L, EXEMP|LARY, OR|
|00000780| 20 43 4f 4e 53 45 51 55 | 45 4e 54 49 41 4c 0a 20 | CONSEQU|ENTIAL. |
|00000790| 2a 20 44 41 4d 41 47 45 | 53 20 28 49 4e 43 4c 55 |* DAMAGE|S (INCLU|
|000007a0| 44 49 4e 47 2c 20 42 55 | 54 20 4e 4f 54 20 4c 49 |DING, BU|T NOT LI|
|000007b0| 4d 49 54 45 44 20 54 4f | 2c 20 50 52 4f 43 55 52 |MITED TO|, PROCUR|
|000007c0| 45 4d 45 4e 54 20 4f 46 | 20 53 55 42 53 54 49 54 |EMENT OF| SUBSTIT|
|000007d0| 55 54 45 20 47 4f 4f 44 | 53 0a 20 2a 20 4f 52 20 |UTE GOOD|S. * OR |
|000007e0| 53 45 52 56 49 43 45 53 | 3b 20 4c 4f 53 53 20 4f |SERVICES|; LOSS O|
|000007f0| 46 20 55 53 45 2c 20 44 | 41 54 41 2c 20 4f 52 20 |F USE, D|ATA, OR |
|00000800| 50 52 4f 46 49 54 53 3b | 20 4f 52 20 42 55 53 49 |PROFITS;| OR BUSI|
|00000810| 4e 45 53 53 20 49 4e 54 | 45 52 52 55 50 54 49 4f |NESS INT|ERRUPTIO|
|00000820| 4e 29 0a 20 2a 20 48 4f | 57 45 56 45 52 20 43 41 |N). * HO|WEVER CA|
|00000830| 55 53 45 44 20 41 4e 44 | 20 4f 4e 20 41 4e 59 20 |USED AND| ON ANY |
|00000840| 54 48 45 4f 52 59 20 4f | 46 20 4c 49 41 42 49 4c |THEORY O|F LIABIL|
|00000850| 49 54 59 2c 20 57 48 45 | 54 48 45 52 20 49 4e 20 |ITY, WHE|THER IN |
|00000860| 43 4f 4e 54 52 41 43 54 | 2c 20 53 54 52 49 43 54 |CONTRACT|, STRICT|
|00000870| 0a 20 2a 20 4c 49 41 42 | 49 4c 49 54 59 2c 20 4f |. * LIAB|ILITY, O|
|00000880| 52 20 54 4f 52 54 20 28 | 49 4e 43 4c 55 44 49 4e |R TORT (|INCLUDIN|
|00000890| 47 20 4e 45 47 4c 49 47 | 45 4e 43 45 20 4f 52 20 |G NEGLIG|ENCE OR |
|000008a0| 4f 54 48 45 52 57 49 53 | 45 29 20 41 52 49 53 49 |OTHERWIS|E) ARISI|
|000008b0| 4e 47 20 49 4e 20 41 4e | 59 20 57 41 59 0a 20 2a |NG IN AN|Y WAY. *|
|000008c0| 20 4f 55 54 20 4f 46 20 | 54 48 45 20 55 53 45 20 | OUT OF |THE USE |
|000008d0| 4f 46 20 54 48 49 53 20 | 53 4f 46 54 57 41 52 45 |OF THIS |SOFTWARE|
|000008e0| 2c 20 45 56 45 4e 20 49 | 46 20 41 44 56 49 53 45 |, EVEN I|F ADVISE|
|000008f0| 44 20 4f 46 20 54 48 45 | 20 50 4f 53 53 49 42 49 |D OF THE| POSSIBI|
|00000900| 4c 49 54 59 20 4f 46 0a | 20 2a 20 53 55 43 48 20 |LITY OF.| * SUCH |
|00000910| 44 41 4d 41 47 45 2e 0a | 20 2a 2f 0a 0a 2f 2a 20 |DAMAGE..| */../* |
|00000920| 52 65 77 6f 72 6b 65 64 | 20 74 6f 20 47 4e 55 20 |Reworked| to GNU |
|00000930| 73 74 79 6c 65 20 62 79 | 20 49 61 6e 20 4c 61 6e |style by| Ian Lan|
|00000940| 63 65 20 54 61 79 6c 6f | 72 2c 20 69 61 6e 40 61 |ce Taylo|r, ian@a|
|00000950| 69 72 73 2e 63 6f 6d 2c | 20 41 75 67 75 73 74 20 |irs.com,| August |
|00000960| 39 33 2e 20 20 2a 2f 0a | 0a 2f 2a 0a 20 2a 20 75 |93. */.|./*. * u|
|00000970| 75 65 6e 63 6f 64 65 20 | 5b 69 6e 70 75 74 5d 20 |uencode |[input] |
|00000980| 6f 75 74 70 75 74 0a 20 | 2a 0a 20 2a 20 45 6e 63 |output. |*. * Enc|
|00000990| 6f 64 65 20 61 20 66 69 | 6c 65 20 73 6f 20 69 74 |ode a fi|le so it|
|000009a0| 20 63 61 6e 20 62 65 20 | 6d 61 69 6c 65 64 20 74 | can be |mailed t|
|000009b0| 6f 20 61 20 72 65 6d 6f | 74 65 20 73 79 73 74 65 |o a remo|te syste|
|000009c0| 6d 2e 0a 20 2a 2f 0a 23 | 69 6e 63 6c 75 64 65 20 |m.. */.#|include |
|000009d0| 3c 73 79 73 2f 74 79 70 | 65 73 2e 68 3e 0a 23 69 |<sys/typ|es.h>.#i|
|000009e0| 6e 63 6c 75 64 65 20 3c | 73 79 73 2f 73 74 61 74 |nclude <|sys/stat|
|000009f0| 2e 68 3e 0a 23 69 6e 63 | 6c 75 64 65 20 3c 73 74 |.h>.#inc|lude <st|
|00000a00| 64 69 6f 2e 68 3e 0a 23 | 69 6e 63 6c 75 64 65 20 |dio.h>.#|include |
|00000a10| 22 67 65 74 6f 70 74 2e | 68 22 0a 0a 2f 2a 20 47 |"getopt.|h"../* G|
|00000a20| 65 74 20 64 65 66 69 6e | 69 74 69 6f 6e 73 20 66 |et defin|itions f|
|00000a30| 6f 72 20 74 68 65 20 66 | 69 6c 65 20 70 65 72 6d |or the f|ile perm|
|00000a40| 69 73 73 69 6f 6e 20 62 | 69 74 73 2e 20 20 2a 2f |ission b|its. */|
|00000a50| 0a 0a 23 69 66 6e 64 65 | 66 20 53 5f 49 52 57 58 |..#ifnde|f S_IRWX|
|00000a60| 55 0a 23 64 65 66 69 6e | 65 20 53 5f 49 52 57 58 |U.#defin|e S_IRWX|
|00000a70| 55 20 30 37 30 30 0a 23 | 65 6e 64 69 66 0a 23 69 |U 0700.#|endif.#i|
|00000a80| 66 6e 64 65 66 20 53 5f | 49 52 55 53 52 0a 23 64 |fndef S_|IRUSR.#d|
|00000a90| 65 66 69 6e 65 20 53 5f | 49 52 55 53 52 20 30 34 |efine S_|IRUSR 04|
|00000aa0| 30 30 0a 23 65 6e 64 69 | 66 0a 23 69 66 6e 64 65 |00.#endi|f.#ifnde|
|00000ab0| 66 20 53 5f 49 57 55 53 | 52 0a 23 64 65 66 69 6e |f S_IWUS|R.#defin|
|00000ac0| 65 20 53 5f 49 57 55 53 | 52 20 30 32 30 30 0a 23 |e S_IWUS|R 0200.#|
|00000ad0| 65 6e 64 69 66 0a 23 69 | 66 6e 64 65 66 20 53 5f |endif.#i|fndef S_|
|00000ae0| 49 58 55 53 52 0a 23 64 | 65 66 69 6e 65 20 53 5f |IXUSR.#d|efine S_|
|00000af0| 49 58 55 53 52 20 30 31 | 30 30 0a 23 65 6e 64 69 |IXUSR 01|00.#endi|
|00000b00| 66 0a 0a 23 69 66 6e 64 | 65 66 20 53 5f 49 52 57 |f..#ifnd|ef S_IRW|
|00000b10| 58 47 0a 23 64 65 66 69 | 6e 65 20 53 5f 49 52 57 |XG.#defi|ne S_IRW|
|00000b20| 58 47 20 30 30 37 30 0a | 23 65 6e 64 69 66 0a 23 |XG 0070.|#endif.#|
|00000b30| 69 66 6e 64 65 66 20 53 | 5f 49 52 47 52 50 0a 23 |ifndef S|_IRGRP.#|
|00000b40| 64 65 66 69 6e 65 20 53 | 5f 49 52 47 52 50 20 30 |define S|_IRGRP 0|
|00000b50| 30 34 30 0a 23 65 6e 64 | 69 66 0a 23 69 66 6e 64 |040.#end|if.#ifnd|
|00000b60| 65 66 20 53 5f 49 57 47 | 52 50 0a 23 64 65 66 69 |ef S_IWG|RP.#defi|
|00000b70| 6e 65 20 53 5f 49 57 47 | 52 50 20 30 30 32 30 0a |ne S_IWG|RP 0020.|
|00000b80| 23 65 6e 64 69 66 0a 23 | 69 66 6e 64 65 66 20 53 |#endif.#|ifndef S|
|00000b90| 5f 49 58 47 52 50 0a 23 | 64 65 66 69 6e 65 20 53 |_IXGRP.#|define S|
|00000ba0| 5f 49 58 47 52 50 20 30 | 30 31 30 0a 23 65 6e 64 |_IXGRP 0|010.#end|
|00000bb0| 69 66 0a 0a 23 69 66 6e | 64 65 66 20 53 5f 49 52 |if..#ifn|def S_IR|
|00000bc0| 57 58 4f 0a 23 64 65 66 | 69 6e 65 20 53 5f 49 52 |WXO.#def|ine S_IR|
|00000bd0| 57 58 4f 20 30 30 30 37 | 0a 23 65 6e 64 69 66 0a |WXO 0007|.#endif.|
|00000be0| 23 69 66 6e 64 65 66 20 | 53 5f 49 52 4f 54 48 0a |#ifndef |S_IROTH.|
|00000bf0| 23 64 65 66 69 6e 65 20 | 53 5f 49 52 4f 54 48 20 |#define |S_IROTH |
|00000c00| 30 30 30 34 0a 23 65 6e | 64 69 66 0a 23 69 66 6e |0004.#en|dif.#ifn|
|00000c10| 64 65 66 20 53 5f 49 57 | 4f 54 48 0a 23 64 65 66 |def S_IW|OTH.#def|
|00000c20| 69 6e 65 20 53 5f 49 57 | 4f 54 48 20 30 30 30 32 |ine S_IW|OTH 0002|
|00000c30| 0a 23 65 6e 64 69 66 0a | 23 69 66 6e 64 65 66 20 |.#endif.|#ifndef |
|00000c40| 53 5f 49 58 4f 54 48 0a | 23 64 65 66 69 6e 65 20 |S_IXOTH.|#define |
|00000c50| 53 5f 49 58 4f 54 48 20 | 30 30 30 31 0a 23 65 6e |S_IXOTH |0001.#en|
|00000c60| 64 69 66 0a 0a 23 64 65 | 66 69 6e 65 09 52 57 20 |dif..#de|fine.RW |
|00000c70| 28 53 5f 49 52 55 53 52 | 20 7c 20 53 5f 49 57 55 |(S_IRUSR| | S_IWU|
|00000c80| 53 52 20 7c 20 53 5f 49 | 52 47 52 50 20 7c 20 53 |SR | S_I|RGRP | S|
|00000c90| 5f 49 57 47 52 50 20 7c | 20 53 5f 49 52 4f 54 48 |_IWGRP || S_IROTH|
|00000ca0| 20 7c 20 53 5f 49 57 4f | 54 48 29 0a 0a 73 74 61 | | S_IWO|TH)..sta|
|00000cb0| 74 69 63 20 73 74 72 75 | 63 74 20 6f 70 74 69 6f |tic stru|ct optio|
|00000cc0| 6e 20 6c 6f 6e 67 6f 70 | 74 73 5b 5d 20 3d 0a 7b |n longop|ts[] =.{|
|00000cd0| 0a 20 20 7b 20 22 76 65 | 72 73 69 6f 6e 22 2c 20 |. { "ve|rsion", |
|00000ce0| 30 2c 20 30 2c 20 27 76 | 27 20 7d 2c 0a 20 20 7b |0, 0, 'v|' },. {|
|00000cf0| 20 22 68 65 6c 70 22 2c | 20 30 2c 20 30 2c 20 27 | "help",| 0, 0, '|
|00000d00| 68 27 20 7d 2c 0a 20 20 | 7b 20 4e 55 4c 4c 2c 20 |h' },. |{ NULL, |
|00000d10| 30 2c 20 30 2c 20 30 20 | 7d 0a 7d 3b 0a 0a 23 69 |0, 0, 0 |}.};..#i|
|00000d20| 66 20 5f 5f 53 54 44 43 | 5f 5f 0a 73 74 61 74 69 |f __STDC|__.stati|
|00000d30| 63 20 76 6f 69 64 20 65 | 6e 63 6f 64 65 20 28 76 |c void e|ncode (v|
|00000d40| 6f 69 64 29 3b 0a 73 74 | 61 74 69 63 20 76 6f 69 |oid);.st|atic voi|
|00000d50| 64 20 75 73 61 67 65 20 | 28 46 49 4c 45 20 2a 2c |d usage |(FILE *,|
|00000d60| 20 69 6e 74 29 3b 0a 23 | 65 6c 73 65 0a 73 74 61 | int);.#|else.sta|
|00000d70| 74 69 63 20 76 6f 69 64 | 20 65 6e 63 6f 64 65 20 |tic void| encode |
|00000d80| 28 29 3b 0a 73 74 61 74 | 69 63 20 76 6f 69 64 20 |();.stat|ic void |
|00000d90| 75 73 61 67 65 20 28 29 | 3b 0a 23 65 6e 64 69 66 |usage ()|;.#endif|
|00000da0| 0a 0a 65 78 74 65 72 6e | 20 63 68 61 72 20 76 65 |..extern| char ve|
|00000db0| 72 73 69 6f 6e 5b 5d 3b | 0a 73 74 61 74 69 63 20 |rsion[];|.static |
|00000dc0| 63 68 61 72 20 2a 70 72 | 6f 67 72 61 6d 5f 6e 61 |char *pr|ogram_na|
|00000dd0| 6d 65 3b 0a 0a 69 6e 74 | 0a 6d 61 69 6e 20 28 61 |me;..int|.main (a|
|00000de0| 72 67 63 2c 20 61 72 67 | 76 29 0a 20 20 20 20 20 |rgc, arg|v). |
|00000df0| 69 6e 74 20 61 72 67 63 | 3b 0a 20 20 20 20 20 63 |int argc|;. c|
|00000e00| 68 61 72 20 2a 2a 61 72 | 67 76 3b 0a 7b 0a 20 20 |har **ar|gv;.{. |
|00000e10| 69 6e 74 20 6f 70 74 3b | 0a 20 20 73 74 72 75 63 |int opt;|. struc|
|00000e20| 74 20 73 74 61 74 20 73 | 62 3b 0a 20 20 69 6e 74 |t stat s|b;. int|
|00000e30| 20 6d 6f 64 65 3b 0a 0a | 20 20 70 72 6f 67 72 61 | mode;..| progra|
|00000e40| 6d 5f 6e 61 6d 65 20 3d | 20 61 72 67 76 5b 30 5d |m_name =| argv[0]|
|00000e50| 3b 0a 0a 20 20 77 68 69 | 6c 65 20 28 28 6f 70 74 |;.. whi|le ((opt|
|00000e60| 20 3d 20 67 65 74 6f 70 | 74 5f 6c 6f 6e 67 20 28 | = getop|t_long (|
|00000e70| 61 72 67 63 2c 20 61 72 | 67 76 2c 20 22 68 76 22 |argc, ar|gv, "hv"|
|00000e80| 2c 20 6c 6f 6e 67 6f 70 | 74 73 2c 20 28 69 6e 74 |, longop|ts, (int|
|00000e90| 20 2a 29 20 4e 55 4c 4c | 29 29 0a 09 20 21 3d 20 | *) NULL|)).. != |
|00000ea0| 45 4f 46 29 0a 20 20 20 | 20 7b 0a 20 20 20 20 20 |EOF). | {. |
|00000eb0| 20 73 77 69 74 63 68 20 | 28 6f 70 74 29 0a 09 7b | switch |(opt)..{|
|00000ec0| 0a 09 63 61 73 65 20 27 | 68 27 3a 0a 09 20 20 70 |..case '|h':.. p|
|00000ed0| 72 69 6e 74 66 20 28 22 | 45 6e 63 6f 64 65 20 61 |rintf ("|Encode a|
|00000ee0| 20 66 69 6c 65 20 69 6e | 20 61 20 73 65 76 65 6e | file in| a seven|
|00000ef0| 20 62 69 74 20 66 6f 72 | 6d 61 74 5c 6e 22 29 3b | bit for|mat\n");|
|00000f00| 0a 09 20 20 75 73 61 67 | 65 20 28 73 74 64 6f 75 |.. usag|e (stdou|
|00000f10| 74 2c 20 30 29 3b 0a 0a | 09 63 61 73 65 20 27 76 |t, 0);..|.case 'v|
|00000f20| 27 3a 0a 09 20 20 70 72 | 69 6e 74 66 20 28 22 25 |':.. pr|intf ("%|
|00000f30| 73 5c 6e 22 2c 20 76 65 | 72 73 69 6f 6e 29 3b 0a |s\n", ve|rsion);.|
|00000f40| 09 20 20 65 78 69 74 20 | 28 30 29 3b 0a 0a 09 63 |. exit |(0);...c|
|00000f50| 61 73 65 20 30 3a 0a 09 | 20 20 62 72 65 61 6b 3b |ase 0:..| break;|
|00000f60| 0a 0a 09 64 65 66 61 75 | 6c 74 3a 0a 09 20 20 75 |...defau|lt:.. u|
|00000f70| 73 61 67 65 20 28 73 74 | 64 65 72 72 2c 20 31 29 |sage (st|derr, 1)|
|00000f80| 3b 0a 09 7d 0a 20 20 20 | 20 7d 0a 0a 20 20 73 77 |;..}. | }.. sw|
|00000f90| 69 74 63 68 20 28 61 72 | 67 63 20 2d 20 6f 70 74 |itch (ar|gc - opt|
|00000fa0| 69 6e 64 29 0a 20 20 20 | 20 7b 0a 20 20 20 20 63 |ind). | {. c|
|00000fb0| 61 73 65 20 32 3a 09 09 | 09 2f 2a 20 6f 70 74 69 |ase 2:..|./* opti|
|00000fc0| 6f 6e 61 6c 20 66 69 72 | 73 74 20 61 72 67 75 6d |onal fir|st argum|
|00000fd0| 65 6e 74 20 69 73 20 69 | 6e 70 75 74 20 66 69 6c |ent is i|nput fil|
|00000fe0| 65 20 2a 2f 0a 20 20 20 | 20 20 20 69 66 20 28 21 |e */. | if (!|
|00000ff0| 20 66 72 65 6f 70 65 6e | 20 28 61 72 67 76 5b 6f | freopen| (argv[o|
|00001000| 70 74 69 6e 64 5d 2c 20 | 22 72 22 2c 20 73 74 64 |ptind], |"r", std|
|00001010| 69 6e 29 0a 09 20 20 7c | 7c 20 66 73 74 61 74 20 |in).. ||| fstat |
|00001020| 28 66 69 6c 65 6e 6f 20 | 28 73 74 64 69 6e 29 2c |(fileno |(stdin),|
|00001030| 20 26 73 62 29 29 0a 09 | 7b 0a 09 20 20 66 70 72 | &sb))..|{.. fpr|
|00001040| 69 6e 74 66 20 28 73 74 | 64 65 72 72 2c 20 22 25 |intf (st|derr, "%|
|00001050| 73 3a 22 2c 20 70 72 6f | 67 72 61 6d 5f 6e 61 6d |s:", pro|gram_nam|
|00001060| 65 29 3b 0a 09 20 20 70 | 65 72 72 6f 72 20 28 61 |e);.. p|error (a|
|00001070| 72 67 76 5b 6f 70 74 69 | 6e 64 5d 29 3b 0a 09 20 |rgv[opti|nd]);.. |
|00001080| 20 65 78 69 74 28 31 29 | 3b 0a 09 7d 0a 20 20 20 | exit(1)|;..}. |
|00001090| 20 20 20 6d 6f 64 65 20 | 3d 20 73 62 2e 73 74 5f | mode |= sb.st_|
|000010a0| 6d 6f 64 65 20 26 20 28 | 53 5f 49 52 57 58 55 20 |mode & (|S_IRWXU |
|000010b0| 7c 20 53 5f 49 52 57 58 | 47 20 7c 20 53 5f 49 52 || S_IRWX|G | S_IR|
|000010c0| 57 58 4f 29 3b 0a 20 20 | 20 20 20 20 2b 2b 6f 70 |WXO);. | ++op|
|000010d0| 74 69 6e 64 3b 0a 20 20 | 20 20 20 20 62 72 65 61 |tind;. | brea|
|000010e0| 6b 3b 0a 20 20 20 20 63 | 61 73 65 20 31 3a 0a 20 |k;. c|ase 1:. |
|000010f0| 20 20 20 20 20 6d 6f 64 | 65 20 3d 20 52 57 20 26 | mod|e = RW &|
|00001100| 20 7e 75 6d 61 73 6b 20 | 28 52 57 29 3b 0a 20 20 | ~umask |(RW);. |
|00001110| 20 20 20 20 62 72 65 61 | 6b 3b 0a 20 20 20 20 63 | brea|k;. c|
|00001120| 61 73 65 20 30 3a 0a 20 | 20 20 20 64 65 66 61 75 |ase 0:. | defau|
|00001130| 6c 74 3a 0a 20 20 20 20 | 20 20 75 73 61 67 65 20 |lt:. | usage |
|00001140| 28 73 74 64 65 72 72 2c | 20 31 29 3b 0a 20 20 20 |(stderr,| 1);. |
|00001150| 20 7d 0a 0a 23 69 66 20 | 53 5f 49 52 57 58 55 20 | }..#if |S_IRWXU |
|00001160| 21 3d 20 30 37 30 30 0a | 20 23 65 72 72 6f 72 20 |!= 0700.| #error |
|00001170| 4d 75 73 74 20 74 72 61 | 6e 73 6c 61 74 65 20 6d |Must tra|nslate m|
|00001180| 6f 64 65 20 61 72 67 75 | 6d 65 6e 74 0a 23 65 6e |ode argu|ment.#en|
|00001190| 64 69 66 0a 0a 20 20 70 | 72 69 6e 74 66 20 28 22 |dif.. p|rintf ("|
|000011a0| 62 65 67 69 6e 20 25 6f | 20 25 73 5c 6e 22 2c 20 |begin %o| %s\n", |
|000011b0| 6d 6f 64 65 2c 20 61 72 | 67 76 5b 6f 70 74 69 6e |mode, ar|gv[optin|
|000011c0| 64 5d 29 3b 0a 20 20 65 | 6e 63 6f 64 65 20 28 29 |d]);. e|ncode ()|
|000011d0| 3b 0a 20 20 70 72 69 6e | 74 66 20 28 22 65 6e 64 |;. prin|tf ("end|
|000011e0| 5c 6e 22 29 3b 0a 20 20 | 69 66 20 28 66 65 72 72 |\n");. |if (ferr|
|000011f0| 6f 72 20 28 73 74 64 6f | 75 74 29 29 0a 20 20 20 |or (stdo|ut)). |
|00001200| 20 7b 0a 20 20 20 20 20 | 20 66 70 72 69 6e 74 66 | {. | fprintf|
|00001210| 20 28 73 74 64 65 72 72 | 2c 20 22 75 75 65 6e 63 | (stderr|, "uuenc|
|00001220| 6f 64 65 3a 20 77 72 69 | 74 65 20 65 72 72 6f 72 |ode: wri|te error|
|00001230| 5c 6e 22 29 3b 0a 20 20 | 20 20 20 20 65 78 69 74 |\n");. | exit|
|00001240| 20 28 31 29 3b 0a 20 20 | 20 20 7d 0a 20 20 65 78 | (1);. | }. ex|
|00001250| 69 74 20 28 30 29 3b 0a | 7d 0a 0a 2f 2a 20 45 4e |it (0);.|}../* EN|
|00001260| 43 20 69 73 20 74 68 65 | 20 62 61 73 69 63 20 31 |C is the| basic 1|
|00001270| 20 63 68 61 72 61 63 74 | 65 72 20 65 6e 63 6f 64 | charact|er encod|
|00001280| 69 6e 67 20 66 75 6e 63 | 74 69 6f 6e 20 74 6f 20 |ing func|tion to |
|00001290| 6d 61 6b 65 20 61 20 63 | 68 61 72 20 70 72 69 6e |make a c|har prin|
|000012a0| 74 69 6e 67 20 2a 2f 0a | 23 64 65 66 69 6e 65 09 |ting */.|#define.|
|000012b0| 45 4e 43 28 63 29 20 28 | 28 63 29 20 3f 20 28 28 |ENC(c) (|(c) ? ((|
|000012c0| 63 29 20 26 20 30 37 37 | 29 20 2b 20 27 20 27 3a |c) & 077|) + ' ':|
|000012d0| 20 27 60 27 29 0a 0a 2f | 2a 0a 20 2a 20 63 6f 70 | '`')../|*. * cop|
|000012e0| 79 20 66 72 6f 6d 20 69 | 6e 20 74 6f 20 6f 75 74 |y from i|n to out|
|000012f0| 2c 20 65 6e 63 6f 64 69 | 6e 67 20 61 73 20 79 6f |, encodi|ng as yo|
|00001300| 75 20 67 6f 20 61 6c 6f | 6e 67 2e 0a 20 2a 2f 0a |u go alo|ng.. */.|
|00001310| 73 74 61 74 69 63 20 76 | 6f 69 64 0a 65 6e 63 6f |static v|oid.enco|
|00001320| 64 65 20 28 29 0a 7b 0a | 20 20 72 65 67 69 73 74 |de ().{.| regist|
|00001330| 65 72 20 69 6e 74 20 63 | 68 2c 20 6e 3b 0a 20 20 |er int c|h, n;. |
|00001340| 72 65 67 69 73 74 65 72 | 20 63 68 61 72 20 2a 70 |register| char *p|
|00001350| 3b 0a 20 20 63 68 61 72 | 20 62 75 66 5b 38 30 5d |;. char| buf[80]|
|00001360| 3b 0a 0a 20 20 77 68 69 | 6c 65 20 28 28 6e 20 3d |;.. whi|le ((n =|
|00001370| 20 66 72 65 61 64 20 28 | 62 75 66 2c 20 31 2c 20 | fread (|buf, 1, |
|00001380| 34 35 2c 20 73 74 64 69 | 6e 29 29 20 21 3d 20 30 |45, stdi|n)) != 0|
|00001390| 29 0a 20 20 20 20 7b 0a | 20 20 20 20 20 20 63 68 |). {.| ch|
|000013a0| 20 3d 20 45 4e 43 20 28 | 6e 29 3b 0a 20 20 20 20 | = ENC (|n);. |
|000013b0| 20 20 69 66 20 28 70 75 | 74 63 68 61 72 20 28 63 | if (pu|tchar (c|
|000013c0| 68 29 20 3d 3d 20 45 4f | 46 29 0a 09 62 72 65 61 |h) == EO|F)..brea|
|000013d0| 6b 3b 0a 20 20 20 20 20 | 20 66 6f 72 20 28 70 20 |k;. | for (p |
|000013e0| 3d 20 62 75 66 3b 20 6e | 20 3e 20 30 3b 20 6e 20 |= buf; n| > 0; n |
|000013f0| 2d 3d 20 33 2c 20 70 20 | 2b 3d 20 33 29 0a 09 7b |-= 3, p |+= 3)..{|
|00001400| 0a 09 20 20 63 68 20 3d | 20 2a 70 20 3e 3e 20 32 |.. ch =| *p >> 2|
|00001410| 3b 0a 09 20 20 63 68 20 | 3d 20 45 4e 43 20 28 63 |;.. ch |= ENC (c|
|00001420| 68 29 3b 0a 09 20 20 69 | 66 20 28 70 75 74 63 68 |h);.. i|f (putch|
|00001430| 61 72 20 28 63 68 29 20 | 3d 3d 20 45 4f 46 29 0a |ar (ch) |== EOF).|
|00001440| 09 20 20 20 20 62 72 65 | 61 6b 3b 0a 09 20 20 63 |. bre|ak;.. c|
|00001450| 68 20 3d 20 28 28 2a 70 | 20 3c 3c 20 34 29 20 26 |h = ((*p| << 4) &|
|00001460| 20 30 36 30 29 20 7c 20 | 28 28 70 5b 31 5d 20 3e | 060) | |((p[1] >|
|00001470| 3e 20 34 29 20 26 20 30 | 31 37 29 3b 0a 09 20 20 |> 4) & 0|17);.. |
|00001480| 63 68 20 3d 20 45 4e 43 | 20 28 63 68 29 3b 0a 09 |ch = ENC| (ch);..|
|00001490| 20 20 69 66 20 28 70 75 | 74 63 68 61 72 20 28 63 | if (pu|tchar (c|
|000014a0| 68 29 20 3d 3d 20 45 4f | 46 29 0a 09 20 20 20 20 |h) == EO|F).. |
|000014b0| 62 72 65 61 6b 3b 0a 09 | 20 20 63 68 20 3d 20 28 |break;..| ch = (|
|000014c0| 28 70 5b 31 5d 20 3c 3c | 20 32 29 20 26 20 30 37 |(p[1] <<| 2) & 07|
|000014d0| 34 29 20 7c 20 28 28 70 | 5b 32 5d 20 3e 3e 20 36 |4) | ((p|[2] >> 6|
|000014e0| 29 20 26 20 30 33 29 3b | 0a 09 20 20 63 68 20 3d |) & 03);|.. ch =|
|000014f0| 20 45 4e 43 20 28 63 68 | 29 3b 0a 09 20 20 69 66 | ENC (ch|);.. if|
|00001500| 20 28 70 75 74 63 68 61 | 72 20 28 63 68 29 20 3d | (putcha|r (ch) =|
|00001510| 3d 20 45 4f 46 29 0a 09 | 20 20 20 20 62 72 65 61 |= EOF)..| brea|
|00001520| 6b 3b 0a 09 20 20 63 68 | 20 3d 20 70 5b 32 5d 20 |k;.. ch| = p[2] |
|00001530| 26 20 30 37 37 3b 0a 09 | 20 20 63 68 20 3d 20 45 |& 077;..| ch = E|
|00001540| 4e 43 20 28 63 68 29 3b | 0a 09 20 20 69 66 20 28 |NC (ch);|.. if (|
|00001550| 70 75 74 63 68 61 72 20 | 28 63 68 29 20 3d 3d 20 |putchar |(ch) == |
|00001560| 45 4f 46 29 0a 09 20 20 | 20 20 62 72 65 61 6b 3b |EOF).. | break;|
|00001570| 0a 09 7d 0a 20 20 20 20 | 20 20 69 66 20 28 70 75 |..}. | if (pu|
|00001580| 74 63 68 61 72 20 28 27 | 5c 6e 27 29 20 3d 3d 20 |tchar ('|\n') == |
|00001590| 45 4f 46 29 0a 09 62 72 | 65 61 6b 3b 0a 20 20 20 |EOF)..br|eak;. |
|000015a0| 20 7d 0a 20 20 69 66 20 | 28 66 65 72 72 6f 72 20 | }. if |(ferror |
|000015b0| 28 73 74 64 69 6e 29 29 | 0a 20 20 20 20 7b 0a 20 |(stdin))|. {. |
|000015c0| 20 20 20 20 20 66 70 72 | 69 6e 74 66 20 28 73 74 | fpr|intf (st|
|000015d0| 64 65 72 72 2c 20 22 75 | 75 65 6e 63 6f 64 65 3a |derr, "u|uencode:|
|000015e0| 20 72 65 61 64 20 65 72 | 72 6f 72 5c 6e 22 29 3b | read er|ror\n");|
|000015f0| 0a 20 20 20 20 20 20 65 | 78 69 74 28 31 29 3b 0a |. e|xit(1);.|
|00001600| 20 20 20 20 7d 0a 20 20 | 63 68 20 3d 20 45 4e 43 | }. |ch = ENC|
|00001610| 20 28 27 5c 30 27 29 3b | 0a 20 20 70 75 74 63 68 | ('\0');|. putch|
|00001620| 61 72 20 28 63 68 29 3b | 0a 20 20 70 75 74 63 68 |ar (ch);|. putch|
|00001630| 61 72 20 28 27 5c 6e 27 | 29 3b 0a 7d 0a 0a 73 74 |ar ('\n'|);.}..st|
|00001640| 61 74 69 63 20 76 6f 69 | 64 0a 75 73 61 67 65 20 |atic voi|d.usage |
|00001650| 28 66 2c 20 73 74 61 74 | 75 73 29 0a 20 20 20 20 |(f, stat|us). |
|00001660| 20 46 49 4c 45 20 2a 66 | 3b 0a 20 20 20 20 20 69 | FILE *f|;. i|
|00001670| 6e 74 20 73 74 61 74 75 | 73 3b 0a 7b 0a 20 20 66 |nt statu|s;.{. f|
|00001680| 70 72 69 6e 74 66 20 28 | 66 2c 20 22 55 73 61 67 |printf (|f, "Usag|
|00001690| 65 3a 20 25 73 20 5b 69 | 6e 66 69 6c 65 5d 20 72 |e: %s [i|nfile] r|
|000016a0| 65 6d 6f 74 65 66 69 6c | 65 5c 6e 22 2c 20 70 72 |emotefil|e\n", pr|
|000016b0| 6f 67 72 61 6d 5f 6e 61 | 6d 65 29 3b 0a 20 20 65 |ogram_na|me);. e|
|000016c0| 78 69 74 20 28 73 74 61 | 74 75 73 29 3b 0a 7d 0a |xit (sta|tus);.}.|
|000016d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000016e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000016f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001700| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001710| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001720| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001730| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001740| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001750| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001760| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001770| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001780| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001790| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000017a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000017b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000017c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000017d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000017e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000017f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001800| 75 75 65 6e 63 6f 64 65 | 2d 31 2e 30 2f 75 75 64 |uuencode|-1.0/uud|
|00001810| 65 63 6f 64 65 2e 63 00 | 00 00 00 00 00 00 00 00 |ecode.c.|........|
|00001820| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001830| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001840| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001850| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001860| 00 00 00 00 20 20 20 36 | 36 34 20 00 20 20 20 31 |.... 6|64 . 1|
|00001870| 31 35 20 00 20 20 31 37 | 35 32 20 00 20 20 20 20 |15 . 17|52 . |
|00001880| 20 20 31 35 32 31 35 20 | 20 35 34 33 36 32 31 35 | 15215 | 5436215|
|00001890| 30 30 36 20 20 31 30 32 | 34 36 00 20 00 00 00 00 |006 102|46. ....|
|000018a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000018b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000018c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000018d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000018e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000018f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001900| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001910| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001920| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001930| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001940| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001950| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001960| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001970| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001980| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001990| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000019a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000019b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000019c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000019d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000019e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000019f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001a00| 2f 2a 0a 20 2a 20 43 6f | 70 79 72 69 67 68 74 20 |/*. * Co|pyright |
|00001a10| 28 63 29 20 31 39 38 33 | 20 52 65 67 65 6e 74 73 |(c) 1983| Regents|
|00001a20| 20 6f 66 20 74 68 65 20 | 55 6e 69 76 65 72 73 69 | of the |Universi|
|00001a30| 74 79 20 6f 66 20 43 61 | 6c 69 66 6f 72 6e 69 61 |ty of Ca|lifornia|
|00001a40| 2e 0a 20 2a 20 41 6c 6c | 20 72 69 67 68 74 73 20 |.. * All| rights |
|00001a50| 72 65 73 65 72 76 65 64 | 2e 0a 20 2a 0a 20 2a 20 |reserved|.. *. * |
|00001a60| 52 65 64 69 73 74 72 69 | 62 75 74 69 6f 6e 20 61 |Redistri|bution a|
|00001a70| 6e 64 20 75 73 65 20 69 | 6e 20 73 6f 75 72 63 65 |nd use i|n source|
|00001a80| 20 61 6e 64 20 62 69 6e | 61 72 79 20 66 6f 72 6d | and bin|ary form|
|00001a90| 73 2c 20 77 69 74 68 20 | 6f 72 20 77 69 74 68 6f |s, with |or witho|
|00001aa0| 75 74 0a 20 2a 20 6d 6f | 64 69 66 69 63 61 74 69 |ut. * mo|dificati|
|00001ab0| 6f 6e 2c 20 61 72 65 20 | 70 65 72 6d 69 74 74 65 |on, are |permitte|
|00001ac0| 64 20 70 72 6f 76 69 64 | 65 64 20 74 68 61 74 20 |d provid|ed that |
|00001ad0| 74 68 65 20 66 6f 6c 6c | 6f 77 69 6e 67 20 63 6f |the foll|owing co|
|00001ae0| 6e 64 69 74 69 6f 6e 73 | 0a 20 2a 20 61 72 65 20 |nditions|. * are |
|00001af0| 6d 65 74 3a 0a 20 2a 20 | 31 2e 20 52 65 64 69 73 |met:. * |1. Redis|
|00001b00| 74 72 69 62 75 74 69 6f | 6e 73 20 6f 66 20 73 6f |tributio|ns of so|
|00001b10| 75 72 63 65 20 63 6f 64 | 65 20 6d 75 73 74 20 72 |urce cod|e must r|
|00001b20| 65 74 61 69 6e 20 74 68 | 65 20 61 62 6f 76 65 20 |etain th|e above |
|00001b30| 63 6f 70 79 72 69 67 68 | 74 0a 20 2a 20 20 20 20 |copyrigh|t. * |
|00001b40| 6e 6f 74 69 63 65 2c 20 | 74 68 69 73 20 6c 69 73 |notice, |this lis|
|00001b50| 74 20 6f 66 20 63 6f 6e | 64 69 74 69 6f 6e 73 20 |t of con|ditions |
|00001b60| 61 6e 64 20 74 68 65 20 | 66 6f 6c 6c 6f 77 69 6e |and the |followin|
|00001b70| 67 20 64 69 73 63 6c 61 | 69 6d 65 72 2e 0a 20 2a |g discla|imer.. *|
|00001b80| 20 32 2e 20 52 65 64 69 | 73 74 72 69 62 75 74 69 | 2. Redi|stributi|
|00001b90| 6f 6e 73 20 69 6e 20 62 | 69 6e 61 72 79 20 66 6f |ons in b|inary fo|
|00001ba0| 72 6d 20 6d 75 73 74 20 | 72 65 70 72 6f 64 75 63 |rm must |reproduc|
|00001bb0| 65 20 74 68 65 20 61 62 | 6f 76 65 20 63 6f 70 79 |e the ab|ove copy|
|00001bc0| 72 69 67 68 74 0a 20 2a | 20 20 20 20 6e 6f 74 69 |right. *| noti|
|00001bd0| 63 65 2c 20 74 68 69 73 | 20 6c 69 73 74 20 6f 66 |ce, this| list of|
|00001be0| 20 63 6f 6e 64 69 74 69 | 6f 6e 73 20 61 6e 64 20 | conditi|ons and |
|00001bf0| 74 68 65 20 66 6f 6c 6c | 6f 77 69 6e 67 20 64 69 |the foll|owing di|
|00001c00| 73 63 6c 61 69 6d 65 72 | 20 69 6e 20 74 68 65 0a |sclaimer| in the.|
|00001c10| 20 2a 20 20 20 20 64 6f | 63 75 6d 65 6e 74 61 74 | * do|cumentat|
|00001c20| 69 6f 6e 20 61 6e 64 2f | 6f 72 20 6f 74 68 65 72 |ion and/|or other|
|00001c30| 20 6d 61 74 65 72 69 61 | 6c 73 20 70 72 6f 76 69 | materia|ls provi|
|00001c40| 64 65 64 20 77 69 74 68 | 20 74 68 65 20 64 69 73 |ded with| the dis|
|00001c50| 74 72 69 62 75 74 69 6f | 6e 2e 0a 20 2a 20 33 2e |tributio|n.. * 3.|
|00001c60| 20 41 6c 6c 20 61 64 76 | 65 72 74 69 73 69 6e 67 | All adv|ertising|
|00001c70| 20 6d 61 74 65 72 69 61 | 6c 73 20 6d 65 6e 74 69 | materia|ls menti|
|00001c80| 6f 6e 69 6e 67 20 66 65 | 61 74 75 72 65 73 20 6f |oning fe|atures o|
|00001c90| 72 20 75 73 65 20 6f 66 | 20 74 68 69 73 20 73 6f |r use of| this so|
|00001ca0| 66 74 77 61 72 65 0a 20 | 2a 20 20 20 20 6d 75 73 |ftware. |* mus|
|00001cb0| 74 20 64 69 73 70 6c 61 | 79 20 74 68 65 20 66 6f |t displa|y the fo|
|00001cc0| 6c 6c 6f 77 69 6e 67 20 | 61 63 6b 6e 6f 77 6c 65 |llowing |acknowle|
|00001cd0| 64 67 65 6d 65 6e 74 3a | 0a 20 2a 09 54 68 69 73 |dgement:|. *.This|
|00001ce0| 20 70 72 6f 64 75 63 74 | 20 69 6e 63 6c 75 64 65 | product| include|
|00001cf0| 73 20 73 6f 66 74 77 61 | 72 65 20 64 65 76 65 6c |s softwa|re devel|
|00001d00| 6f 70 65 64 20 62 79 20 | 74 68 65 20 55 6e 69 76 |oped by |the Univ|
|00001d10| 65 72 73 69 74 79 20 6f | 66 0a 20 2a 09 43 61 6c |ersity o|f. *.Cal|
|00001d20| 69 66 6f 72 6e 69 61 2c | 20 42 65 72 6b 65 6c 65 |ifornia,| Berkele|
|00001d30| 79 20 61 6e 64 20 69 74 | 73 20 63 6f 6e 74 72 69 |y and it|s contri|
|00001d40| 62 75 74 6f 72 73 2e 0a | 20 2a 20 34 2e 20 4e 65 |butors..| * 4. Ne|
|00001d50| 69 74 68 65 72 20 74 68 | 65 20 6e 61 6d 65 20 6f |ither th|e name o|
|00001d60| 66 20 74 68 65 20 55 6e | 69 76 65 72 73 69 74 79 |f the Un|iversity|
|00001d70| 20 6e 6f 72 20 74 68 65 | 20 6e 61 6d 65 73 20 6f | nor the| names o|
|00001d80| 66 20 69 74 73 20 63 6f | 6e 74 72 69 62 75 74 6f |f its co|ntributo|
|00001d90| 72 73 0a 20 2a 20 20 20 | 20 6d 61 79 20 62 65 20 |rs. * | may be |
|00001da0| 75 73 65 64 20 74 6f 20 | 65 6e 64 6f 72 73 65 20 |used to |endorse |
|00001db0| 6f 72 20 70 72 6f 6d 6f | 74 65 20 70 72 6f 64 75 |or promo|te produ|
|00001dc0| 63 74 73 20 64 65 72 69 | 76 65 64 20 66 72 6f 6d |cts deri|ved from|
|00001dd0| 20 74 68 69 73 20 73 6f | 66 74 77 61 72 65 0a 20 | this so|ftware. |
|00001de0| 2a 20 20 20 20 77 69 74 | 68 6f 75 74 20 73 70 65 |* wit|hout spe|
|00001df0| 63 69 66 69 63 20 70 72 | 69 6f 72 20 77 72 69 74 |cific pr|ior writ|
|00001e00| 74 65 6e 20 70 65 72 6d | 69 73 73 69 6f 6e 2e 0a |ten perm|ission..|
|00001e10| 20 2a 0a 20 2a 20 54 48 | 49 53 20 53 4f 46 54 57 | *. * TH|IS SOFTW|
|00001e20| 41 52 45 20 49 53 20 50 | 52 4f 56 49 44 45 44 20 |ARE IS P|ROVIDED |
|00001e30| 42 59 20 54 48 45 20 52 | 45 47 45 4e 54 53 20 41 |BY THE R|EGENTS A|
|00001e40| 4e 44 20 43 4f 4e 54 52 | 49 42 55 54 4f 52 53 20 |ND CONTR|IBUTORS |
|00001e50| 60 60 41 53 20 49 53 27 | 27 20 41 4e 44 0a 20 2a |``AS IS'|' AND. *|
|00001e60| 20 41 4e 59 20 45 58 50 | 52 45 53 53 20 4f 52 20 | ANY EXP|RESS OR |
|00001e70| 49 4d 50 4c 49 45 44 20 | 57 41 52 52 41 4e 54 49 |IMPLIED |WARRANTI|
|00001e80| 45 53 2c 20 49 4e 43 4c | 55 44 49 4e 47 2c 20 42 |ES, INCL|UDING, B|
|00001e90| 55 54 20 4e 4f 54 20 4c | 49 4d 49 54 45 44 20 54 |UT NOT L|IMITED T|
|00001ea0| 4f 2c 20 54 48 45 0a 20 | 2a 20 49 4d 50 4c 49 45 |O, THE. |* IMPLIE|
|00001eb0| 44 20 57 41 52 52 41 4e | 54 49 45 53 20 4f 46 20 |D WARRAN|TIES OF |
|00001ec0| 4d 45 52 43 48 41 4e 54 | 41 42 49 4c 49 54 59 20 |MERCHANT|ABILITY |
|00001ed0| 41 4e 44 20 46 49 54 4e | 45 53 53 20 46 4f 52 20 |AND FITN|ESS FOR |
|00001ee0| 41 20 50 41 52 54 49 43 | 55 4c 41 52 20 50 55 52 |A PARTIC|ULAR PUR|
|00001ef0| 50 4f 53 45 0a 20 2a 20 | 41 52 45 20 44 49 53 43 |POSE. * |ARE DISC|
|00001f00| 4c 41 49 4d 45 44 2e 20 | 20 49 4e 20 4e 4f 20 45 |LAIMED. | IN NO E|
|00001f10| 56 45 4e 54 20 53 48 41 | 4c 4c 20 54 48 45 20 52 |VENT SHA|LL THE R|
|00001f20| 45 47 45 4e 54 53 20 4f | 52 20 43 4f 4e 54 52 49 |EGENTS O|R CONTRI|
|00001f30| 42 55 54 4f 52 53 20 42 | 45 20 4c 49 41 42 4c 45 |BUTORS B|E LIABLE|
|00001f40| 0a 20 2a 20 46 4f 52 20 | 41 4e 59 20 44 49 52 45 |. * FOR |ANY DIRE|
|00001f50| 43 54 2c 20 49 4e 44 49 | 52 45 43 54 2c 20 49 4e |CT, INDI|RECT, IN|
|00001f60| 43 49 44 45 4e 54 41 4c | 2c 20 53 50 45 43 49 41 |CIDENTAL|, SPECIA|
|00001f70| 4c 2c 20 45 58 45 4d 50 | 4c 41 52 59 2c 20 4f 52 |L, EXEMP|LARY, OR|
|00001f80| 20 43 4f 4e 53 45 51 55 | 45 4e 54 49 41 4c 0a 20 | CONSEQU|ENTIAL. |
|00001f90| 2a 20 44 41 4d 41 47 45 | 53 20 28 49 4e 43 4c 55 |* DAMAGE|S (INCLU|
|00001fa0| 44 49 4e 47 2c 20 42 55 | 54 20 4e 4f 54 20 4c 49 |DING, BU|T NOT LI|
|00001fb0| 4d 49 54 45 44 20 54 4f | 2c 20 50 52 4f 43 55 52 |MITED TO|, PROCUR|
|00001fc0| 45 4d 45 4e 54 20 4f 46 | 20 53 55 42 53 54 49 54 |EMENT OF| SUBSTIT|
|00001fd0| 55 54 45 20 47 4f 4f 44 | 53 0a 20 2a 20 4f 52 20 |UTE GOOD|S. * OR |
|00001fe0| 53 45 52 56 49 43 45 53 | 3b 20 4c 4f 53 53 20 4f |SERVICES|; LOSS O|
|00001ff0| 46 20 55 53 45 2c 20 44 | 41 54 41 2c 20 4f 52 20 |F USE, D|ATA, OR |
|00002000| 50 52 4f 46 49 54 53 3b | 20 4f 52 20 42 55 53 49 |PROFITS;| OR BUSI|
|00002010| 4e 45 53 53 20 49 4e 54 | 45 52 52 55 50 54 49 4f |NESS INT|ERRUPTIO|
|00002020| 4e 29 0a 20 2a 20 48 4f | 57 45 56 45 52 20 43 41 |N). * HO|WEVER CA|
|00002030| 55 53 45 44 20 41 4e 44 | 20 4f 4e 20 41 4e 59 20 |USED AND| ON ANY |
|00002040| 54 48 45 4f 52 59 20 4f | 46 20 4c 49 41 42 49 4c |THEORY O|F LIABIL|
|00002050| 49 54 59 2c 20 57 48 45 | 54 48 45 52 20 49 4e 20 |ITY, WHE|THER IN |
|00002060| 43 4f 4e 54 52 41 43 54 | 2c 20 53 54 52 49 43 54 |CONTRACT|, STRICT|
|00002070| 0a 20 2a 20 4c 49 41 42 | 49 4c 49 54 59 2c 20 4f |. * LIAB|ILITY, O|
|00002080| 52 20 54 4f 52 54 20 28 | 49 4e 43 4c 55 44 49 4e |R TORT (|INCLUDIN|
|00002090| 47 20 4e 45 47 4c 49 47 | 45 4e 43 45 20 4f 52 20 |G NEGLIG|ENCE OR |
|000020a0| 4f 54 48 45 52 57 49 53 | 45 29 20 41 52 49 53 49 |OTHERWIS|E) ARISI|
|000020b0| 4e 47 20 49 4e 20 41 4e | 59 20 57 41 59 0a 20 2a |NG IN AN|Y WAY. *|
|000020c0| 20 4f 55 54 20 4f 46 20 | 54 48 45 20 55 53 45 20 | OUT OF |THE USE |
|000020d0| 4f 46 20 54 48 49 53 20 | 53 4f 46 54 57 41 52 45 |OF THIS |SOFTWARE|
|000020e0| 2c 20 45 56 45 4e 20 49 | 46 20 41 44 56 49 53 45 |, EVEN I|F ADVISE|
|000020f0| 44 20 4f 46 20 54 48 45 | 20 50 4f 53 53 49 42 49 |D OF THE| POSSIBI|
|00002100| 4c 49 54 59 20 4f 46 0a | 20 2a 20 53 55 43 48 20 |LITY OF.| * SUCH |
|00002110| 44 41 4d 41 47 45 2e 0a | 20 2a 2f 0a 0a 2f 2a 20 |DAMAGE..| */../* |
|00002120| 52 65 77 6f 72 6b 65 64 | 20 74 6f 20 47 4e 55 20 |Reworked| to GNU |
|00002130| 73 74 79 6c 65 20 62 79 | 20 49 61 6e 20 4c 61 6e |style by| Ian Lan|
|00002140| 63 65 20 54 61 79 6c 6f | 72 2c 20 69 61 6e 40 61 |ce Taylo|r, ian@a|
|00002150| 69 72 73 2e 63 6f 6d 2c | 20 41 75 67 75 73 74 20 |irs.com,| August |
|00002160| 39 33 2e 20 20 2a 2f 0a | 0a 2f 2a 20 41 49 58 20 |93. */.|./* AIX |
|00002170| 72 65 71 75 69 72 65 73 | 20 74 68 69 73 20 74 6f |requires| this to|
|00002180| 20 62 65 20 74 68 65 20 | 66 69 72 73 74 20 74 68 | be the |first th|
|00002190| 69 6e 67 20 69 6e 20 74 | 68 65 20 66 69 6c 65 2e |ing in t|he file.|
|000021a0| 20 20 2a 2f 0a 23 69 66 | 20 64 65 66 69 6e 65 64 | */.#if| defined|
|000021b0| 20 28 5f 41 49 58 29 20 | 26 26 20 21 64 65 66 69 | (_AIX) |&& !defi|
|000021c0| 6e 65 64 20 28 5f 5f 47 | 4e 55 43 5f 5f 29 0a 20 |ned (__G|NUC__). |
|000021d0| 23 70 72 61 67 6d 61 20 | 61 6c 6c 6f 63 61 0a 23 |#pragma |alloca.#|
|000021e0| 65 6e 64 69 66 0a 0a 2f | 2a 0a 20 2a 20 75 75 64 |endif../|*. * uud|
|000021f0| 65 63 6f 64 65 20 5b 66 | 69 6c 65 20 2e 2e 2e 5d |ecode [f|ile ...]|
|00002200| 0a 20 2a 0a 20 2a 20 63 | 72 65 61 74 65 20 74 68 |. *. * c|reate th|
|00002210| 65 20 73 70 65 63 69 66 | 69 65 64 20 66 69 6c 65 |e specif|ied file|
|00002220| 2c 20 64 65 63 6f 64 69 | 6e 67 20 61 73 20 79 6f |, decodi|ng as yo|
|00002230| 75 20 67 6f 2e 0a 20 2a | 20 75 73 65 64 20 77 69 |u go.. *| used wi|
|00002240| 74 68 20 75 75 65 6e 63 | 6f 64 65 2e 0a 20 2a 2f |th uuenc|ode.. */|
|00002250| 0a 23 69 6e 63 6c 75 64 | 65 20 3c 73 79 73 2f 73 |.#includ|e <sys/s|
|00002260| 74 61 74 2e 68 3e 0a 23 | 69 6e 63 6c 75 64 65 20 |tat.h>.#|include |
|00002270| 3c 70 77 64 2e 68 3e 0a | 23 69 6e 63 6c 75 64 65 |<pwd.h>.|#include|
|00002280| 20 3c 73 74 64 69 6f 2e | 68 3e 0a 23 69 6e 63 6c | <stdio.|h>.#incl|
|00002290| 75 64 65 20 22 67 65 74 | 6f 70 74 2e 68 22 0a 0a |ude "get|opt.h"..|
|000022a0| 23 69 66 64 65 66 09 5f | 5f 47 4e 55 43 5f 5f 0a |#ifdef._|_GNUC__.|
|000022b0| 23 75 6e 64 65 66 09 61 | 6c 6c 6f 63 61 0a 23 64 |#undef.a|lloca.#d|
|000022c0| 65 66 69 6e 65 09 61 6c | 6c 6f 63 61 28 6e 29 09 |efine.al|loca(n).|
|000022d0| 5f 5f 62 75 69 6c 74 69 | 6e 5f 61 6c 6c 6f 63 61 |__builti|n_alloca|
|000022e0| 20 28 6e 29 0a 23 65 6c | 73 65 09 2f 2a 20 4e 6f | (n).#el|se./* No|
|000022f0| 74 20 47 43 43 2e 20 20 | 2a 2f 0a 23 69 66 64 65 |t GCC. |*/.#ifde|
|00002300| 66 09 48 41 56 45 5f 41 | 4c 4c 4f 43 41 5f 48 0a |f.HAVE_A|LLOCA_H.|
|00002310| 23 69 6e 63 6c 75 64 65 | 20 3c 61 6c 6c 6f 63 61 |#include| <alloca|
|00002320| 2e 68 3e 0a 23 65 6c 73 | 65 09 2f 2a 20 4e 6f 74 |.h>.#els|e./* Not|
|00002330| 20 48 41 56 45 5f 41 4c | 4c 4f 43 41 5f 48 2e 20 | HAVE_AL|LOCA_H. |
|00002340| 20 2a 2f 0a 23 69 66 6e | 64 65 66 09 5f 41 49 58 | */.#ifn|def._AIX|
|00002350| 0a 65 78 74 65 72 6e 20 | 63 68 61 72 20 2a 61 6c |.extern |char *al|
|00002360| 6c 6f 63 61 20 28 29 3b | 0a 23 65 6e 64 69 66 09 |loca ();|.#endif.|
|00002370| 2f 2a 20 4e 6f 74 20 41 | 49 58 2e 20 20 2a 2f 0a |/* Not A|IX. */.|
|00002380| 23 65 6e 64 69 66 09 2f | 2a 20 48 41 56 45 5f 41 |#endif./|* HAVE_A|
|00002390| 4c 4c 4f 43 41 5f 48 2e | 20 20 2a 2f 0a 23 65 6e |LLOCA_H.| */.#en|
|000023a0| 64 69 66 09 2f 2a 20 47 | 43 43 2e 20 20 2a 2f 0a |dif./* G|CC. */.|
|000023b0| 0a 2f 2a 20 47 65 74 20 | 64 65 66 69 6e 69 74 69 |./* Get |definiti|
|000023c0| 6f 6e 73 20 66 6f 72 20 | 74 68 65 20 66 69 6c 65 |ons for |the file|
|000023d0| 20 70 65 72 6d 69 73 73 | 69 6f 6e 20 62 69 74 73 | permiss|ion bits|
|000023e0| 2e 20 20 2a 2f 0a 0a 23 | 69 66 6e 64 65 66 20 53 |. */..#|ifndef S|
|000023f0| 5f 49 52 57 58 55 0a 23 | 64 65 66 69 6e 65 20 53 |_IRWXU.#|define S|
|00002400| 5f 49 52 57 58 55 20 30 | 37 30 30 0a 23 65 6e 64 |_IRWXU 0|700.#end|
|00002410| 69 66 0a 23 69 66 6e 64 | 65 66 20 53 5f 49 52 55 |if.#ifnd|ef S_IRU|
|00002420| 53 52 0a 23 64 65 66 69 | 6e 65 20 53 5f 49 52 55 |SR.#defi|ne S_IRU|
|00002430| 53 52 20 30 34 30 30 0a | 23 65 6e 64 69 66 0a 23 |SR 0400.|#endif.#|
|00002440| 69 66 6e 64 65 66 20 53 | 5f 49 57 55 53 52 0a 23 |ifndef S|_IWUSR.#|
|00002450| 64 65 66 69 6e 65 20 53 | 5f 49 57 55 53 52 20 30 |define S|_IWUSR 0|
|00002460| 32 30 30 0a 23 65 6e 64 | 69 66 0a 23 69 66 6e 64 |200.#end|if.#ifnd|
|00002470| 65 66 20 53 5f 49 58 55 | 53 52 0a 23 64 65 66 69 |ef S_IXU|SR.#defi|
|00002480| 6e 65 20 53 5f 49 58 55 | 53 52 20 30 31 30 30 0a |ne S_IXU|SR 0100.|
|00002490| 23 65 6e 64 69 66 0a 0a | 23 69 66 6e 64 65 66 20 |#endif..|#ifndef |
|000024a0| 53 5f 49 52 57 58 47 0a | 23 64 65 66 69 6e 65 20 |S_IRWXG.|#define |
|000024b0| 53 5f 49 52 57 58 47 20 | 30 30 37 30 0a 23 65 6e |S_IRWXG |0070.#en|
|000024c0| 64 69 66 0a 23 69 66 6e | 64 65 66 20 53 5f 49 52 |dif.#ifn|def S_IR|
|000024d0| 47 52 50 0a 23 64 65 66 | 69 6e 65 20 53 5f 49 52 |GRP.#def|ine S_IR|
|000024e0| 47 52 50 20 30 30 34 30 | 0a 23 65 6e 64 69 66 0a |GRP 0040|.#endif.|
|000024f0| 23 69 66 6e 64 65 66 20 | 53 5f 49 57 47 52 50 0a |#ifndef |S_IWGRP.|
|00002500| 23 64 65 66 69 6e 65 20 | 53 5f 49 57 47 52 50 20 |#define |S_IWGRP |
|00002510| 30 30 32 30 0a 23 65 6e | 64 69 66 0a 23 69 66 6e |0020.#en|dif.#ifn|
|00002520| 64 65 66 20 53 5f 49 58 | 47 52 50 0a 23 64 65 66 |def S_IX|GRP.#def|
|00002530| 69 6e 65 20 53 5f 49 58 | 47 52 50 20 30 30 31 30 |ine S_IX|GRP 0010|
|00002540| 0a 23 65 6e 64 69 66 0a | 0a 23 69 66 6e 64 65 66 |.#endif.|.#ifndef|
|00002550| 20 53 5f 49 52 57 58 4f | 0a 23 64 65 66 69 6e 65 | S_IRWXO|.#define|
|00002560| 20 53 5f 49 52 57 58 4f | 20 30 30 30 37 0a 23 65 | S_IRWXO| 0007.#e|
|00002570| 6e 64 69 66 0a 23 69 66 | 6e 64 65 66 20 53 5f 49 |ndif.#if|ndef S_I|
|00002580| 52 4f 54 48 0a 23 64 65 | 66 69 6e 65 20 53 5f 49 |ROTH.#de|fine S_I|
|00002590| 52 4f 54 48 20 30 30 30 | 34 0a 23 65 6e 64 69 66 |ROTH 000|4.#endif|
|000025a0| 0a 23 69 66 6e 64 65 66 | 20 53 5f 49 57 4f 54 48 |.#ifndef| S_IWOTH|
|000025b0| 0a 23 64 65 66 69 6e 65 | 20 53 5f 49 57 4f 54 48 |.#define| S_IWOTH|
|000025c0| 20 30 30 30 32 0a 23 65 | 6e 64 69 66 0a 23 69 66 | 0002.#e|ndif.#if|
|000025d0| 6e 64 65 66 20 53 5f 49 | 58 4f 54 48 0a 23 64 65 |ndef S_I|XOTH.#de|
|000025e0| 66 69 6e 65 20 53 5f 49 | 58 4f 54 48 20 30 30 30 |fine S_I|XOTH 000|
|000025f0| 31 0a 23 65 6e 64 69 66 | 0a 0a 73 74 61 74 69 63 |1.#endif|..static|
|00002600| 20 73 74 72 75 63 74 20 | 6f 70 74 69 6f 6e 20 6c | struct |option l|
|00002610| 6f 6e 67 6f 70 74 73 5b | 5d 20 3d 0a 7b 0a 20 20 |ongopts[|] =.{. |
|00002620| 7b 20 22 76 65 72 73 69 | 6f 6e 22 2c 20 30 2c 20 |{ "versi|on", 0, |
|00002630| 30 2c 20 27 76 27 20 7d | 2c 0a 20 20 7b 20 22 68 |0, 'v' }|,. { "h|
|00002640| 65 6c 70 22 2c 20 30 2c | 20 30 2c 20 27 68 27 20 |elp", 0,| 0, 'h' |
|00002650| 7d 2c 0a 20 20 7b 20 4e | 55 4c 4c 2c 20 30 2c 20 |},. { N|ULL, 0, |
|00002660| 30 2c 20 30 20 7d 0a 7d | 3b 0a 0a 23 69 66 20 5f |0, 0 }.}|;..#if _|
|00002670| 5f 53 54 44 43 5f 5f 0a | 73 74 61 74 69 63 20 69 |_STDC__.|static i|
|00002680| 6e 74 20 64 65 63 6f 64 | 65 20 28 63 68 61 72 20 |nt decod|e (char |
|00002690| 2a 29 3b 0a 73 74 61 74 | 69 63 20 76 6f 69 64 20 |*);.stat|ic void |
|000026a0| 75 73 61 67 65 20 28 46 | 49 4c 45 20 2a 2c 20 69 |usage (F|ILE *, i|
|000026b0| 6e 74 29 3b 0a 23 65 6c | 73 65 0a 73 74 61 74 69 |nt);.#el|se.stati|
|000026c0| 63 20 69 6e 74 20 64 65 | 63 6f 64 65 20 28 29 3b |c int de|code ();|
|000026d0| 0a 73 74 61 74 69 63 20 | 76 6f 69 64 20 75 73 61 |.static |void usa|
|000026e0| 67 65 20 28 29 3b 0a 23 | 65 6e 64 69 66 0a 0a 65 |ge ();.#|endif..e|
|000026f0| 78 74 65 72 6e 20 63 68 | 61 72 20 76 65 72 73 69 |xtern ch|ar versi|
|00002700| 6f 6e 5b 5d 3b 0a 73 74 | 61 74 69 63 20 63 68 61 |on[];.st|atic cha|
|00002710| 72 20 2a 70 72 6f 67 72 | 61 6d 5f 6e 61 6d 65 3b |r *progr|am_name;|
|00002720| 0a 0a 69 6e 74 0a 6d 61 | 69 6e 20 28 61 72 67 63 |..int.ma|in (argc|
|00002730| 2c 20 61 72 67 76 29 0a | 20 20 20 20 20 69 6e 74 |, argv).| int|
|00002740| 20 61 72 67 63 3b 0a 20 | 20 20 20 20 63 68 61 72 | argc;. | char|
|00002750| 20 2a 2a 61 72 67 76 3b | 0a 7b 0a 20 20 69 6e 74 | **argv;|.{. int|
|00002760| 20 6f 70 74 3b 0a 20 20 | 69 6e 74 20 72 76 61 6c | opt;. |int rval|
|00002770| 3b 0a 0a 20 20 70 72 6f | 67 72 61 6d 5f 6e 61 6d |;.. pro|gram_nam|
|00002780| 65 20 3d 20 61 72 67 76 | 5b 30 5d 3b 0a 0a 20 20 |e = argv|[0];.. |
|00002790| 77 68 69 6c 65 20 28 28 | 6f 70 74 20 3d 20 67 65 |while ((|opt = ge|
|000027a0| 74 6f 70 74 5f 6c 6f 6e | 67 20 28 61 72 67 63 2c |topt_lon|g (argc,|
|000027b0| 20 61 72 67 76 2c 20 22 | 68 76 22 2c 20 6c 6f 6e | argv, "|hv", lon|
|000027c0| 67 6f 70 74 73 2c 20 28 | 69 6e 74 20 2a 29 20 4e |gopts, (|int *) N|
|000027d0| 55 4c 4c 29 29 0a 09 20 | 21 3d 20 45 4f 46 29 0a |ULL)).. |!= EOF).|
|000027e0| 20 20 20 20 7b 0a 20 20 | 20 20 20 20 73 77 69 74 | {. | swit|
|000027f0| 63 68 20 28 6f 70 74 29 | 0a 09 7b 0a 09 63 61 73 |ch (opt)|..{..cas|
|00002800| 65 20 27 68 27 3a 0a 09 | 20 20 70 72 69 6e 74 66 |e 'h':..| printf|
|00002810| 20 28 22 44 65 63 6f 64 | 65 20 61 20 66 69 6c 65 | ("Decod|e a file|
|00002820| 20 63 72 65 61 74 65 64 | 20 62 79 20 75 75 65 6e | created| by uuen|
|00002830| 63 6f 64 65 5c 6e 22 29 | 3b 0a 09 20 20 75 73 61 |code\n")|;.. usa|
|00002840| 67 65 20 28 73 74 64 6f | 75 74 2c 20 30 29 3b 0a |ge (stdo|ut, 0);.|
|00002850| 0a 09 63 61 73 65 20 27 | 76 27 3a 0a 09 20 20 70 |..case '|v':.. p|
|00002860| 72 69 6e 74 66 20 28 22 | 25 73 5c 6e 22 2c 20 76 |rintf ("|%s\n", v|
|00002870| 65 72 73 69 6f 6e 29 3b | 0a 09 20 20 65 78 69 74 |ersion);|.. exit|
|00002880| 20 28 30 29 3b 0a 0a 09 | 63 61 73 65 20 30 3a 0a | (0);...|case 0:.|
|00002890| 09 20 20 62 72 65 61 6b | 3b 0a 0a 09 64 65 66 61 |. break|;...defa|
|000028a0| 75 6c 74 3a 0a 09 20 20 | 75 73 61 67 65 20 28 73 |ult:.. |usage (s|
|000028b0| 74 64 65 72 72 2c 20 31 | 29 3b 0a 09 7d 0a 20 20 |tderr, 1|);..}. |
|000028c0| 20 20 7d 0a 0a 20 20 69 | 66 20 28 6f 70 74 69 6e | }.. i|f (optin|
|000028d0| 64 20 3d 3d 20 61 72 67 | 63 29 0a 20 20 20 20 72 |d == arg|c). r|
|000028e0| 76 61 6c 20 3d 20 64 65 | 63 6f 64 65 20 28 28 63 |val = de|code ((c|
|000028f0| 68 61 72 20 2a 29 20 22 | 73 74 64 69 6e 22 29 3b |har *) "|stdin");|
|00002900| 0a 20 20 65 6c 73 65 0a | 20 20 20 20 7b 0a 20 20 |. else.| {. |
|00002910| 20 20 20 20 63 68 61 72 | 20 2a 66 69 6c 65 6e 61 | char| *filena|
|00002920| 6d 65 3b 0a 0a 20 20 20 | 20 20 20 72 76 61 6c 20 |me;.. | rval |
|00002930| 3d 20 30 3b 0a 20 20 20 | 20 20 20 64 6f 0a 09 7b |= 0;. | do..{|
|00002940| 0a 09 20 20 69 66 20 28 | 66 72 65 6f 70 65 6e 20 |.. if (|freopen |
|00002950| 28 61 72 67 76 5b 6f 70 | 74 69 6e 64 5d 2c 20 22 |(argv[op|tind], "|
|00002960| 72 22 2c 20 73 74 64 69 | 6e 29 20 21 3d 20 4e 55 |r", stdi|n) != NU|
|00002970| 4c 4c 29 0a 09 20 20 20 | 20 72 76 61 6c 20 7c 3d |LL).. | rval |=|
|00002980| 20 64 65 63 6f 64 65 20 | 28 61 72 67 76 5b 6f 70 | decode |(argv[op|
|00002990| 74 69 6e 64 5d 29 3b 0a | 09 20 20 65 6c 73 65 0a |tind]);.|. else.|
|000029a0| 09 20 20 20 20 7b 0a 09 | 20 20 20 20 20 20 66 70 |. {..| fp|
|000029b0| 72 69 6e 74 66 20 28 73 | 74 64 65 72 72 2c 20 22 |rintf (s|tderr, "|
|000029c0| 25 73 3a 22 2c 20 70 72 | 6f 67 72 61 6d 5f 6e 61 |%s:", pr|ogram_na|
|000029d0| 6d 65 29 3b 0a 09 20 20 | 20 20 20 20 70 65 72 72 |me);.. | perr|
|000029e0| 6f 72 20 28 61 72 67 76 | 5b 6f 70 74 69 6e 64 5d |or (argv|[optind]|
|000029f0| 29 3b 0a 09 20 20 20 20 | 20 20 72 76 61 6c 20 3d |);.. | rval =|
|00002a00| 20 31 3b 0a 09 20 20 20 | 20 7d 0a 09 20 20 2b 2b | 1;.. | }.. ++|
|00002a10| 6f 70 74 69 6e 64 3b 0a | 09 7d 0a 20 20 20 20 20 |optind;.|.}. |
|00002a20| 20 77 68 69 6c 65 20 28 | 6f 70 74 69 6e 64 20 3c | while (|optind <|
|00002a30| 20 61 72 67 63 29 3b 0a | 20 20 20 20 7d 0a 0a 20 | argc);.| }.. |
|00002a40| 20 65 78 69 74 20 28 72 | 76 61 6c 29 3b 0a 7d 0a | exit (r|val);.}.|
|00002a50| 0a 23 64 65 66 69 6e 65 | 09 44 45 43 28 63 29 09 |.#define|.DEC(c).|
|00002a60| 28 28 28 63 29 20 2d 20 | 27 20 27 29 20 26 20 30 |(((c) - |' ') & 0|
|00002a70| 37 37 29 20 2f 2a 20 73 | 69 6e 67 6c 65 20 63 68 |77) /* s|ingle ch|
|00002a80| 61 72 61 63 74 65 72 20 | 64 65 63 6f 64 65 20 2a |aracter |decode *|
|00002a90| 2f 0a 0a 73 74 61 74 69 | 63 20 69 6e 74 0a 64 65 |/..stati|c int.de|
|00002aa0| 63 6f 64 65 20 28 66 69 | 6c 65 6e 61 6d 65 29 0a |code (fi|lename).|
|00002ab0| 20 20 20 20 20 63 68 61 | 72 20 2a 66 69 6c 65 6e | cha|r *filen|
|00002ac0| 61 6d 65 3b 0a 7b 0a 20 | 20 73 74 72 75 63 74 20 |ame;.{. | struct |
|00002ad0| 70 61 73 73 77 64 20 2a | 70 77 3b 0a 20 20 72 65 |passwd *|pw;. re|
|00002ae0| 67 69 73 74 65 72 20 69 | 6e 74 20 6e 3b 0a 20 20 |gister i|nt n;. |
|00002af0| 72 65 67 69 73 74 65 72 | 20 63 68 61 72 20 63 68 |register| char ch|
|00002b00| 2c 20 2a 70 3b 0a 20 20 | 69 6e 74 20 6d 6f 64 65 |, *p;. |int mode|
|00002b10| 2c 20 6e 31 3b 0a 20 20 | 63 68 61 72 20 62 75 66 |, n1;. |char buf|
|00002b20| 5b 32 20 2a 20 42 55 46 | 53 49 5a 5d 3b 0a 20 20 |[2 * BUF|SIZ];. |
|00002b30| 63 68 61 72 20 2a 6f 75 | 74 6e 61 6d 65 3b 0a 0a |char *ou|tname;..|
|00002b40| 20 20 2f 2a 20 73 65 61 | 72 63 68 20 66 6f 72 20 | /* sea|rch for |
|00002b50| 68 65 61 64 65 72 20 6c | 69 6e 65 20 2a 2f 0a 20 |header l|ine */. |
|00002b60| 20 64 6f 0a 20 20 20 20 | 7b 0a 20 20 20 20 20 20 | do. |{. |
|00002b70| 69 66 20 28 66 67 65 74 | 73 20 28 62 75 66 2c 20 |if (fget|s (buf, |
|00002b80| 73 69 7a 65 6f 66 20 28 | 62 75 66 29 2c 20 73 74 |sizeof (|buf), st|
|00002b90| 64 69 6e 29 20 3d 3d 20 | 4e 55 4c 4c 29 0a 09 7b |din) == |NULL)..{|
|00002ba0| 0a 09 20 20 66 70 72 69 | 6e 74 66 20 28 73 74 64 |.. fpri|ntf (std|
|00002bb0| 65 72 72 2c 0a 09 09 20 | 20 22 25 73 3a 25 73 3a |err,... | "%s:%s:|
|00002bc0| 20 6e 6f 20 5c 22 62 65 | 67 69 6e 5c 22 20 6c 69 | no \"be|gin\" li|
|00002bd0| 6e 65 5c 6e 22 2c 20 70 | 72 6f 67 72 61 6d 5f 6e |ne\n", p|rogram_n|
|00002be0| 61 6d 65 2c 20 66 69 6c | 65 6e 61 6d 65 29 3b 0a |ame, fil|ename);.|
|00002bf0| 09 20 20 72 65 74 75 72 | 6e 20 31 3b 0a 09 7d 0a |. retur|n 1;..}.|
|00002c00| 20 20 20 20 7d 0a 20 20 | 77 68 69 6c 65 20 28 73 | }. |while (s|
|00002c10| 74 72 6e 63 6d 70 20 28 | 62 75 66 2c 20 22 62 65 |trncmp (|buf, "be|
|00002c20| 67 69 6e 20 22 2c 20 36 | 29 20 21 3d 20 30 29 3b |gin ", 6|) != 0);|
|00002c30| 0a 0a 20 20 73 73 63 61 | 6e 66 20 28 62 75 66 2c |.. ssca|nf (buf,|
|00002c40| 20 22 62 65 67 69 6e 20 | 25 6f 20 25 73 22 2c 20 | "begin |%o %s", |
|00002c50| 26 6d 6f 64 65 2c 20 62 | 75 66 29 3b 0a 0a 20 20 |&mode, b|uf);.. |
|00002c60| 2f 2a 20 68 61 6e 64 6c | 65 20 7e 75 73 65 72 2f |/* handl|e ~user/|
|00002c70| 66 69 6c 65 20 66 6f 72 | 6d 61 74 20 2a 2f 0a 20 |file for|mat */. |
|00002c80| 20 69 66 20 28 62 75 66 | 5b 30 5d 20 21 3d 20 27 | if (buf|[0] != '|
|00002c90| 7e 27 29 0a 20 20 20 20 | 6f 75 74 6e 61 6d 65 20 |~'). |outname |
|00002ca0| 3d 20 62 75 66 3b 0a 20 | 20 65 6c 73 65 0a 20 20 |= buf;. | else. |
|00002cb0| 20 20 7b 0a 20 20 20 20 | 20 20 70 20 3d 20 62 75 | {. | p = bu|
|00002cc0| 66 20 2b 20 31 3b 0a 20 | 20 20 20 20 20 77 68 69 |f + 1;. | whi|
|00002cd0| 6c 65 20 28 2a 70 20 21 | 3d 20 27 2f 27 29 0a 09 |le (*p !|= '/')..|
|00002ce0| 2b 2b 70 3b 0a 20 20 20 | 20 20 20 69 66 20 28 2a |++p;. | if (*|
|00002cf0| 70 20 3d 3d 20 27 5c 30 | 27 29 0a 09 7b 0a 09 20 |p == '\0|')..{.. |
|00002d00| 20 66 70 72 69 6e 74 66 | 20 28 73 74 64 65 72 72 | fprintf| (stderr|
|00002d10| 2c 20 22 25 73 3a 25 73 | 3a 20 69 6c 6c 65 67 61 |, "%s:%s|: illega|
|00002d20| 6c 20 7e 75 73 65 72 5c | 6e 22 2c 20 70 72 6f 67 |l ~user\|n", prog|
|00002d30| 72 61 6d 5f 6e 61 6d 65 | 2c 0a 09 09 20 20 20 66 |ram_name|,... f|
|00002d40| 69 6c 65 6e 61 6d 65 29 | 3b 0a 09 20 20 72 65 74 |ilename)|;.. ret|
|00002d50| 75 72 6e 20 31 3b 0a 09 | 7d 0a 20 20 20 20 20 20 |urn 1;..|}. |
|00002d60| 2a 70 2b 2b 20 3d 20 27 | 5c 30 27 3b 0a 20 20 20 |*p++ = '|\0';. |
|00002d70| 20 20 20 70 77 20 3d 20 | 67 65 74 70 77 6e 61 6d | pw = |getpwnam|
|00002d80| 20 28 62 75 66 20 2b 20 | 31 29 3b 0a 20 20 20 20 | (buf + |1);. |
|00002d90| 20 20 69 66 20 28 70 77 | 20 3d 3d 20 4e 55 4c 4c | if (pw| == NULL|
|00002da0| 29 0a 09 7b 0a 09 20 20 | 66 70 72 69 6e 74 66 20 |)..{.. |fprintf |
|00002db0| 28 73 74 64 65 72 72 2c | 20 22 25 73 3a 25 73 3a |(stderr,| "%s:%s:|
|00002dc0| 20 6e 6f 20 75 73 65 72 | 20 25 73 5c 6e 22 2c 20 | no user| %s\n", |
|00002dd0| 70 72 6f 67 72 61 6d 5f | 6e 61 6d 65 2c 0a 09 09 |program_|name,...|
|00002de0| 20 20 20 66 69 6c 65 6e | 61 6d 65 2c 20 62 75 66 | filen|ame, buf|
|00002df0| 20 2b 20 31 29 3b 0a 09 | 20 20 72 65 74 75 72 6e | + 1);..| return|
|00002e00| 20 31 3b 0a 09 7d 0a 20 | 20 20 20 20 20 6e 20 3d | 1;..}. | n =|
|00002e10| 20 73 74 72 6c 65 6e 20 | 28 70 77 2d 3e 70 77 5f | strlen |(pw->pw_|
|00002e20| 64 69 72 29 3b 0a 20 20 | 20 20 20 20 6e 31 20 3d |dir);. | n1 =|
|00002e30| 20 73 74 72 6c 65 6e 20 | 28 70 29 3b 0a 20 20 20 | strlen |(p);. |
|00002e40| 20 20 20 6f 75 74 6e 61 | 6d 65 20 3d 20 28 63 68 | outna|me = (ch|
|00002e50| 61 72 20 2a 29 20 61 6c | 6c 6f 63 61 20 28 6e 20 |ar *) al|loca (n |
|00002e60| 2b 20 6e 31 20 2b 20 32 | 29 3b 0a 20 20 20 20 20 |+ n1 + 2|);. |
|00002e70| 20 6d 65 6d 63 70 79 20 | 28 6f 75 74 6e 61 6d 65 | memcpy |(outname|
|00002e80| 20 2b 20 6e 20 2b 20 31 | 2c 20 70 2c 20 6e 31 20 | + n + 1|, p, n1 |
|00002e90| 2b 20 31 29 3b 0a 20 20 | 20 20 20 20 6d 65 6d 63 |+ 1);. | memc|
|00002ea0| 70 79 20 28 6f 75 74 6e | 61 6d 65 2c 20 70 77 2d |py (outn|ame, pw-|
|00002eb0| 3e 70 77 5f 64 69 72 2c | 20 6e 29 3b 0a 20 20 20 |>pw_dir,| n);. |
|00002ec0| 20 20 20 6f 75 74 6e 61 | 6d 65 5b 6e 5d 20 3d 20 | outna|me[n] = |
|00002ed0| 27 2f 27 3b 0a 20 20 20 | 20 7d 0a 0a 20 20 2f 2a |'/';. | }.. /*|
|00002ee0| 20 63 72 65 61 74 65 20 | 6f 75 74 70 75 74 20 66 | create |output f|
|00002ef0| 69 6c 65 2c 20 73 65 74 | 20 6d 6f 64 65 20 2a 2f |ile, set| mode */|
|00002f00| 0a 20 20 69 66 20 28 66 | 72 65 6f 70 65 6e 20 28 |. if (f|reopen (|
|00002f10| 6f 75 74 6e 61 6d 65 2c | 20 22 77 22 2c 20 73 74 |outname,| "w", st|
|00002f20| 64 6f 75 74 29 20 3d 3d | 20 4e 55 4c 4c 0a 20 20 |dout) ==| NULL. |
|00002f30| 20 20 20 20 7c 7c 20 66 | 63 68 6d 6f 64 20 28 66 | || f|chmod (f|
|00002f40| 69 6c 65 6e 6f 20 28 73 | 74 64 6f 75 74 29 2c 0a |ileno (s|tdout),.|
|00002f50| 09 09 20 6d 6f 64 65 20 | 26 20 28 53 5f 49 52 57 |.. mode |& (S_IRW|
|00002f60| 58 55 20 7c 20 53 5f 49 | 52 57 58 47 20 7c 20 53 |XU | S_I|RWXG | S|
|00002f70| 5f 49 52 57 58 4f 29 29 | 29 0a 20 20 20 20 7b 0a |_IRWXO))|). {.|
|00002f80| 20 20 20 20 20 20 66 70 | 72 69 6e 74 66 20 28 73 | fp|rintf (s|
|00002f90| 74 64 65 72 72 2c 20 22 | 25 73 3a 25 73 3a 22 2c |tderr, "|%s:%s:",|
|00002fa0| 20 70 72 6f 67 72 61 6d | 5f 6e 61 6d 65 2c 20 6f | program|_name, o|
|00002fb0| 75 74 6e 61 6d 65 29 3b | 0a 20 20 20 20 20 20 70 |utname);|. p|
|00002fc0| 65 72 72 6f 72 20 28 66 | 69 6c 65 6e 61 6d 65 29 |error (f|ilename)|
|00002fd0| 3b 0a 20 20 20 20 20 20 | 72 65 74 75 72 6e 20 31 |;. |return 1|
|00002fe0| 3b 0a 20 20 20 20 7d 0a | 0a 20 20 2f 2a 20 66 6f |;. }.|. /* fo|
|00002ff0| 72 20 65 61 63 68 20 69 | 6e 70 75 74 20 6c 69 6e |r each i|nput lin|
|00003000| 65 20 2a 2f 0a 20 20 77 | 68 69 6c 65 20 28 31 29 |e */. w|hile (1)|
|00003010| 0a 20 20 20 20 7b 0a 20 | 20 20 20 20 20 69 66 20 |. {. | if |
|00003020| 28 66 67 65 74 73 20 28 | 62 75 66 2c 20 73 69 7a |(fgets (|buf, siz|
|00003030| 65 6f 66 28 62 75 66 29 | 2c 20 73 74 64 69 6e 29 |eof(buf)|, stdin)|
|00003040| 20 3d 3d 20 4e 55 4c 4c | 29 0a 09 7b 0a 09 20 20 | == NULL|)..{.. |
|00003050| 66 70 72 69 6e 74 66 20 | 28 73 74 64 65 72 72 2c |fprintf |(stderr,|
|00003060| 20 22 25 73 3a 25 73 3a | 20 73 68 6f 72 74 20 66 | "%s:%s:| short f|
|00003070| 69 6c 65 2e 5c 6e 22 2c | 20 70 72 6f 67 72 61 6d |ile.\n",| program|
|00003080| 5f 6e 61 6d 65 2c 0a 09 | 09 20 20 20 66 69 6c 65 |_name,..|. file|
|00003090| 6e 61 6d 65 29 3b 0a 09 | 20 20 72 65 74 75 72 6e |name);..| return|
|000030a0| 20 31 3b 0a 09 7d 0a 20 | 20 20 20 20 20 70 20 3d | 1;..}. | p =|
|000030b0| 20 62 75 66 3b 0a 20 20 | 20 20 20 20 2f 2a 0a 20 | buf;. | /*. |
|000030c0| 20 20 20 20 20 20 2a 20 | 60 6e 27 20 69 73 20 75 | * |`n' is u|
|000030d0| 73 65 64 20 74 6f 20 61 | 76 6f 69 64 20 77 72 69 |sed to a|void wri|
|000030e0| 74 69 6e 67 20 6f 75 74 | 20 61 6c 6c 20 74 68 65 |ting out| all the|
|000030f0| 20 63 68 61 72 61 63 74 | 65 72 73 0a 20 20 20 20 | charact|ers. |
|00003100| 20 20 20 2a 20 61 74 20 | 74 68 65 20 65 6e 64 20 | * at |the end |
|00003110| 6f 66 20 74 68 65 20 66 | 69 6c 65 2e 0a 20 20 20 |of the f|ile.. |
|00003120| 20 20 20 20 2a 2f 0a 20 | 20 20 20 20 20 6e 20 3d | */. | n =|
|00003130| 20 44 45 43 20 28 2a 70 | 29 3b 0a 20 20 20 20 20 | DEC (*p|);. |
|00003140| 20 69 66 20 28 6e 20 3c | 3d 20 30 29 0a 09 62 72 | if (n <|= 0)..br|
|00003150| 65 61 6b 3b 0a 20 20 20 | 20 20 20 66 6f 72 20 28 |eak;. | for (|
|00003160| 2b 2b 70 3b 20 6e 20 3e | 20 30 3b 20 70 20 2b 3d |++p; n >| 0; p +=|
|00003170| 20 34 2c 20 6e 20 2d 3d | 20 33 29 0a 09 7b 0a 09 | 4, n -=| 3)..{..|
|00003180| 20 20 69 66 20 28 6e 20 | 3e 3d 20 33 29 0a 09 20 | if (n |>= 3).. |
|00003190| 20 20 20 7b 0a 09 20 20 | 20 20 20 20 63 68 20 3d | {.. | ch =|
|000031a0| 20 44 45 43 20 28 70 5b | 30 5d 29 20 3c 3c 20 32 | DEC (p[|0]) << 2|
|000031b0| 20 7c 20 44 45 43 20 28 | 70 5b 31 5d 29 20 3e 3e | | DEC (|p[1]) >>|
|000031c0| 20 34 3b 0a 09 20 20 20 | 20 20 20 70 75 74 63 68 | 4;.. | putch|
|000031d0| 61 72 20 28 63 68 29 3b | 0a 09 20 20 20 20 20 20 |ar (ch);|.. |
|000031e0| 63 68 20 3d 20 44 45 43 | 20 28 70 5b 31 5d 29 20 |ch = DEC| (p[1]) |
|000031f0| 3c 3c 20 34 20 7c 20 44 | 45 43 20 28 70 5b 32 5d |<< 4 | D|EC (p[2]|
|00003200| 29 20 3e 3e 20 32 3b 0a | 09 20 20 20 20 20 20 70 |) >> 2;.|. p|
|00003210| 75 74 63 68 61 72 20 28 | 63 68 29 3b 0a 09 20 20 |utchar (|ch);.. |
|00003220| 20 20 20 20 63 68 20 3d | 20 44 45 43 20 28 70 5b | ch =| DEC (p[|
|00003230| 32 5d 29 20 3c 3c 20 36 | 20 7c 20 44 45 43 20 28 |2]) << 6| | DEC (|
|00003240| 70 5b 33 5d 29 3b 0a 09 | 20 20 20 20 20 20 70 75 |p[3]);..| pu|
|00003250| 74 63 68 61 72 20 28 63 | 68 29 3b 0a 09 20 20 20 |tchar (c|h);.. |
|00003260| 20 7d 0a 09 20 20 65 6c | 73 65 0a 09 20 20 20 20 | }.. el|se.. |
|00003270| 7b 0a 09 20 20 20 20 20 | 20 69 66 20 28 6e 20 3e |{.. | if (n >|
|00003280| 3d 20 31 29 0a 09 09 7b | 0a 09 09 20 20 63 68 20 |= 1)...{|... ch |
|00003290| 3d 20 44 45 43 20 28 70 | 5b 30 5d 29 20 3c 3c 20 |= DEC (p|[0]) << |
|000032a0| 32 20 7c 20 44 45 43 20 | 28 70 5b 31 5d 29 20 3e |2 | DEC |(p[1]) >|
|000032b0| 3e 20 34 3b 0a 09 09 20 | 20 70 75 74 63 68 61 72 |> 4;... | putchar|
|000032c0| 20 28 63 68 29 3b 0a 09 | 09 7d 0a 09 20 20 20 20 | (ch);..|.}.. |
|000032d0| 20 20 69 66 20 28 6e 20 | 3e 3d 20 32 29 0a 09 09 | if (n |>= 2)...|
|000032e0| 7b 0a 09 09 20 20 63 68 | 20 3d 20 44 45 43 20 28 |{... ch| = DEC (|
|000032f0| 70 5b 31 5d 29 20 3c 3c | 20 34 20 7c 20 44 45 43 |p[1]) <<| 4 | DEC|
|00003300| 20 28 70 5b 32 5d 29 20 | 3e 3e 20 32 3b 0a 09 09 | (p[2]) |>> 2;...|
|00003310| 20 20 70 75 74 63 68 61 | 72 20 28 63 68 29 3b 0a | putcha|r (ch);.|
|00003320| 09 09 7d 0a 09 20 20 20 | 20 7d 0a 09 7d 0a 20 20 |..}.. | }..}. |
|00003330| 20 20 7d 0a 0a 20 20 69 | 66 20 28 66 67 65 74 73 | }.. i|f (fgets|
|00003340| 20 28 62 75 66 2c 20 73 | 69 7a 65 6f 66 28 62 75 | (buf, s|izeof(bu|
|00003350| 66 29 2c 20 73 74 64 69 | 6e 29 20 3d 3d 20 4e 55 |f), stdi|n) == NU|
|00003360| 4c 4c 0a 20 20 20 20 20 | 20 7c 7c 20 73 74 72 63 |LL. | || strc|
|00003370| 6d 70 20 28 62 75 66 2c | 20 22 65 6e 64 5c 6e 22 |mp (buf,| "end\n"|
|00003380| 29 29 0a 20 20 20 20 7b | 0a 20 20 20 20 20 20 66 |)). {|. f|
|00003390| 70 72 69 6e 74 66 20 28 | 73 74 64 65 72 72 2c 20 |printf (|stderr, |
|000033a0| 22 25 73 3a 25 73 3a 20 | 6e 6f 20 5c 22 65 6e 64 |"%s:%s: |no \"end|
|000033b0| 5c 22 20 6c 69 6e 65 2e | 5c 6e 22 2c 20 70 72 6f |\" line.|\n", pro|
|000033c0| 67 72 61 6d 5f 6e 61 6d | 65 2c 0a 09 20 20 20 20 |gram_nam|e,.. |
|000033d0| 20 20 20 66 69 6c 65 6e | 61 6d 65 29 3b 0a 20 20 | filen|ame);. |
|000033e0| 20 20 20 20 72 65 74 75 | 72 6e 20 31 3b 0a 20 20 | retu|rn 1;. |
|000033f0| 20 20 7d 0a 0a 20 20 72 | 65 74 75 72 6e 20 30 3b | }.. r|eturn 0;|
|00003400| 0a 7d 0a 0a 73 74 61 74 | 69 63 20 76 6f 69 64 0a |.}..stat|ic void.|
|00003410| 75 73 61 67 65 20 28 66 | 2c 20 73 74 61 74 75 73 |usage (f|, status|
|00003420| 29 0a 20 20 20 20 20 46 | 49 4c 45 20 2a 66 3b 0a |). F|ILE *f;.|
|00003430| 20 20 20 20 20 69 6e 74 | 20 73 74 61 74 75 73 3b | int| status;|
|00003440| 0a 7b 0a 20 20 66 70 72 | 69 6e 74 66 20 28 66 2c |.{. fpr|intf (f,|
|00003450| 20 22 75 73 61 67 65 3a | 20 25 73 20 5b 66 69 6c | "usage:| %s [fil|
|00003460| 65 20 2e 2e 2e 5d 5c 6e | 22 2c 20 70 72 6f 67 72 |e ...]\n|", progr|
|00003470| 61 6d 5f 6e 61 6d 65 29 | 3b 0a 20 20 65 78 69 74 |am_name)|;. exit|
|00003480| 20 28 73 74 61 74 75 73 | 29 3b 0a 7d 0a 00 00 00 | (status|);.}....|
|00003490| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000034a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000034b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000034c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000034d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000034e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000034f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003500| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003510| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003520| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003530| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003540| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003550| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003560| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003570| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003580| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003590| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000035a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000035b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000035c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000035d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000035e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000035f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003600| 75 75 65 6e 63 6f 64 65 | 2d 31 2e 30 2f 67 65 74 |uuencode|-1.0/get|
|00003610| 6f 70 74 2e 63 00 00 00 | 00 00 00 00 00 00 00 00 |opt.c...|........|
|00003620| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003630| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003640| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003650| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003660| 00 00 00 00 20 20 20 36 | 36 34 20 00 20 20 20 31 |.... 6|64 . 1|
|00003670| 31 35 20 00 20 20 31 37 | 35 32 20 00 20 20 20 20 |15 . 17|52 . |
|00003680| 20 20 35 30 36 31 34 20 | 20 35 34 33 36 32 30 34 | 50614 | 5436204|
|00003690| 31 37 32 20 20 20 37 37 | 35 37 00 20 00 00 00 00 |172 77|57. ....|
|000036a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000036b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000036c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000036d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000036e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000036f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003700| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003710| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003720| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003730| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003740| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003750| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003760| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003770| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003780| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003790| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000037a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000037b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000037c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000037d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000037e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000037f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003800| 2f 2a 20 47 65 74 6f 70 | 74 20 66 6f 72 20 47 4e |/* Getop|t for GN|
|00003810| 55 2e 0a 20 20 20 4e 4f | 54 45 3a 20 67 65 74 6f |U.. NO|TE: geto|
|00003820| 70 74 20 69 73 20 6e 6f | 77 20 70 61 72 74 20 6f |pt is no|w part o|
|00003830| 66 20 74 68 65 20 43 20 | 6c 69 62 72 61 72 79 2c |f the C |library,|
|00003840| 20 73 6f 20 69 66 20 79 | 6f 75 20 64 6f 6e 27 74 | so if y|ou don't|
|00003850| 20 6b 6e 6f 77 20 77 68 | 61 74 0a 20 20 20 22 4b | know wh|at. "K|
|00003860| 65 65 70 20 74 68 69 73 | 20 66 69 6c 65 20 6e 61 |eep this| file na|
|00003870| 6d 65 2d 73 70 61 63 65 | 20 63 6c 65 61 6e 22 20 |me-space| clean" |
|00003880| 6d 65 61 6e 73 2c 20 74 | 61 6c 6b 20 74 6f 20 72 |means, t|alk to r|
|00003890| 6f 6c 61 6e 64 40 67 6e | 75 2e 61 69 2e 6d 69 74 |oland@gn|u.ai.mit|
|000038a0| 2e 65 64 75 0a 20 20 20 | 62 65 66 6f 72 65 20 63 |.edu. |before c|
|000038b0| 68 61 6e 67 69 6e 67 20 | 69 74 21 0a 0a 20 20 20 |hanging |it!.. |
|000038c0| 43 6f 70 79 72 69 67 68 | 74 20 28 43 29 20 31 39 |Copyrigh|t (C) 19|
|000038d0| 38 37 2c 20 38 38 2c 20 | 38 39 2c 20 39 30 2c 20 |87, 88, |89, 90, |
|000038e0| 39 31 2c 20 39 32 2c 20 | 31 39 39 33 0a 20 20 20 |91, 92, |1993. |
|000038f0| 09 46 72 65 65 20 53 6f | 66 74 77 61 72 65 20 46 |.Free So|ftware F|
|00003900| 6f 75 6e 64 61 74 69 6f | 6e 2c 20 49 6e 63 2e 0a |oundatio|n, Inc..|
|00003910| 0a 20 20 20 54 68 69 73 | 20 70 72 6f 67 72 61 6d |. This| program|
|00003920| 20 69 73 20 66 72 65 65 | 20 73 6f 66 74 77 61 72 | is free| softwar|
|00003930| 65 3b 20 79 6f 75 20 63 | 61 6e 20 72 65 64 69 73 |e; you c|an redis|
|00003940| 74 72 69 62 75 74 65 20 | 69 74 20 61 6e 64 2f 6f |tribute |it and/o|
|00003950| 72 20 6d 6f 64 69 66 79 | 20 69 74 0a 20 20 20 75 |r modify| it. u|
|00003960| 6e 64 65 72 20 74 68 65 | 20 74 65 72 6d 73 20 6f |nder the| terms o|
|00003970| 66 20 74 68 65 20 47 4e | 55 20 47 65 6e 65 72 61 |f the GN|U Genera|
|00003980| 6c 20 50 75 62 6c 69 63 | 20 4c 69 63 65 6e 73 65 |l Public| License|
|00003990| 20 61 73 20 70 75 62 6c | 69 73 68 65 64 20 62 79 | as publ|ished by|
|000039a0| 20 74 68 65 0a 20 20 20 | 46 72 65 65 20 53 6f 66 | the. |Free Sof|
|000039b0| 74 77 61 72 65 20 46 6f | 75 6e 64 61 74 69 6f 6e |tware Fo|undation|
|000039c0| 3b 20 65 69 74 68 65 72 | 20 76 65 72 73 69 6f 6e |; either| version|
|000039d0| 20 32 2c 20 6f 72 20 28 | 61 74 20 79 6f 75 72 20 | 2, or (|at your |
|000039e0| 6f 70 74 69 6f 6e 29 20 | 61 6e 79 0a 20 20 20 6c |option) |any. l|
|000039f0| 61 74 65 72 20 76 65 72 | 73 69 6f 6e 2e 0a 0a 20 |ater ver|sion... |
|00003a00| 20 20 54 68 69 73 20 70 | 72 6f 67 72 61 6d 20 69 | This p|rogram i|
|00003a10| 73 20 64 69 73 74 72 69 | 62 75 74 65 64 20 69 6e |s distri|buted in|
|00003a20| 20 74 68 65 20 68 6f 70 | 65 20 74 68 61 74 20 69 | the hop|e that i|
|00003a30| 74 20 77 69 6c 6c 20 62 | 65 20 75 73 65 66 75 6c |t will b|e useful|
|00003a40| 2c 0a 20 20 20 62 75 74 | 20 57 49 54 48 4f 55 54 |,. but| WITHOUT|
|00003a50| 20 41 4e 59 20 57 41 52 | 52 41 4e 54 59 3b 20 77 | ANY WAR|RANTY; w|
|00003a60| 69 74 68 6f 75 74 20 65 | 76 65 6e 20 74 68 65 20 |ithout e|ven the |
|00003a70| 69 6d 70 6c 69 65 64 20 | 77 61 72 72 61 6e 74 79 |implied |warranty|
|00003a80| 20 6f 66 0a 20 20 20 4d | 45 52 43 48 41 4e 54 41 | of. M|ERCHANTA|
|00003a90| 42 49 4c 49 54 59 20 6f | 72 20 46 49 54 4e 45 53 |BILITY o|r FITNES|
|00003aa0| 53 20 46 4f 52 20 41 20 | 50 41 52 54 49 43 55 4c |S FOR A |PARTICUL|
|00003ab0| 41 52 20 50 55 52 50 4f | 53 45 2e 20 20 53 65 65 |AR PURPO|SE. See|
|00003ac0| 20 74 68 65 0a 20 20 20 | 47 4e 55 20 47 65 6e 65 | the. |GNU Gene|
|00003ad0| 72 61 6c 20 50 75 62 6c | 69 63 20 4c 69 63 65 6e |ral Publ|ic Licen|
|00003ae0| 73 65 20 66 6f 72 20 6d | 6f 72 65 20 64 65 74 61 |se for m|ore deta|
|00003af0| 69 6c 73 2e 0a 0a 20 20 | 20 59 6f 75 20 73 68 6f |ils... | You sho|
|00003b00| 75 6c 64 20 68 61 76 65 | 20 72 65 63 65 69 76 65 |uld have| receive|
|00003b10| 64 20 61 20 63 6f 70 79 | 20 6f 66 20 74 68 65 20 |d a copy| of the |
|00003b20| 47 4e 55 20 47 65 6e 65 | 72 61 6c 20 50 75 62 6c |GNU Gene|ral Publ|
|00003b30| 69 63 20 4c 69 63 65 6e | 73 65 0a 20 20 20 61 6c |ic Licen|se. al|
|00003b40| 6f 6e 67 20 77 69 74 68 | 20 74 68 69 73 20 70 72 |ong with| this pr|
|00003b50| 6f 67 72 61 6d 3b 20 69 | 66 20 6e 6f 74 2c 20 77 |ogram; i|f not, w|
|00003b60| 72 69 74 65 20 74 6f 20 | 74 68 65 20 46 72 65 65 |rite to |the Free|
|00003b70| 20 53 6f 66 74 77 61 72 | 65 0a 20 20 20 46 6f 75 | Softwar|e. Fou|
|00003b80| 6e 64 61 74 69 6f 6e 2c | 20 36 37 35 20 4d 61 73 |ndation,| 675 Mas|
|00003b90| 73 20 41 76 65 2c 20 43 | 61 6d 62 72 69 64 67 65 |s Ave, C|ambridge|
|00003ba0| 2c 20 4d 41 20 30 32 31 | 33 39 2c 20 55 53 41 2e |, MA 021|39, USA.|
|00003bb0| 20 20 2a 2f 0a 0c 0a 2f | 2a 20 4e 4f 54 45 21 21 | */.../|* NOTE!!|
|00003bc0| 21 20 20 41 49 58 20 72 | 65 71 75 69 72 65 73 20 |! AIX r|equires |
|00003bd0| 74 68 69 73 20 74 6f 20 | 62 65 20 74 68 65 20 66 |this to |be the f|
|00003be0| 69 72 73 74 20 74 68 69 | 6e 67 20 69 6e 20 74 68 |irst thi|ng in th|
|00003bf0| 65 20 66 69 6c 65 2e 0a | 20 20 20 44 6f 20 6e 6f |e file..| Do no|
|00003c00| 74 20 70 75 74 20 41 4e | 59 54 48 49 4e 47 20 62 |t put AN|YTHING b|
|00003c10| 65 66 6f 72 65 20 69 74 | 21 20 20 2a 2f 0a 23 69 |efore it|! */.#i|
|00003c20| 66 20 21 64 65 66 69 6e | 65 64 20 28 5f 5f 47 4e |f !defin|ed (__GN|
|00003c30| 55 43 5f 5f 29 20 26 26 | 20 64 65 66 69 6e 65 64 |UC__) &&| defined|
|00003c40| 20 28 5f 41 49 58 29 0a | 20 23 70 72 61 67 6d 61 | (_AIX).| #pragma|
|00003c50| 20 61 6c 6c 6f 63 61 0a | 23 65 6e 64 69 66 0a 0a | alloca.|#endif..|
|00003c60| 23 69 66 64 65 66 20 48 | 41 56 45 5f 43 4f 4e 46 |#ifdef H|AVE_CONF|
|00003c70| 49 47 5f 48 0a 23 69 6e | 63 6c 75 64 65 20 22 63 |IG_H.#in|clude "c|
|00003c80| 6f 6e 66 69 67 2e 68 22 | 0a 23 65 6e 64 69 66 0a |onfig.h"|.#endif.|
|00003c90| 0a 23 69 66 64 65 66 20 | 5f 5f 47 4e 55 43 5f 5f |.#ifdef |__GNUC__|
|00003ca0| 0a 23 64 65 66 69 6e 65 | 20 61 6c 6c 6f 63 61 20 |.#define| alloca |
|00003cb0| 5f 5f 62 75 69 6c 74 69 | 6e 5f 61 6c 6c 6f 63 61 |__builti|n_alloca|
|00003cc0| 0a 23 65 6c 73 65 20 2f | 2a 20 6e 6f 74 20 5f 5f |.#else /|* not __|
|00003cd0| 47 4e 55 43 5f 5f 20 2a | 2f 0a 23 69 66 20 64 65 |GNUC__ *|/.#if de|
|00003ce0| 66 69 6e 65 64 20 28 48 | 41 56 45 5f 41 4c 4c 4f |fined (H|AVE_ALLO|
|00003cf0| 43 41 5f 48 29 20 7c 7c | 20 28 64 65 66 69 6e 65 |CA_H) ||| (define|
|00003d00| 64 28 73 70 61 72 63 29 | 20 26 26 20 28 64 65 66 |d(sparc)| && (def|
|00003d10| 69 6e 65 64 28 73 75 6e | 29 20 7c 7c 20 28 21 64 |ined(sun|) || (!d|
|00003d20| 65 66 69 6e 65 64 28 55 | 53 47 29 20 26 26 20 21 |efined(U|SG) && !|
|00003d30| 64 65 66 69 6e 65 64 28 | 53 56 52 34 29 20 26 26 |defined(|SVR4) &&|
|00003d40| 20 21 64 65 66 69 6e 65 | 64 28 5f 5f 73 76 72 34 | !define|d(__svr4|
|00003d50| 5f 5f 29 29 29 29 0a 23 | 69 6e 63 6c 75 64 65 20 |__)))).#|include |
|00003d60| 3c 61 6c 6c 6f 63 61 2e | 68 3e 0a 23 65 6c 73 65 |<alloca.|h>.#else|
|00003d70| 0a 23 69 66 6e 64 65 66 | 20 5f 41 49 58 0a 63 68 |.#ifndef| _AIX.ch|
|00003d80| 61 72 20 2a 61 6c 6c 6f | 63 61 20 28 29 3b 0a 23 |ar *allo|ca ();.#|
|00003d90| 65 6e 64 69 66 0a 23 65 | 6e 64 69 66 20 2f 2a 20 |endif.#e|ndif /* |
|00003da0| 61 6c 6c 6f 63 61 2e 68 | 20 2a 2f 0a 23 65 6e 64 |alloca.h| */.#end|
|00003db0| 69 66 20 2f 2a 20 6e 6f | 74 20 5f 5f 47 4e 55 43 |if /* no|t __GNUC|
|00003dc0| 5f 5f 20 2a 2f 0a 0a 23 | 69 66 20 21 5f 5f 53 54 |__ */..#|if !__ST|
|00003dd0| 44 43 5f 5f 20 26 26 20 | 21 64 65 66 69 6e 65 64 |DC__ && |!defined|
|00003de0| 28 63 6f 6e 73 74 29 20 | 26 26 20 49 4e 5f 47 43 |(const) |&& IN_GC|
|00003df0| 43 0a 23 64 65 66 69 6e | 65 20 63 6f 6e 73 74 0a |C.#defin|e const.|
|00003e00| 23 65 6e 64 69 66 0a 0a | 2f 2a 20 54 68 69 73 20 |#endif..|/* This |
|00003e10| 74 65 6c 6c 73 20 41 6c | 70 68 61 20 4f 53 46 2f |tells Al|pha OSF/|
|00003e20| 31 20 6e 6f 74 20 74 6f | 20 64 65 66 69 6e 65 20 |1 not to| define |
|00003e30| 61 20 67 65 74 6f 70 74 | 20 70 72 6f 74 6f 74 79 |a getopt| prototy|
|00003e40| 70 65 20 69 6e 20 3c 73 | 74 64 69 6f 2e 68 3e 2e |pe in <s|tdio.h>.|
|00003e50| 20 20 2a 2f 0a 23 69 66 | 6e 64 65 66 20 5f 4e 4f | */.#if|ndef _NO|
|00003e60| 5f 50 52 4f 54 4f 0a 23 | 64 65 66 69 6e 65 20 5f |_PROTO.#|define _|
|00003e70| 4e 4f 5f 50 52 4f 54 4f | 0a 23 65 6e 64 69 66 0a |NO_PROTO|.#endif.|
|00003e80| 0a 23 69 6e 63 6c 75 64 | 65 20 3c 73 74 64 69 6f |.#includ|e <stdio|
|00003e90| 2e 68 3e 0a 0a 2f 2a 20 | 43 6f 6d 6d 65 6e 74 20 |.h>../* |Comment |
|00003ea0| 6f 75 74 20 61 6c 6c 20 | 74 68 69 73 20 63 6f 64 |out all |this cod|
|00003eb0| 65 20 69 66 20 77 65 20 | 61 72 65 20 75 73 69 6e |e if we |are usin|
|00003ec0| 67 20 74 68 65 20 47 4e | 55 20 43 20 4c 69 62 72 |g the GN|U C Libr|
|00003ed0| 61 72 79 2c 20 61 6e 64 | 20 61 72 65 20 6e 6f 74 |ary, and| are not|
|00003ee0| 0a 20 20 20 61 63 74 75 | 61 6c 6c 79 20 63 6f 6d |. actu|ally com|
|00003ef0| 70 69 6c 69 6e 67 20 74 | 68 65 20 6c 69 62 72 61 |piling t|he libra|
|00003f00| 72 79 20 69 74 73 65 6c | 66 2e 20 20 54 68 69 73 |ry itsel|f. This|
|00003f10| 20 63 6f 64 65 20 69 73 | 20 70 61 72 74 20 6f 66 | code is| part of|
|00003f20| 20 74 68 65 20 47 4e 55 | 20 43 0a 20 20 20 4c 69 | the GNU| C. Li|
|00003f30| 62 72 61 72 79 2c 20 62 | 75 74 20 61 6c 73 6f 20 |brary, b|ut also |
|00003f40| 69 6e 63 6c 75 64 65 64 | 20 69 6e 20 6d 61 6e 79 |included| in many|
|00003f50| 20 6f 74 68 65 72 20 47 | 4e 55 20 64 69 73 74 72 | other G|NU distr|
|00003f60| 69 62 75 74 69 6f 6e 73 | 2e 20 20 43 6f 6d 70 69 |ibutions|. Compi|
|00003f70| 6c 69 6e 67 0a 20 20 20 | 61 6e 64 20 6c 69 6e 6b |ling. |and link|
|00003f80| 69 6e 67 20 69 6e 20 74 | 68 69 73 20 63 6f 64 65 |ing in t|his code|
|00003f90| 20 69 73 20 61 20 77 61 | 73 74 65 20 77 68 65 6e | is a wa|ste when|
|00003fa0| 20 75 73 69 6e 67 20 74 | 68 65 20 47 4e 55 20 43 | using t|he GNU C|
|00003fb0| 20 6c 69 62 72 61 72 79 | 0a 20 20 20 28 65 73 70 | library|. (esp|
|00003fc0| 65 63 69 61 6c 6c 79 20 | 69 66 20 69 74 20 69 73 |ecially |if it is|
|00003fd0| 20 61 20 73 68 61 72 65 | 64 20 6c 69 62 72 61 72 | a share|d librar|
|00003fe0| 79 29 2e 20 20 52 61 74 | 68 65 72 20 74 68 61 6e |y). Rat|her than|
|00003ff0| 20 68 61 76 69 6e 67 20 | 65 76 65 72 79 20 47 4e | having |every GN|
|00004000| 55 0a 20 20 20 70 72 6f | 67 72 61 6d 20 75 6e 64 |U. pro|gram und|
|00004010| 65 72 73 74 61 6e 64 20 | 60 63 6f 6e 66 69 67 75 |erstand |`configu|
|00004020| 72 65 20 2d 2d 77 69 74 | 68 2d 67 6e 75 2d 6c 69 |re --wit|h-gnu-li|
|00004030| 62 63 27 20 61 6e 64 20 | 6f 6d 69 74 20 74 68 65 |bc' and |omit the|
|00004040| 20 6f 62 6a 65 63 74 20 | 66 69 6c 65 73 2c 0a 20 | object |files,. |
|00004050| 20 20 69 74 20 69 73 20 | 73 69 6d 70 6c 65 72 20 | it is |simpler |
|00004060| 74 6f 20 6a 75 73 74 20 | 64 6f 20 74 68 69 73 20 |to just |do this |
|00004070| 69 6e 20 74 68 65 20 73 | 6f 75 72 63 65 20 66 6f |in the s|ource fo|
|00004080| 72 20 65 61 63 68 20 73 | 75 63 68 20 66 69 6c 65 |r each s|uch file|
|00004090| 2e 20 20 2a 2f 0a 0a 23 | 69 66 20 64 65 66 69 6e |. */..#|if defin|
|000040a0| 65 64 20 28 5f 4c 49 42 | 43 29 20 7c 7c 20 21 64 |ed (_LIB|C) || !d|
|000040b0| 65 66 69 6e 65 64 20 28 | 5f 5f 47 4e 55 5f 4c 49 |efined (|__GNU_LI|
|000040c0| 42 52 41 52 59 5f 5f 29 | 0a 0a 0a 2f 2a 20 54 68 |BRARY__)|.../* Th|
|000040d0| 69 73 20 6e 65 65 64 73 | 20 74 6f 20 63 6f 6d 65 |is needs| to come|
|000040e0| 20 61 66 74 65 72 20 73 | 6f 6d 65 20 6c 69 62 72 | after s|ome libr|
|000040f0| 61 72 79 20 23 69 6e 63 | 6c 75 64 65 0a 20 20 20 |ary #inc|lude. |
|00004100| 74 6f 20 67 65 74 20 5f | 5f 47 4e 55 5f 4c 49 42 |to get _|_GNU_LIB|
|00004110| 52 41 52 59 5f 5f 20 64 | 65 66 69 6e 65 64 2e 20 |RARY__ d|efined. |
|00004120| 20 2a 2f 0a 23 69 66 64 | 65 66 09 5f 5f 47 4e 55 | */.#ifd|ef.__GNU|
|00004130| 5f 4c 49 42 52 41 52 59 | 5f 5f 0a 23 75 6e 64 65 |_LIBRARY|__.#unde|
|00004140| 66 09 61 6c 6c 6f 63 61 | 0a 2f 2a 20 44 6f 6e 27 |f.alloca|./* Don'|
|00004150| 74 20 69 6e 63 6c 75 64 | 65 20 73 74 64 6c 69 62 |t includ|e stdlib|
|00004160| 2e 68 20 66 6f 72 20 6e | 6f 6e 2d 47 4e 55 20 43 |.h for n|on-GNU C|
|00004170| 20 6c 69 62 72 61 72 69 | 65 73 20 62 65 63 61 75 | librari|es becau|
|00004180| 73 65 20 73 6f 6d 65 20 | 6f 66 20 74 68 65 6d 0a |se some |of them.|
|00004190| 20 20 20 63 6f 6e 74 61 | 69 6e 20 63 6f 6e 66 6c | conta|in confl|
|000041a0| 69 63 74 69 6e 67 20 70 | 72 6f 74 6f 74 79 70 65 |icting p|rototype|
|000041b0| 73 20 66 6f 72 20 67 65 | 74 6f 70 74 2e 20 20 2a |s for ge|topt. *|
|000041c0| 2f 0a 23 69 6e 63 6c 75 | 64 65 20 3c 73 74 64 6c |/.#inclu|de <stdl|
|000041d0| 69 62 2e 68 3e 0a 23 65 | 6c 73 65 09 2f 2a 20 4e |ib.h>.#e|lse./* N|
|000041e0| 6f 74 20 47 4e 55 20 43 | 20 6c 69 62 72 61 72 79 |ot GNU C| library|
|000041f0| 2e 20 20 2a 2f 0a 23 64 | 65 66 69 6e 65 09 5f 5f |. */.#d|efine.__|
|00004200| 61 6c 6c 6f 63 61 09 61 | 6c 6c 6f 63 61 0a 23 65 |alloca.a|lloca.#e|
|00004210| 6e 64 69 66 09 2f 2a 20 | 47 4e 55 20 43 20 6c 69 |ndif./* |GNU C li|
|00004220| 62 72 61 72 79 2e 20 20 | 2a 2f 0a 0a 2f 2a 20 49 |brary. |*/../* I|
|00004230| 66 20 47 45 54 4f 50 54 | 5f 43 4f 4d 50 41 54 20 |f GETOPT|_COMPAT |
|00004240| 69 73 20 64 65 66 69 6e | 65 64 2c 20 60 2b 27 20 |is defin|ed, `+' |
|00004250| 61 73 20 77 65 6c 6c 20 | 61 73 20 60 2d 2d 27 20 |as well |as `--' |
|00004260| 63 61 6e 20 69 6e 74 72 | 6f 64 75 63 65 20 61 0a |can intr|oduce a.|
|00004270| 20 20 20 6c 6f 6e 67 2d | 6e 61 6d 65 64 20 6f 70 | long-|named op|
|00004280| 74 69 6f 6e 2e 20 20 42 | 65 63 61 75 73 65 20 74 |tion. B|ecause t|
|00004290| 68 69 73 20 69 73 20 6e | 6f 74 20 50 4f 53 49 58 |his is n|ot POSIX|
|000042a0| 2e 32 20 63 6f 6d 70 6c | 69 61 6e 74 2c 20 69 74 |.2 compl|iant, it|
|000042b0| 20 69 73 0a 20 20 20 62 | 65 69 6e 67 20 70 68 61 | is. b|eing pha|
|000042c0| 73 65 64 20 6f 75 74 2e | 20 20 2a 2f 0a 2f 2a 20 |sed out.| */./* |
|000042d0| 23 64 65 66 69 6e 65 20 | 47 45 54 4f 50 54 5f 43 |#define |GETOPT_C|
|000042e0| 4f 4d 50 41 54 20 2a 2f | 0a 0a 2f 2a 20 54 68 69 |OMPAT */|../* Thi|
|000042f0| 73 20 76 65 72 73 69 6f | 6e 20 6f 66 20 60 67 65 |s versio|n of `ge|
|00004300| 74 6f 70 74 27 20 61 70 | 70 65 61 72 73 20 74 6f |topt' ap|pears to|
|00004310| 20 74 68 65 20 63 61 6c | 6c 65 72 20 6c 69 6b 65 | the cal|ler like|
|00004320| 20 73 74 61 6e 64 61 72 | 64 20 55 6e 69 78 20 60 | standar|d Unix `|
|00004330| 67 65 74 6f 70 74 27 0a | 20 20 20 62 75 74 20 69 |getopt'.| but i|
|00004340| 74 20 62 65 68 61 76 65 | 73 20 64 69 66 66 65 72 |t behave|s differ|
|00004350| 65 6e 74 6c 79 20 66 6f | 72 20 74 68 65 20 75 73 |ently fo|r the us|
|00004360| 65 72 2c 20 73 69 6e 63 | 65 20 69 74 20 61 6c 6c |er, sinc|e it all|
|00004370| 6f 77 73 20 74 68 65 20 | 75 73 65 72 0a 20 20 20 |ows the |user. |
|00004380| 74 6f 20 69 6e 74 65 72 | 73 70 65 72 73 65 20 74 |to inter|sperse t|
|00004390| 68 65 20 6f 70 74 69 6f | 6e 73 20 77 69 74 68 20 |he optio|ns with |
|000043a0| 74 68 65 20 6f 74 68 65 | 72 20 61 72 67 75 6d 65 |the othe|r argume|
|000043b0| 6e 74 73 2e 0a 0a 20 20 | 20 41 73 20 60 67 65 74 |nts... | As `get|
|000043c0| 6f 70 74 27 20 77 6f 72 | 6b 73 2c 20 69 74 20 70 |opt' wor|ks, it p|
|000043d0| 65 72 6d 75 74 65 73 20 | 74 68 65 20 65 6c 65 6d |ermutes |the elem|
|000043e0| 65 6e 74 73 20 6f 66 20 | 41 52 47 56 20 73 6f 20 |ents of |ARGV so |
|000043f0| 74 68 61 74 2c 0a 20 20 | 20 77 68 65 6e 20 69 74 |that,. | when it|
|00004400| 20 69 73 20 64 6f 6e 65 | 2c 20 61 6c 6c 20 74 68 | is done|, all th|
|00004410| 65 20 6f 70 74 69 6f 6e | 73 20 70 72 65 63 65 64 |e option|s preced|
|00004420| 65 20 65 76 65 72 79 74 | 68 69 6e 67 20 65 6c 73 |e everyt|hing els|
|00004430| 65 2e 20 20 54 68 75 73 | 0a 20 20 20 61 6c 6c 20 |e. Thus|. all |
|00004440| 61 70 70 6c 69 63 61 74 | 69 6f 6e 20 70 72 6f 67 |applicat|ion prog|
|00004450| 72 61 6d 73 20 61 72 65 | 20 65 78 74 65 6e 64 65 |rams are| extende|
|00004460| 64 20 74 6f 20 68 61 6e | 64 6c 65 20 66 6c 65 78 |d to han|dle flex|
|00004470| 69 62 6c 65 20 61 72 67 | 75 6d 65 6e 74 20 6f 72 |ible arg|ument or|
|00004480| 64 65 72 2e 0a 0a 20 20 | 20 53 65 74 74 69 6e 67 |der... | Setting|
|00004490| 20 74 68 65 20 65 6e 76 | 69 72 6f 6e 6d 65 6e 74 | the env|ironment|
|000044a0| 20 76 61 72 69 61 62 6c | 65 20 50 4f 53 49 58 4c | variabl|e POSIXL|
|000044b0| 59 5f 43 4f 52 52 45 43 | 54 20 64 69 73 61 62 6c |Y_CORREC|T disabl|
|000044c0| 65 73 20 70 65 72 6d 75 | 74 61 74 69 6f 6e 2e 0a |es permu|tation..|
|000044d0| 20 20 20 54 68 65 6e 20 | 74 68 65 20 62 65 68 61 | Then |the beha|
|000044e0| 76 69 6f 72 20 69 73 20 | 63 6f 6d 70 6c 65 74 65 |vior is |complete|
|000044f0| 6c 79 20 73 74 61 6e 64 | 61 72 64 2e 0a 0a 20 20 |ly stand|ard... |
|00004500| 20 47 4e 55 20 61 70 70 | 6c 69 63 61 74 69 6f 6e | GNU app|lication|
|00004510| 20 70 72 6f 67 72 61 6d | 73 20 63 61 6e 20 75 73 | program|s can us|
|00004520| 65 20 61 20 74 68 69 72 | 64 20 61 6c 74 65 72 6e |e a thir|d altern|
|00004530| 61 74 69 76 65 20 6d 6f | 64 65 20 69 6e 20 77 68 |ative mo|de in wh|
|00004540| 69 63 68 0a 20 20 20 74 | 68 65 79 20 63 61 6e 20 |ich. t|hey can |
|00004550| 64 69 73 74 69 6e 67 75 | 69 73 68 20 74 68 65 20 |distingu|ish the |
|00004560| 72 65 6c 61 74 69 76 65 | 20 6f 72 64 65 72 20 6f |relative| order o|
|00004570| 66 20 6f 70 74 69 6f 6e | 73 20 61 6e 64 20 6f 74 |f option|s and ot|
|00004580| 68 65 72 20 61 72 67 75 | 6d 65 6e 74 73 2e 20 20 |her argu|ments. |
|00004590| 2a 2f 0a 0a 23 69 6e 63 | 6c 75 64 65 20 22 67 65 |*/..#inc|lude "ge|
|000045a0| 74 6f 70 74 2e 68 22 0a | 0a 2f 2a 20 46 6f 72 20 |topt.h".|./* For |
|000045b0| 63 6f 6d 6d 75 6e 69 63 | 61 74 69 6f 6e 20 66 72 |communic|ation fr|
|000045c0| 6f 6d 20 60 67 65 74 6f | 70 74 27 20 74 6f 20 74 |om `geto|pt' to t|
|000045d0| 68 65 20 63 61 6c 6c 65 | 72 2e 0a 20 20 20 57 68 |he calle|r.. Wh|
|000045e0| 65 6e 20 60 67 65 74 6f | 70 74 27 20 66 69 6e 64 |en `geto|pt' find|
|000045f0| 73 20 61 6e 20 6f 70 74 | 69 6f 6e 20 74 68 61 74 |s an opt|ion that|
|00004600| 20 74 61 6b 65 73 20 61 | 6e 20 61 72 67 75 6d 65 | takes a|n argume|
|00004610| 6e 74 2c 0a 20 20 20 74 | 68 65 20 61 72 67 75 6d |nt,. t|he argum|
|00004620| 65 6e 74 20 76 61 6c 75 | 65 20 69 73 20 72 65 74 |ent valu|e is ret|
|00004630| 75 72 6e 65 64 20 68 65 | 72 65 2e 0a 20 20 20 41 |urned he|re.. A|
|00004640| 6c 73 6f 2c 20 77 68 65 | 6e 20 60 6f 72 64 65 72 |lso, whe|n `order|
|00004650| 69 6e 67 27 20 69 73 20 | 52 45 54 55 52 4e 5f 49 |ing' is |RETURN_I|
|00004660| 4e 5f 4f 52 44 45 52 2c | 0a 20 20 20 65 61 63 68 |N_ORDER,|. each|
|00004670| 20 6e 6f 6e 2d 6f 70 74 | 69 6f 6e 20 41 52 47 56 | non-opt|ion ARGV|
|00004680| 2d 65 6c 65 6d 65 6e 74 | 20 69 73 20 72 65 74 75 |-element| is retu|
|00004690| 72 6e 65 64 20 68 65 72 | 65 2e 20 20 2a 2f 0a 0a |rned her|e. */..|
|000046a0| 63 68 61 72 20 2a 6f 70 | 74 61 72 67 20 3d 20 30 |char *op|targ = 0|
|000046b0| 3b 0a 0a 2f 2a 20 49 6e | 64 65 78 20 69 6e 20 41 |;../* In|dex in A|
|000046c0| 52 47 56 20 6f 66 20 74 | 68 65 20 6e 65 78 74 20 |RGV of t|he next |
|000046d0| 65 6c 65 6d 65 6e 74 20 | 74 6f 20 62 65 20 73 63 |element |to be sc|
|000046e0| 61 6e 6e 65 64 2e 0a 20 | 20 20 54 68 69 73 20 69 |anned.. | This i|
|000046f0| 73 20 75 73 65 64 20 66 | 6f 72 20 63 6f 6d 6d 75 |s used f|or commu|
|00004700| 6e 69 63 61 74 69 6f 6e | 20 74 6f 20 61 6e 64 20 |nication| to and |
|00004710| 66 72 6f 6d 20 74 68 65 | 20 63 61 6c 6c 65 72 0a |from the| caller.|
|00004720| 20 20 20 61 6e 64 20 66 | 6f 72 20 63 6f 6d 6d 75 | and f|or commu|
|00004730| 6e 69 63 61 74 69 6f 6e | 20 62 65 74 77 65 65 6e |nication| between|
|00004740| 20 73 75 63 63 65 73 73 | 69 76 65 20 63 61 6c 6c | success|ive call|
|00004750| 73 20 74 6f 20 60 67 65 | 74 6f 70 74 27 2e 0a 0a |s to `ge|topt'...|
|00004760| 20 20 20 4f 6e 20 65 6e | 74 72 79 20 74 6f 20 60 | On en|try to `|
|00004770| 67 65 74 6f 70 74 27 2c | 20 7a 65 72 6f 20 6d 65 |getopt',| zero me|
|00004780| 61 6e 73 20 74 68 69 73 | 20 69 73 20 74 68 65 20 |ans this| is the |
|00004790| 66 69 72 73 74 20 63 61 | 6c 6c 3b 20 69 6e 69 74 |first ca|ll; init|
|000047a0| 69 61 6c 69 7a 65 2e 0a | 0a 20 20 20 57 68 65 6e |ialize..|. When|
|000047b0| 20 60 67 65 74 6f 70 74 | 27 20 72 65 74 75 72 6e | `getopt|' return|
|000047c0| 73 20 45 4f 46 2c 20 74 | 68 69 73 20 69 73 20 74 |s EOF, t|his is t|
|000047d0| 68 65 20 69 6e 64 65 78 | 20 6f 66 20 74 68 65 20 |he index| of the |
|000047e0| 66 69 72 73 74 20 6f 66 | 20 74 68 65 0a 20 20 20 |first of| the. |
|000047f0| 6e 6f 6e 2d 6f 70 74 69 | 6f 6e 20 65 6c 65 6d 65 |non-opti|on eleme|
|00004800| 6e 74 73 20 74 68 61 74 | 20 74 68 65 20 63 61 6c |nts that| the cal|
|00004810| 6c 65 72 20 73 68 6f 75 | 6c 64 20 69 74 73 65 6c |ler shou|ld itsel|
|00004820| 66 20 73 63 61 6e 2e 0a | 0a 20 20 20 4f 74 68 65 |f scan..|. Othe|
|00004830| 72 77 69 73 65 2c 20 60 | 6f 70 74 69 6e 64 27 20 |rwise, `|optind' |
|00004840| 63 6f 6d 6d 75 6e 69 63 | 61 74 65 73 20 66 72 6f |communic|ates fro|
|00004850| 6d 20 6f 6e 65 20 63 61 | 6c 6c 20 74 6f 20 74 68 |m one ca|ll to th|
|00004860| 65 20 6e 65 78 74 0a 20 | 20 20 68 6f 77 20 6d 75 |e next. | how mu|
|00004870| 63 68 20 6f 66 20 41 52 | 47 56 20 68 61 73 20 62 |ch of AR|GV has b|
|00004880| 65 65 6e 20 73 63 61 6e | 6e 65 64 20 73 6f 20 66 |een scan|ned so f|
|00004890| 61 72 2e 20 20 2a 2f 0a | 0a 2f 2a 20 58 58 58 20 |ar. */.|./* XXX |
|000048a0| 31 30 30 33 2e 32 20 73 | 61 79 73 20 74 68 69 73 |1003.2 s|ays this|
|000048b0| 20 6d 75 73 74 20 62 65 | 20 31 20 62 65 66 6f 72 | must be| 1 befor|
|000048c0| 65 20 61 6e 79 20 63 61 | 6c 6c 2e 20 20 2a 2f 0a |e any ca|ll. */.|
|000048d0| 69 6e 74 20 6f 70 74 69 | 6e 64 20 3d 20 30 3b 0a |int opti|nd = 0;.|
|000048e0| 0a 2f 2a 20 54 68 65 20 | 6e 65 78 74 20 63 68 61 |./* The |next cha|
|000048f0| 72 20 74 6f 20 62 65 20 | 73 63 61 6e 6e 65 64 20 |r to be |scanned |
|00004900| 69 6e 20 74 68 65 20 6f | 70 74 69 6f 6e 2d 65 6c |in the o|ption-el|
|00004910| 65 6d 65 6e 74 0a 20 20 | 20 69 6e 20 77 68 69 63 |ement. | in whic|
|00004920| 68 20 74 68 65 20 6c 61 | 73 74 20 6f 70 74 69 6f |h the la|st optio|
|00004930| 6e 20 63 68 61 72 61 63 | 74 65 72 20 77 65 20 72 |n charac|ter we r|
|00004940| 65 74 75 72 6e 65 64 20 | 77 61 73 20 66 6f 75 6e |eturned |was foun|
|00004950| 64 2e 0a 20 20 20 54 68 | 69 73 20 61 6c 6c 6f 77 |d.. Th|is allow|
|00004960| 73 20 75 73 20 74 6f 20 | 70 69 63 6b 20 75 70 20 |s us to |pick up |
|00004970| 74 68 65 20 73 63 61 6e | 20 77 68 65 72 65 20 77 |the scan| where w|
|00004980| 65 20 6c 65 66 74 20 6f | 66 66 2e 0a 0a 20 20 20 |e left o|ff... |
|00004990| 49 66 20 74 68 69 73 20 | 69 73 20 7a 65 72 6f 2c |If this |is zero,|
|000049a0| 20 6f 72 20 61 20 6e 75 | 6c 6c 20 73 74 72 69 6e | or a nu|ll strin|
|000049b0| 67 2c 20 69 74 20 6d 65 | 61 6e 73 20 72 65 73 75 |g, it me|ans resu|
|000049c0| 6d 65 20 74 68 65 20 73 | 63 61 6e 0a 20 20 20 62 |me the s|can. b|
|000049d0| 79 20 61 64 76 61 6e 63 | 69 6e 67 20 74 6f 20 74 |y advanc|ing to t|
|000049e0| 68 65 20 6e 65 78 74 20 | 41 52 47 56 2d 65 6c 65 |he next |ARGV-ele|
|000049f0| 6d 65 6e 74 2e 20 20 2a | 2f 0a 0a 73 74 61 74 69 |ment. *|/..stati|
|00004a00| 63 20 63 68 61 72 20 2a | 6e 65 78 74 63 68 61 72 |c char *|nextchar|
|00004a10| 3b 0a 0a 2f 2a 20 43 61 | 6c 6c 65 72 73 20 73 74 |;../* Ca|llers st|
|00004a20| 6f 72 65 20 7a 65 72 6f | 20 68 65 72 65 20 74 6f |ore zero| here to|
|00004a30| 20 69 6e 68 69 62 69 74 | 20 74 68 65 20 65 72 72 | inhibit| the err|
|00004a40| 6f 72 20 6d 65 73 73 61 | 67 65 0a 20 20 20 66 6f |or messa|ge. fo|
|00004a50| 72 20 75 6e 72 65 63 6f | 67 6e 69 7a 65 64 20 6f |r unreco|gnized o|
|00004a60| 70 74 69 6f 6e 73 2e 20 | 20 2a 2f 0a 0a 69 6e 74 |ptions. | */..int|
|00004a70| 20 6f 70 74 65 72 72 20 | 3d 20 31 3b 0a 0a 2f 2a | opterr |= 1;../*|
|00004a80| 20 53 65 74 20 74 6f 20 | 61 6e 20 6f 70 74 69 6f | Set to |an optio|
|00004a90| 6e 20 63 68 61 72 61 63 | 74 65 72 20 77 68 69 63 |n charac|ter whic|
|00004aa0| 68 20 77 61 73 20 75 6e | 72 65 63 6f 67 6e 69 7a |h was un|recogniz|
|00004ab0| 65 64 2e 0a 20 20 20 54 | 68 69 73 20 6d 75 73 74 |ed.. T|his must|
|00004ac0| 20 62 65 20 69 6e 69 74 | 69 61 6c 69 7a 65 64 20 | be init|ialized |
|00004ad0| 6f 6e 20 73 6f 6d 65 20 | 73 79 73 74 65 6d 73 20 |on some |systems |
|00004ae0| 74 6f 20 61 76 6f 69 64 | 20 6c 69 6e 6b 69 6e 67 |to avoid| linking|
|00004af0| 20 69 6e 20 74 68 65 0a | 20 20 20 73 79 73 74 65 | in the.| syste|
|00004b00| 6d 27 73 20 6f 77 6e 20 | 67 65 74 6f 70 74 20 69 |m's own |getopt i|
|00004b10| 6d 70 6c 65 6d 65 6e 74 | 61 74 69 6f 6e 2e 20 20 |mplement|ation. |
|00004b20| 2a 2f 0a 0a 69 6e 74 20 | 6f 70 74 6f 70 74 20 3d |*/..int |optopt =|
|00004b30| 20 27 3f 27 3b 0a 0a 2f | 2a 20 44 65 73 63 72 69 | '?';../|* Descri|
|00004b40| 62 65 20 68 6f 77 20 74 | 6f 20 64 65 61 6c 20 77 |be how t|o deal w|
|00004b50| 69 74 68 20 6f 70 74 69 | 6f 6e 73 20 74 68 61 74 |ith opti|ons that|
|00004b60| 20 66 6f 6c 6c 6f 77 20 | 6e 6f 6e 2d 6f 70 74 69 | follow |non-opti|
|00004b70| 6f 6e 20 41 52 47 56 2d | 65 6c 65 6d 65 6e 74 73 |on ARGV-|elements|
|00004b80| 2e 0a 0a 20 20 20 49 66 | 20 74 68 65 20 63 61 6c |... If| the cal|
|00004b90| 6c 65 72 20 64 69 64 20 | 6e 6f 74 20 73 70 65 63 |ler did |not spec|
|00004ba0| 69 66 79 20 61 6e 79 74 | 68 69 6e 67 2c 0a 20 20 |ify anyt|hing,. |
|00004bb0| 20 74 68 65 20 64 65 66 | 61 75 6c 74 20 69 73 20 | the def|ault is |
|00004bc0| 52 45 51 55 49 52 45 5f | 4f 52 44 45 52 20 69 66 |REQUIRE_|ORDER if|
|00004bd0| 20 74 68 65 20 65 6e 76 | 69 72 6f 6e 6d 65 6e 74 | the env|ironment|
|00004be0| 20 76 61 72 69 61 62 6c | 65 0a 20 20 20 50 4f 53 | variabl|e. POS|
|00004bf0| 49 58 4c 59 5f 43 4f 52 | 52 45 43 54 20 69 73 20 |IXLY_COR|RECT is |
|00004c00| 64 65 66 69 6e 65 64 2c | 20 50 45 52 4d 55 54 45 |defined,| PERMUTE|
|00004c10| 20 6f 74 68 65 72 77 69 | 73 65 2e 0a 0a 20 20 20 | otherwi|se... |
|00004c20| 52 45 51 55 49 52 45 5f | 4f 52 44 45 52 20 6d 65 |REQUIRE_|ORDER me|
|00004c30| 61 6e 73 20 64 6f 6e 27 | 74 20 72 65 63 6f 67 6e |ans don'|t recogn|
|00004c40| 69 7a 65 20 74 68 65 6d | 20 61 73 20 6f 70 74 69 |ize them| as opti|
|00004c50| 6f 6e 73 3b 0a 20 20 20 | 73 74 6f 70 20 6f 70 74 |ons;. |stop opt|
|00004c60| 69 6f 6e 20 70 72 6f 63 | 65 73 73 69 6e 67 20 77 |ion proc|essing w|
|00004c70| 68 65 6e 20 74 68 65 20 | 66 69 72 73 74 20 6e 6f |hen the |first no|
|00004c80| 6e 2d 6f 70 74 69 6f 6e | 20 69 73 20 73 65 65 6e |n-option| is seen|
|00004c90| 2e 0a 20 20 20 54 68 69 | 73 20 69 73 20 77 68 61 |.. Thi|s is wha|
|00004ca0| 74 20 55 6e 69 78 20 64 | 6f 65 73 2e 0a 20 20 20 |t Unix d|oes.. |
|00004cb0| 54 68 69 73 20 6d 6f 64 | 65 20 6f 66 20 6f 70 65 |This mod|e of ope|
|00004cc0| 72 61 74 69 6f 6e 20 69 | 73 20 73 65 6c 65 63 74 |ration i|s select|
|00004cd0| 65 64 20 62 79 20 65 69 | 74 68 65 72 20 73 65 74 |ed by ei|ther set|
|00004ce0| 74 69 6e 67 20 74 68 65 | 20 65 6e 76 69 72 6f 6e |ting the| environ|
|00004cf0| 6d 65 6e 74 0a 20 20 20 | 76 61 72 69 61 62 6c 65 |ment. |variable|
|00004d00| 20 50 4f 53 49 58 4c 59 | 5f 43 4f 52 52 45 43 54 | POSIXLY|_CORRECT|
|00004d10| 2c 20 6f 72 20 75 73 69 | 6e 67 20 60 2b 27 20 61 |, or usi|ng `+' a|
|00004d20| 73 20 74 68 65 20 66 69 | 72 73 74 20 63 68 61 72 |s the fi|rst char|
|00004d30| 61 63 74 65 72 0a 20 20 | 20 6f 66 20 74 68 65 20 |acter. | of the |
|00004d40| 6c 69 73 74 20 6f 66 20 | 6f 70 74 69 6f 6e 20 63 |list of |option c|
|00004d50| 68 61 72 61 63 74 65 72 | 73 2e 0a 0a 20 20 20 50 |haracter|s... P|
|00004d60| 45 52 4d 55 54 45 20 69 | 73 20 74 68 65 20 64 65 |ERMUTE i|s the de|
|00004d70| 66 61 75 6c 74 2e 20 20 | 57 65 20 70 65 72 6d 75 |fault. |We permu|
|00004d80| 74 65 20 74 68 65 20 63 | 6f 6e 74 65 6e 74 73 20 |te the c|ontents |
|00004d90| 6f 66 20 41 52 47 56 20 | 61 73 20 77 65 20 73 63 |of ARGV |as we sc|
|00004da0| 61 6e 2c 0a 20 20 20 73 | 6f 20 74 68 61 74 20 65 |an,. s|o that e|
|00004db0| 76 65 6e 74 75 61 6c 6c | 79 20 61 6c 6c 20 74 68 |ventuall|y all th|
|00004dc0| 65 20 6e 6f 6e 2d 6f 70 | 74 69 6f 6e 73 20 61 72 |e non-op|tions ar|
|00004dd0| 65 20 61 74 20 74 68 65 | 20 65 6e 64 2e 20 20 54 |e at the| end. T|
|00004de0| 68 69 73 20 61 6c 6c 6f | 77 73 20 6f 70 74 69 6f |his allo|ws optio|
|00004df0| 6e 73 0a 20 20 20 74 6f | 20 62 65 20 67 69 76 65 |ns. to| be give|
|00004e00| 6e 20 69 6e 20 61 6e 79 | 20 6f 72 64 65 72 2c 20 |n in any| order, |
|00004e10| 65 76 65 6e 20 77 69 74 | 68 20 70 72 6f 67 72 61 |even wit|h progra|
|00004e20| 6d 73 20 74 68 61 74 20 | 77 65 72 65 20 6e 6f 74 |ms that |were not|
|00004e30| 20 77 72 69 74 74 65 6e | 20 74 6f 0a 20 20 20 65 | written| to. e|
|00004e40| 78 70 65 63 74 20 74 68 | 69 73 2e 0a 0a 20 20 20 |xpect th|is... |
|00004e50| 52 45 54 55 52 4e 5f 49 | 4e 5f 4f 52 44 45 52 20 |RETURN_I|N_ORDER |
|00004e60| 69 73 20 61 6e 20 6f 70 | 74 69 6f 6e 20 61 76 61 |is an op|tion ava|
|00004e70| 69 6c 61 62 6c 65 20 74 | 6f 20 70 72 6f 67 72 61 |ilable t|o progra|
|00004e80| 6d 73 20 74 68 61 74 20 | 77 65 72 65 20 77 72 69 |ms that |were wri|
|00004e90| 74 74 65 6e 0a 20 20 20 | 74 6f 20 65 78 70 65 63 |tten. |to expec|
|00004ea0| 74 20 6f 70 74 69 6f 6e | 73 20 61 6e 64 20 6f 74 |t option|s and ot|
|00004eb0| 68 65 72 20 41 52 47 56 | 2d 65 6c 65 6d 65 6e 74 |her ARGV|-element|
|00004ec0| 73 20 69 6e 20 61 6e 79 | 20 6f 72 64 65 72 20 61 |s in any| order a|
|00004ed0| 6e 64 20 74 68 61 74 20 | 63 61 72 65 20 61 62 6f |nd that |care abo|
|00004ee0| 75 74 0a 20 20 20 74 68 | 65 20 6f 72 64 65 72 69 |ut. th|e orderi|
|00004ef0| 6e 67 20 6f 66 20 74 68 | 65 20 74 77 6f 2e 20 20 |ng of th|e two. |
|00004f00| 57 65 20 64 65 73 63 72 | 69 62 65 20 65 61 63 68 |We descr|ibe each|
|00004f10| 20 6e 6f 6e 2d 6f 70 74 | 69 6f 6e 20 41 52 47 56 | non-opt|ion ARGV|
|00004f20| 2d 65 6c 65 6d 65 6e 74 | 0a 20 20 20 61 73 20 69 |-element|. as i|
|00004f30| 66 20 69 74 20 77 65 72 | 65 20 74 68 65 20 61 72 |f it wer|e the ar|
|00004f40| 67 75 6d 65 6e 74 20 6f | 66 20 61 6e 20 6f 70 74 |gument o|f an opt|
|00004f50| 69 6f 6e 20 77 69 74 68 | 20 63 68 61 72 61 63 74 |ion with| charact|
|00004f60| 65 72 20 63 6f 64 65 20 | 31 2e 0a 20 20 20 55 73 |er code |1.. Us|
|00004f70| 69 6e 67 20 60 2d 27 20 | 61 73 20 74 68 65 20 66 |ing `-' |as the f|
|00004f80| 69 72 73 74 20 63 68 61 | 72 61 63 74 65 72 20 6f |irst cha|racter o|
|00004f90| 66 20 74 68 65 20 6c 69 | 73 74 20 6f 66 20 6f 70 |f the li|st of op|
|00004fa0| 74 69 6f 6e 20 63 68 61 | 72 61 63 74 65 72 73 0a |tion cha|racters.|
|00004fb0| 20 20 20 73 65 6c 65 63 | 74 73 20 74 68 69 73 20 | selec|ts this |
|00004fc0| 6d 6f 64 65 20 6f 66 20 | 6f 70 65 72 61 74 69 6f |mode of |operatio|
|00004fd0| 6e 2e 0a 0a 20 20 20 54 | 68 65 20 73 70 65 63 69 |n... T|he speci|
|00004fe0| 61 6c 20 61 72 67 75 6d | 65 6e 74 20 60 2d 2d 27 |al argum|ent `--'|
|00004ff0| 20 66 6f 72 63 65 73 20 | 61 6e 20 65 6e 64 20 6f | forces |an end o|
|00005000| 66 20 6f 70 74 69 6f 6e | 2d 73 63 61 6e 6e 69 6e |f option|-scannin|
|00005010| 67 20 72 65 67 61 72 64 | 6c 65 73 73 0a 20 20 20 |g regard|less. |
|00005020| 6f 66 20 74 68 65 20 76 | 61 6c 75 65 20 6f 66 20 |of the v|alue of |
|00005030| 60 6f 72 64 65 72 69 6e | 67 27 2e 20 20 49 6e 20 |`orderin|g'. In |
|00005040| 74 68 65 20 63 61 73 65 | 20 6f 66 20 52 45 54 55 |the case| of RETU|
|00005050| 52 4e 5f 49 4e 5f 4f 52 | 44 45 52 2c 20 6f 6e 6c |RN_IN_OR|DER, onl|
|00005060| 79 0a 20 20 20 60 2d 2d | 27 20 63 61 6e 20 63 61 |y. `--|' can ca|
|00005070| 75 73 65 20 60 67 65 74 | 6f 70 74 27 20 74 6f 20 |use `get|opt' to |
|00005080| 72 65 74 75 72 6e 20 45 | 4f 46 20 77 69 74 68 20 |return E|OF with |
|00005090| 60 6f 70 74 69 6e 64 27 | 20 21 3d 20 41 52 47 43 |`optind'| != ARGC|
|000050a0| 2e 20 20 2a 2f 0a 0a 73 | 74 61 74 69 63 20 65 6e |. */..s|tatic en|
|000050b0| 75 6d 0a 7b 0a 20 20 52 | 45 51 55 49 52 45 5f 4f |um.{. R|EQUIRE_O|
|000050c0| 52 44 45 52 2c 20 50 45 | 52 4d 55 54 45 2c 20 52 |RDER, PE|RMUTE, R|
|000050d0| 45 54 55 52 4e 5f 49 4e | 5f 4f 52 44 45 52 0a 7d |ETURN_IN|_ORDER.}|
|000050e0| 20 6f 72 64 65 72 69 6e | 67 3b 0a 0c 0a 23 69 66 | orderin|g;...#if|
|000050f0| 64 65 66 09 5f 5f 47 4e | 55 5f 4c 49 42 52 41 52 |def.__GN|U_LIBRAR|
|00005100| 59 5f 5f 0a 2f 2a 20 57 | 65 20 77 61 6e 74 20 74 |Y__./* W|e want t|
|00005110| 6f 20 61 76 6f 69 64 20 | 69 6e 63 6c 75 73 69 6f |o avoid |inclusio|
|00005120| 6e 20 6f 66 20 73 74 72 | 69 6e 67 2e 68 20 77 69 |n of str|ing.h wi|
|00005130| 74 68 20 6e 6f 6e 2d 47 | 4e 55 20 6c 69 62 72 61 |th non-G|NU libra|
|00005140| 72 69 65 73 0a 20 20 20 | 62 65 63 61 75 73 65 20 |ries. |because |
|00005150| 74 68 65 72 65 20 61 72 | 65 20 6d 61 6e 79 20 77 |there ar|e many w|
|00005160| 61 79 73 20 69 74 20 63 | 61 6e 20 63 61 75 73 65 |ays it c|an cause|
|00005170| 20 74 72 6f 75 62 6c 65 | 2e 0a 20 20 20 4f 6e 20 | trouble|.. On |
|00005180| 73 6f 6d 65 20 73 79 73 | 74 65 6d 73 2c 20 69 74 |some sys|tems, it|
|00005190| 20 63 6f 6e 74 61 69 6e | 73 20 73 70 65 63 69 61 | contain|s specia|
|000051a0| 6c 20 6d 61 67 69 63 20 | 6d 61 63 72 6f 73 20 74 |l magic |macros t|
|000051b0| 68 61 74 20 64 6f 6e 27 | 74 20 77 6f 72 6b 0a 20 |hat don'|t work. |
|000051c0| 20 20 69 6e 20 47 43 43 | 2e 20 20 2a 2f 0a 23 69 | in GCC|. */.#i|
|000051d0| 6e 63 6c 75 64 65 20 3c | 73 74 72 69 6e 67 2e 68 |nclude <|string.h|
|000051e0| 3e 0a 23 64 65 66 69 6e | 65 09 6d 79 5f 69 6e 64 |>.#defin|e.my_ind|
|000051f0| 65 78 09 73 74 72 63 68 | 72 0a 23 64 65 66 69 6e |ex.strch|r.#defin|
|00005200| 65 09 6d 79 5f 62 63 6f | 70 79 28 73 72 63 2c 20 |e.my_bco|py(src, |
|00005210| 64 73 74 2c 20 6e 29 09 | 6d 65 6d 63 70 79 20 28 |dst, n).|memcpy (|
|00005220| 28 64 73 74 29 2c 20 28 | 73 72 63 29 2c 20 28 6e |(dst), (|src), (n|
|00005230| 29 29 0a 23 65 6c 73 65 | 0a 0a 2f 2a 20 41 76 6f |)).#else|../* Avo|
|00005240| 69 64 20 64 65 70 65 6e | 64 69 6e 67 20 6f 6e 20 |id depen|ding on |
|00005250| 6c 69 62 72 61 72 79 20 | 66 75 6e 63 74 69 6f 6e |library |function|
|00005260| 73 20 6f 72 20 66 69 6c | 65 73 0a 20 20 20 77 68 |s or fil|es. wh|
|00005270| 6f 73 65 20 6e 61 6d 65 | 73 20 61 72 65 20 69 6e |ose name|s are in|
|00005280| 63 6f 6e 73 69 73 74 65 | 6e 74 2e 20 20 2a 2f 0a |consiste|nt. */.|
|00005290| 0a 63 68 61 72 20 2a 67 | 65 74 65 6e 76 20 28 29 |.char *g|etenv ()|
|000052a0| 3b 0a 0a 73 74 61 74 69 | 63 20 63 68 61 72 20 2a |;..stati|c char *|
|000052b0| 0a 6d 79 5f 69 6e 64 65 | 78 20 28 73 74 72 2c 20 |.my_inde|x (str, |
|000052c0| 63 68 72 29 0a 20 20 20 | 20 20 63 6f 6e 73 74 20 |chr). | const |
|000052d0| 63 68 61 72 20 2a 73 74 | 72 3b 0a 20 20 20 20 20 |char *st|r;. |
|000052e0| 69 6e 74 20 63 68 72 3b | 0a 7b 0a 20 20 77 68 69 |int chr;|.{. whi|
|000052f0| 6c 65 20 28 2a 73 74 72 | 29 0a 20 20 20 20 7b 0a |le (*str|). {.|
|00005300| 20 20 20 20 20 20 69 66 | 20 28 2a 73 74 72 20 3d | if| (*str =|
|00005310| 3d 20 63 68 72 29 0a 09 | 72 65 74 75 72 6e 20 28 |= chr)..|return (|
|00005320| 63 68 61 72 20 2a 29 20 | 73 74 72 3b 0a 20 20 20 |char *) |str;. |
|00005330| 20 20 20 73 74 72 2b 2b | 3b 0a 20 20 20 20 7d 0a | str++|;. }.|
|00005340| 20 20 72 65 74 75 72 6e | 20 30 3b 0a 7d 0a 0a 73 | return| 0;.}..s|
|00005350| 74 61 74 69 63 20 76 6f | 69 64 0a 6d 79 5f 62 63 |tatic vo|id.my_bc|
|00005360| 6f 70 79 20 28 66 72 6f | 6d 2c 20 74 6f 2c 20 73 |opy (fro|m, to, s|
|00005370| 69 7a 65 29 0a 20 20 20 | 20 20 63 6f 6e 73 74 20 |ize). | const |
|00005380| 63 68 61 72 20 2a 66 72 | 6f 6d 3b 0a 20 20 20 20 |char *fr|om;. |
|00005390| 20 63 68 61 72 20 2a 74 | 6f 3b 0a 20 20 20 20 20 | char *t|o;. |
|000053a0| 69 6e 74 20 73 69 7a 65 | 3b 0a 7b 0a 20 20 69 6e |int size|;.{. in|
|000053b0| 74 20 69 3b 0a 20 20 66 | 6f 72 20 28 69 20 3d 20 |t i;. f|or (i = |
|000053c0| 30 3b 20 69 20 3c 20 73 | 69 7a 65 3b 20 69 2b 2b |0; i < s|ize; i++|
|000053d0| 29 0a 20 20 20 20 74 6f | 5b 69 5d 20 3d 20 66 72 |). to|[i] = fr|
|000053e0| 6f 6d 5b 69 5d 3b 0a 7d | 0a 23 65 6e 64 69 66 09 |om[i];.}|.#endif.|
|000053f0| 09 09 09 2f 2a 20 47 4e | 55 20 43 20 6c 69 62 72 |.../* GN|U C libr|
|00005400| 61 72 79 2e 20 20 2a 2f | 0a 0c 0a 2f 2a 20 48 61 |ary. */|.../* Ha|
|00005410| 6e 64 6c 65 20 70 65 72 | 6d 75 74 61 74 69 6f 6e |ndle per|mutation|
|00005420| 20 6f 66 20 61 72 67 75 | 6d 65 6e 74 73 2e 20 20 | of argu|ments. |
|00005430| 2a 2f 0a 0a 2f 2a 20 44 | 65 73 63 72 69 62 65 20 |*/../* D|escribe |
|00005440| 74 68 65 20 70 61 72 74 | 20 6f 66 20 41 52 47 56 |the part| of ARGV|
|00005450| 20 74 68 61 74 20 63 6f | 6e 74 61 69 6e 73 20 6e | that co|ntains n|
|00005460| 6f 6e 2d 6f 70 74 69 6f | 6e 73 20 74 68 61 74 20 |on-optio|ns that |
|00005470| 68 61 76 65 0a 20 20 20 | 62 65 65 6e 20 73 6b 69 |have. |been ski|
|00005480| 70 70 65 64 2e 20 20 60 | 66 69 72 73 74 5f 6e 6f |pped. `|first_no|
|00005490| 6e 6f 70 74 27 20 69 73 | 20 74 68 65 20 69 6e 64 |nopt' is| the ind|
|000054a0| 65 78 20 69 6e 20 41 52 | 47 56 20 6f 66 20 74 68 |ex in AR|GV of th|
|000054b0| 65 20 66 69 72 73 74 20 | 6f 66 20 74 68 65 6d 3b |e first |of them;|
|000054c0| 0a 20 20 20 60 6c 61 73 | 74 5f 6e 6f 6e 6f 70 74 |. `las|t_nonopt|
|000054d0| 27 20 69 73 20 74 68 65 | 20 69 6e 64 65 78 20 61 |' is the| index a|
|000054e0| 66 74 65 72 20 74 68 65 | 20 6c 61 73 74 20 6f 66 |fter the| last of|
|000054f0| 20 74 68 65 6d 2e 20 20 | 2a 2f 0a 0a 73 74 61 74 | them. |*/..stat|
|00005500| 69 63 20 69 6e 74 20 66 | 69 72 73 74 5f 6e 6f 6e |ic int f|irst_non|
|00005510| 6f 70 74 3b 0a 73 74 61 | 74 69 63 20 69 6e 74 20 |opt;.sta|tic int |
|00005520| 6c 61 73 74 5f 6e 6f 6e | 6f 70 74 3b 0a 0a 2f 2a |last_non|opt;../*|
|00005530| 20 45 78 63 68 61 6e 67 | 65 20 74 77 6f 20 61 64 | Exchang|e two ad|
|00005540| 6a 61 63 65 6e 74 20 73 | 75 62 73 65 71 75 65 6e |jacent s|ubsequen|
|00005550| 63 65 73 20 6f 66 20 41 | 52 47 56 2e 0a 20 20 20 |ces of A|RGV.. |
|00005560| 4f 6e 65 20 73 75 62 73 | 65 71 75 65 6e 63 65 20 |One subs|equence |
|00005570| 69 73 20 65 6c 65 6d 65 | 6e 74 73 20 5b 66 69 72 |is eleme|nts [fir|
|00005580| 73 74 5f 6e 6f 6e 6f 70 | 74 2c 6c 61 73 74 5f 6e |st_nonop|t,last_n|
|00005590| 6f 6e 6f 70 74 29 0a 20 | 20 20 77 68 69 63 68 20 |onopt). | which |
|000055a0| 63 6f 6e 74 61 69 6e 73 | 20 61 6c 6c 20 74 68 65 |contains| all the|
|000055b0| 20 6e 6f 6e 2d 6f 70 74 | 69 6f 6e 73 20 74 68 61 | non-opt|ions tha|
|000055c0| 74 20 68 61 76 65 20 62 | 65 65 6e 20 73 6b 69 70 |t have b|een skip|
|000055d0| 70 65 64 20 73 6f 20 66 | 61 72 2e 0a 20 20 20 54 |ped so f|ar.. T|
|000055e0| 68 65 20 6f 74 68 65 72 | 20 69 73 20 65 6c 65 6d |he other| is elem|
|000055f0| 65 6e 74 73 20 5b 6c 61 | 73 74 5f 6e 6f 6e 6f 70 |ents [la|st_nonop|
|00005600| 74 2c 6f 70 74 69 6e 64 | 29 2c 20 77 68 69 63 68 |t,optind|), which|
|00005610| 20 63 6f 6e 74 61 69 6e | 73 20 61 6c 6c 0a 20 20 | contain|s all. |
|00005620| 20 74 68 65 20 6f 70 74 | 69 6f 6e 73 20 70 72 6f | the opt|ions pro|
|00005630| 63 65 73 73 65 64 20 73 | 69 6e 63 65 20 74 68 6f |cessed s|ince tho|
|00005640| 73 65 20 6e 6f 6e 2d 6f | 70 74 69 6f 6e 73 20 77 |se non-o|ptions w|
|00005650| 65 72 65 20 73 6b 69 70 | 70 65 64 2e 0a 0a 20 20 |ere skip|ped... |
|00005660| 20 60 66 69 72 73 74 5f | 6e 6f 6e 6f 70 74 27 20 | `first_|nonopt' |
|00005670| 61 6e 64 20 60 6c 61 73 | 74 5f 6e 6f 6e 6f 70 74 |and `las|t_nonopt|
|00005680| 27 20 61 72 65 20 72 65 | 6c 6f 63 61 74 65 64 20 |' are re|located |
|00005690| 73 6f 20 74 68 61 74 20 | 74 68 65 79 20 64 65 73 |so that |they des|
|000056a0| 63 72 69 62 65 0a 20 20 | 20 74 68 65 20 6e 65 77 |cribe. | the new|
|000056b0| 20 69 6e 64 69 63 65 73 | 20 6f 66 20 74 68 65 20 | indices| of the |
|000056c0| 6e 6f 6e 2d 6f 70 74 69 | 6f 6e 73 20 69 6e 20 41 |non-opti|ons in A|
|000056d0| 52 47 56 20 61 66 74 65 | 72 20 74 68 65 79 20 61 |RGV afte|r they a|
|000056e0| 72 65 20 6d 6f 76 65 64 | 2e 20 20 2a 2f 0a 0a 73 |re moved|. */..s|
|000056f0| 74 61 74 69 63 20 76 6f | 69 64 0a 65 78 63 68 61 |tatic vo|id.excha|
|00005700| 6e 67 65 20 28 61 72 67 | 76 29 0a 20 20 20 20 20 |nge (arg|v). |
|00005710| 63 68 61 72 20 2a 2a 61 | 72 67 76 3b 0a 7b 0a 20 |char **a|rgv;.{. |
|00005720| 20 69 6e 74 20 6e 6f 6e | 6f 70 74 73 5f 73 69 7a | int non|opts_siz|
|00005730| 65 20 3d 20 28 6c 61 73 | 74 5f 6e 6f 6e 6f 70 74 |e = (las|t_nonopt|
|00005740| 20 2d 20 66 69 72 73 74 | 5f 6e 6f 6e 6f 70 74 29 | - first|_nonopt)|
|00005750| 20 2a 20 73 69 7a 65 6f | 66 20 28 63 68 61 72 20 | * sizeo|f (char |
|00005760| 2a 29 3b 0a 20 20 63 68 | 61 72 20 2a 2a 74 65 6d |*);. ch|ar **tem|
|00005770| 70 20 3d 20 28 63 68 61 | 72 20 2a 2a 29 20 5f 5f |p = (cha|r **) __|
|00005780| 61 6c 6c 6f 63 61 20 28 | 6e 6f 6e 6f 70 74 73 5f |alloca (|nonopts_|
|00005790| 73 69 7a 65 29 3b 0a 0a | 20 20 2f 2a 20 49 6e 74 |size);..| /* Int|
|000057a0| 65 72 63 68 61 6e 67 65 | 20 74 68 65 20 74 77 6f |erchange| the two|
|000057b0| 20 62 6c 6f 63 6b 73 20 | 6f 66 20 64 61 74 61 20 | blocks |of data |
|000057c0| 69 6e 20 41 52 47 56 2e | 20 20 2a 2f 0a 0a 20 20 |in ARGV.| */.. |
|000057d0| 6d 79 5f 62 63 6f 70 79 | 20 28 28 63 68 61 72 20 |my_bcopy| ((char |
|000057e0| 2a 29 20 26 61 72 67 76 | 5b 66 69 72 73 74 5f 6e |*) &argv|[first_n|
|000057f0| 6f 6e 6f 70 74 5d 2c 20 | 28 63 68 61 72 20 2a 29 |onopt], |(char *)|
|00005800| 20 74 65 6d 70 2c 20 6e | 6f 6e 6f 70 74 73 5f 73 | temp, n|onopts_s|
|00005810| 69 7a 65 29 3b 0a 20 20 | 6d 79 5f 62 63 6f 70 79 |ize);. |my_bcopy|
|00005820| 20 28 28 63 68 61 72 20 | 2a 29 20 26 61 72 67 76 | ((char |*) &argv|
|00005830| 5b 6c 61 73 74 5f 6e 6f | 6e 6f 70 74 5d 2c 20 28 |[last_no|nopt], (|
|00005840| 63 68 61 72 20 2a 29 20 | 26 61 72 67 76 5b 66 69 |char *) |&argv[fi|
|00005850| 72 73 74 5f 6e 6f 6e 6f | 70 74 5d 2c 0a 09 20 20 |rst_nono|pt],.. |
|00005860| 20 20 28 6f 70 74 69 6e | 64 20 2d 20 6c 61 73 74 | (optin|d - last|
|00005870| 5f 6e 6f 6e 6f 70 74 29 | 20 2a 20 73 69 7a 65 6f |_nonopt)| * sizeo|
|00005880| 66 20 28 63 68 61 72 20 | 2a 29 29 3b 0a 20 20 6d |f (char |*));. m|
|00005890| 79 5f 62 63 6f 70 79 20 | 28 28 63 68 61 72 20 2a |y_bcopy |((char *|
|000058a0| 29 20 74 65 6d 70 2c 0a | 09 20 20 20 20 28 63 68 |) temp,.|. (ch|
|000058b0| 61 72 20 2a 29 20 26 61 | 72 67 76 5b 66 69 72 73 |ar *) &a|rgv[firs|
|000058c0| 74 5f 6e 6f 6e 6f 70 74 | 20 2b 20 6f 70 74 69 6e |t_nonopt| + optin|
|000058d0| 64 20 2d 20 6c 61 73 74 | 5f 6e 6f 6e 6f 70 74 5d |d - last|_nonopt]|
|000058e0| 2c 0a 09 20 20 20 20 6e | 6f 6e 6f 70 74 73 5f 73 |,.. n|onopts_s|
|000058f0| 69 7a 65 29 3b 0a 0a 20 | 20 2f 2a 20 55 70 64 61 |ize);.. | /* Upda|
|00005900| 74 65 20 72 65 63 6f 72 | 64 73 20 66 6f 72 20 74 |te recor|ds for t|
|00005910| 68 65 20 73 6c 6f 74 73 | 20 74 68 65 20 6e 6f 6e |he slots| the non|
|00005920| 2d 6f 70 74 69 6f 6e 73 | 20 6e 6f 77 20 6f 63 63 |-options| now occ|
|00005930| 75 70 79 2e 20 20 2a 2f | 0a 0a 20 20 66 69 72 73 |upy. */|.. firs|
|00005940| 74 5f 6e 6f 6e 6f 70 74 | 20 2b 3d 20 28 6f 70 74 |t_nonopt| += (opt|
|00005950| 69 6e 64 20 2d 20 6c 61 | 73 74 5f 6e 6f 6e 6f 70 |ind - la|st_nonop|
|00005960| 74 29 3b 0a 20 20 6c 61 | 73 74 5f 6e 6f 6e 6f 70 |t);. la|st_nonop|
|00005970| 74 20 3d 20 6f 70 74 69 | 6e 64 3b 0a 7d 0a 0c 0a |t = opti|nd;.}...|
|00005980| 2f 2a 20 53 63 61 6e 20 | 65 6c 65 6d 65 6e 74 73 |/* Scan |elements|
|00005990| 20 6f 66 20 41 52 47 56 | 20 28 77 68 6f 73 65 20 | of ARGV| (whose |
|000059a0| 6c 65 6e 67 74 68 20 69 | 73 20 41 52 47 43 29 20 |length i|s ARGC) |
|000059b0| 66 6f 72 20 6f 70 74 69 | 6f 6e 20 63 68 61 72 61 |for opti|on chara|
|000059c0| 63 74 65 72 73 0a 20 20 | 20 67 69 76 65 6e 20 69 |cters. | given i|
|000059d0| 6e 20 4f 50 54 53 54 52 | 49 4e 47 2e 0a 0a 20 20 |n OPTSTR|ING... |
|000059e0| 20 49 66 20 61 6e 20 65 | 6c 65 6d 65 6e 74 20 6f | If an e|lement o|
|000059f0| 66 20 41 52 47 56 20 73 | 74 61 72 74 73 20 77 69 |f ARGV s|tarts wi|
|00005a00| 74 68 20 27 2d 27 2c 20 | 61 6e 64 20 69 73 20 6e |th '-', |and is n|
|00005a10| 6f 74 20 65 78 61 63 74 | 6c 79 20 22 2d 22 20 6f |ot exact|ly "-" o|
|00005a20| 72 20 22 2d 2d 22 2c 0a | 20 20 20 74 68 65 6e 20 |r "--",.| then |
|00005a30| 69 74 20 69 73 20 61 6e | 20 6f 70 74 69 6f 6e 20 |it is an| option |
|00005a40| 65 6c 65 6d 65 6e 74 2e | 20 20 54 68 65 20 63 68 |element.| The ch|
|00005a50| 61 72 61 63 74 65 72 73 | 20 6f 66 20 74 68 69 73 |aracters| of this|
|00005a60| 20 65 6c 65 6d 65 6e 74 | 0a 20 20 20 28 61 73 69 | element|. (asi|
|00005a70| 64 65 20 66 72 6f 6d 20 | 74 68 65 20 69 6e 69 74 |de from |the init|
|00005a80| 69 61 6c 20 27 2d 27 29 | 20 61 72 65 20 6f 70 74 |ial '-')| are opt|
|00005a90| 69 6f 6e 20 63 68 61 72 | 61 63 74 65 72 73 2e 20 |ion char|acters. |
|00005aa0| 20 49 66 20 60 67 65 74 | 6f 70 74 27 0a 20 20 20 | If `get|opt'. |
|00005ab0| 69 73 20 63 61 6c 6c 65 | 64 20 72 65 70 65 61 74 |is calle|d repeat|
|00005ac0| 65 64 6c 79 2c 20 69 74 | 20 72 65 74 75 72 6e 73 |edly, it| returns|
|00005ad0| 20 73 75 63 63 65 73 73 | 69 76 65 6c 79 20 65 61 | success|ively ea|
|00005ae0| 63 68 20 6f 66 20 74 68 | 65 20 6f 70 74 69 6f 6e |ch of th|e option|
|00005af0| 20 63 68 61 72 61 63 74 | 65 72 73 0a 20 20 20 66 | charact|ers. f|
|00005b00| 72 6f 6d 20 65 61 63 68 | 20 6f 66 20 74 68 65 20 |rom each| of the |
|00005b10| 6f 70 74 69 6f 6e 20 65 | 6c 65 6d 65 6e 74 73 2e |option e|lements.|
|00005b20| 0a 0a 20 20 20 49 66 20 | 60 67 65 74 6f 70 74 27 |.. If |`getopt'|
|00005b30| 20 66 69 6e 64 73 20 61 | 6e 6f 74 68 65 72 20 6f | finds a|nother o|
|00005b40| 70 74 69 6f 6e 20 63 68 | 61 72 61 63 74 65 72 2c |ption ch|aracter,|
|00005b50| 20 69 74 20 72 65 74 75 | 72 6e 73 20 74 68 61 74 | it retu|rns that|
|00005b60| 20 63 68 61 72 61 63 74 | 65 72 2c 0a 20 20 20 75 | charact|er,. u|
|00005b70| 70 64 61 74 69 6e 67 20 | 60 6f 70 74 69 6e 64 27 |pdating |`optind'|
|00005b80| 20 61 6e 64 20 60 6e 65 | 78 74 63 68 61 72 27 20 | and `ne|xtchar' |
|00005b90| 73 6f 20 74 68 61 74 20 | 74 68 65 20 6e 65 78 74 |so that |the next|
|00005ba0| 20 63 61 6c 6c 20 74 6f | 20 60 67 65 74 6f 70 74 | call to| `getopt|
|00005bb0| 27 20 63 61 6e 0a 20 20 | 20 72 65 73 75 6d 65 20 |' can. | resume |
|00005bc0| 74 68 65 20 73 63 61 6e | 20 77 69 74 68 20 74 68 |the scan| with th|
|00005bd0| 65 20 66 6f 6c 6c 6f 77 | 69 6e 67 20 6f 70 74 69 |e follow|ing opti|
|00005be0| 6f 6e 20 63 68 61 72 61 | 63 74 65 72 20 6f 72 20 |on chara|cter or |
|00005bf0| 41 52 47 56 2d 65 6c 65 | 6d 65 6e 74 2e 0a 0a 20 |ARGV-ele|ment... |
|00005c00| 20 20 49 66 20 74 68 65 | 72 65 20 61 72 65 20 6e | If the|re are n|
|00005c10| 6f 20 6d 6f 72 65 20 6f | 70 74 69 6f 6e 20 63 68 |o more o|ption ch|
|00005c20| 61 72 61 63 74 65 72 73 | 2c 20 60 67 65 74 6f 70 |aracters|, `getop|
|00005c30| 74 27 20 72 65 74 75 72 | 6e 73 20 60 45 4f 46 27 |t' retur|ns `EOF'|
|00005c40| 2e 0a 20 20 20 54 68 65 | 6e 20 60 6f 70 74 69 6e |.. The|n `optin|
|00005c50| 64 27 20 69 73 20 74 68 | 65 20 69 6e 64 65 78 20 |d' is th|e index |
|00005c60| 69 6e 20 41 52 47 56 20 | 6f 66 20 74 68 65 20 66 |in ARGV |of the f|
|00005c70| 69 72 73 74 20 41 52 47 | 56 2d 65 6c 65 6d 65 6e |irst ARG|V-elemen|
|00005c80| 74 0a 20 20 20 74 68 61 | 74 20 69 73 20 6e 6f 74 |t. tha|t is not|
|00005c90| 20 61 6e 20 6f 70 74 69 | 6f 6e 2e 20 20 28 54 68 | an opti|on. (Th|
|00005ca0| 65 20 41 52 47 56 2d 65 | 6c 65 6d 65 6e 74 73 20 |e ARGV-e|lements |
|00005cb0| 68 61 76 65 20 62 65 65 | 6e 20 70 65 72 6d 75 74 |have bee|n permut|
|00005cc0| 65 64 0a 20 20 20 73 6f | 20 74 68 61 74 20 74 68 |ed. so| that th|
|00005cd0| 6f 73 65 20 74 68 61 74 | 20 61 72 65 20 6e 6f 74 |ose that| are not|
|00005ce0| 20 6f 70 74 69 6f 6e 73 | 20 6e 6f 77 20 63 6f 6d | options| now com|
|00005cf0| 65 20 6c 61 73 74 2e 29 | 0a 0a 20 20 20 4f 50 54 |e last.)|.. OPT|
|00005d00| 53 54 52 49 4e 47 20 69 | 73 20 61 20 73 74 72 69 |STRING i|s a stri|
|00005d10| 6e 67 20 63 6f 6e 74 61 | 69 6e 69 6e 67 20 74 68 |ng conta|ining th|
|00005d20| 65 20 6c 65 67 69 74 69 | 6d 61 74 65 20 6f 70 74 |e legiti|mate opt|
|00005d30| 69 6f 6e 20 63 68 61 72 | 61 63 74 65 72 73 2e 0a |ion char|acters..|
|00005d40| 20 20 20 49 66 20 61 6e | 20 6f 70 74 69 6f 6e 20 | If an| option |
|00005d50| 63 68 61 72 61 63 74 65 | 72 20 69 73 20 73 65 65 |characte|r is see|
|00005d60| 6e 20 74 68 61 74 20 69 | 73 20 6e 6f 74 20 6c 69 |n that i|s not li|
|00005d70| 73 74 65 64 20 69 6e 20 | 4f 50 54 53 54 52 49 4e |sted in |OPTSTRIN|
|00005d80| 47 2c 0a 20 20 20 72 65 | 74 75 72 6e 20 27 3f 27 |G,. re|turn '?'|
|00005d90| 20 61 66 74 65 72 20 70 | 72 69 6e 74 69 6e 67 20 | after p|rinting |
|00005da0| 61 6e 20 65 72 72 6f 72 | 20 6d 65 73 73 61 67 65 |an error| message|
|00005db0| 2e 20 20 49 66 20 79 6f | 75 20 73 65 74 20 60 6f |. If yo|u set `o|
|00005dc0| 70 74 65 72 72 27 20 74 | 6f 0a 20 20 20 7a 65 72 |pterr' t|o. zer|
|00005dd0| 6f 2c 20 74 68 65 20 65 | 72 72 6f 72 20 6d 65 73 |o, the e|rror mes|
|00005de0| 73 61 67 65 20 69 73 20 | 73 75 70 70 72 65 73 73 |sage is |suppress|
|00005df0| 65 64 20 62 75 74 20 77 | 65 20 73 74 69 6c 6c 20 |ed but w|e still |
|00005e00| 72 65 74 75 72 6e 20 27 | 3f 27 2e 0a 0a 20 20 20 |return '|?'... |
|00005e10| 49 66 20 61 20 63 68 61 | 72 20 69 6e 20 4f 50 54 |If a cha|r in OPT|
|00005e20| 53 54 52 49 4e 47 20 69 | 73 20 66 6f 6c 6c 6f 77 |STRING i|s follow|
|00005e30| 65 64 20 62 79 20 61 20 | 63 6f 6c 6f 6e 2c 20 74 |ed by a |colon, t|
|00005e40| 68 61 74 20 6d 65 61 6e | 73 20 69 74 20 77 61 6e |hat mean|s it wan|
|00005e50| 74 73 20 61 6e 20 61 72 | 67 2c 0a 20 20 20 73 6f |ts an ar|g,. so|
|00005e60| 20 74 68 65 20 66 6f 6c | 6c 6f 77 69 6e 67 20 74 | the fol|lowing t|
|00005e70| 65 78 74 20 69 6e 20 74 | 68 65 20 73 61 6d 65 20 |ext in t|he same |
|00005e80| 41 52 47 56 2d 65 6c 65 | 6d 65 6e 74 2c 20 6f 72 |ARGV-ele|ment, or|
|00005e90| 20 74 68 65 20 74 65 78 | 74 20 6f 66 20 74 68 65 | the tex|t of the|
|00005ea0| 20 66 6f 6c 6c 6f 77 69 | 6e 67 0a 20 20 20 41 52 | followi|ng. AR|
|00005eb0| 47 56 2d 65 6c 65 6d 65 | 6e 74 2c 20 69 73 20 72 |GV-eleme|nt, is r|
|00005ec0| 65 74 75 72 6e 65 64 20 | 69 6e 20 60 6f 70 74 61 |eturned |in `opta|
|00005ed0| 72 67 27 2e 20 20 54 77 | 6f 20 63 6f 6c 6f 6e 73 |rg'. Tw|o colons|
|00005ee0| 20 6d 65 61 6e 20 61 6e | 20 6f 70 74 69 6f 6e 20 | mean an| option |
|00005ef0| 74 68 61 74 0a 20 20 20 | 77 61 6e 74 73 20 61 6e |that. |wants an|
|00005f00| 20 6f 70 74 69 6f 6e 61 | 6c 20 61 72 67 3b 20 69 | optiona|l arg; i|
|00005f10| 66 20 74 68 65 72 65 20 | 69 73 20 74 65 78 74 20 |f there |is text |
|00005f20| 69 6e 20 74 68 65 20 63 | 75 72 72 65 6e 74 20 41 |in the c|urrent A|
|00005f30| 52 47 56 2d 65 6c 65 6d | 65 6e 74 2c 0a 20 20 20 |RGV-elem|ent,. |
|00005f40| 69 74 20 69 73 20 72 65 | 74 75 72 6e 65 64 20 69 |it is re|turned i|
|00005f50| 6e 20 60 6f 70 74 61 72 | 67 27 2c 20 6f 74 68 65 |n `optar|g', othe|
|00005f60| 72 77 69 73 65 20 60 6f | 70 74 61 72 67 27 20 69 |rwise `o|ptarg' i|
|00005f70| 73 20 73 65 74 20 74 6f | 20 7a 65 72 6f 2e 0a 0a |s set to| zero...|
|00005f80| 20 20 20 49 66 20 4f 50 | 54 53 54 52 49 4e 47 20 | If OP|TSTRING |
|00005f90| 73 74 61 72 74 73 20 77 | 69 74 68 20 60 2d 27 20 |starts w|ith `-' |
|00005fa0| 6f 72 20 60 2b 27 2c 20 | 69 74 20 72 65 71 75 65 |or `+', |it reque|
|00005fb0| 73 74 73 20 64 69 66 66 | 65 72 65 6e 74 20 6d 65 |sts diff|erent me|
|00005fc0| 74 68 6f 64 73 20 6f 66 | 0a 20 20 20 68 61 6e 64 |thods of|. hand|
|00005fd0| 6c 69 6e 67 20 74 68 65 | 20 6e 6f 6e 2d 6f 70 74 |ling the| non-opt|
|00005fe0| 69 6f 6e 20 41 52 47 56 | 2d 65 6c 65 6d 65 6e 74 |ion ARGV|-element|
|00005ff0| 73 2e 0a 20 20 20 53 65 | 65 20 74 68 65 20 63 6f |s.. Se|e the co|
|00006000| 6d 6d 65 6e 74 73 20 61 | 62 6f 75 74 20 52 45 54 |mments a|bout RET|
|00006010| 55 52 4e 5f 49 4e 5f 4f | 52 44 45 52 20 61 6e 64 |URN_IN_O|RDER and|
|00006020| 20 52 45 51 55 49 52 45 | 5f 4f 52 44 45 52 2c 20 | REQUIRE|_ORDER, |
|00006030| 61 62 6f 76 65 2e 0a 0a | 20 20 20 4c 6f 6e 67 2d |above...| Long-|
|00006040| 6e 61 6d 65 64 20 6f 70 | 74 69 6f 6e 73 20 62 65 |named op|tions be|
|00006050| 67 69 6e 20 77 69 74 68 | 20 60 2d 2d 27 20 69 6e |gin with| `--' in|
|00006060| 73 74 65 61 64 20 6f 66 | 20 60 2d 27 2e 0a 20 20 |stead of| `-'.. |
|00006070| 20 54 68 65 69 72 20 6e | 61 6d 65 73 20 6d 61 79 | Their n|ames may|
|00006080| 20 62 65 20 61 62 62 72 | 65 76 69 61 74 65 64 20 | be abbr|eviated |
|00006090| 61 73 20 6c 6f 6e 67 20 | 61 73 20 74 68 65 20 61 |as long |as the a|
|000060a0| 62 62 72 65 76 69 61 74 | 69 6f 6e 20 69 73 20 75 |bbreviat|ion is u|
|000060b0| 6e 69 71 75 65 0a 20 20 | 20 6f 72 20 69 73 20 61 |nique. | or is a|
|000060c0| 6e 20 65 78 61 63 74 20 | 6d 61 74 63 68 20 66 6f |n exact |match fo|
|000060d0| 72 20 73 6f 6d 65 20 64 | 65 66 69 6e 65 64 20 6f |r some d|efined o|
|000060e0| 70 74 69 6f 6e 2e 20 20 | 49 66 20 74 68 65 79 20 |ption. |If they |
|000060f0| 68 61 76 65 20 61 6e 0a | 20 20 20 61 72 67 75 6d |have an.| argum|
|00006100| 65 6e 74 2c 20 69 74 20 | 66 6f 6c 6c 6f 77 73 20 |ent, it |follows |
|00006110| 74 68 65 20 6f 70 74 69 | 6f 6e 20 6e 61 6d 65 20 |the opti|on name |
|00006120| 69 6e 20 74 68 65 20 73 | 61 6d 65 20 41 52 47 56 |in the s|ame ARGV|
|00006130| 2d 65 6c 65 6d 65 6e 74 | 2c 20 73 65 70 61 72 61 |-element|, separa|
|00006140| 74 65 64 0a 20 20 20 66 | 72 6f 6d 20 74 68 65 20 |ted. f|rom the |
|00006150| 6f 70 74 69 6f 6e 20 6e | 61 6d 65 20 62 79 20 61 |option n|ame by a|
|00006160| 20 60 3d 27 2c 20 6f 72 | 20 65 6c 73 65 20 74 68 | `=', or| else th|
|00006170| 65 20 69 6e 20 6e 65 78 | 74 20 41 52 47 56 2d 65 |e in nex|t ARGV-e|
|00006180| 6c 65 6d 65 6e 74 2e 0a | 20 20 20 57 68 65 6e 20 |lement..| When |
|00006190| 60 67 65 74 6f 70 74 27 | 20 66 69 6e 64 73 20 61 |`getopt'| finds a|
|000061a0| 20 6c 6f 6e 67 2d 6e 61 | 6d 65 64 20 6f 70 74 69 | long-na|med opti|
|000061b0| 6f 6e 2c 20 69 74 20 72 | 65 74 75 72 6e 73 20 30 |on, it r|eturns 0|
|000061c0| 20 69 66 20 74 68 61 74 | 20 6f 70 74 69 6f 6e 27 | if that| option'|
|000061d0| 73 0a 20 20 20 60 66 6c | 61 67 27 20 66 69 65 6c |s. `fl|ag' fiel|
|000061e0| 64 20 69 73 20 6e 6f 6e | 7a 65 72 6f 2c 20 74 68 |d is non|zero, th|
|000061f0| 65 20 76 61 6c 75 65 20 | 6f 66 20 74 68 65 20 6f |e value |of the o|
|00006200| 70 74 69 6f 6e 27 73 20 | 60 76 61 6c 27 20 66 69 |ption's |`val' fi|
|00006210| 65 6c 64 0a 20 20 20 69 | 66 20 74 68 65 20 60 66 |eld. i|f the `f|
|00006220| 6c 61 67 27 20 66 69 65 | 6c 64 20 69 73 20 7a 65 |lag' fie|ld is ze|
|00006230| 72 6f 2e 0a 0a 20 20 20 | 54 68 65 20 65 6c 65 6d |ro... |The elem|
|00006240| 65 6e 74 73 20 6f 66 20 | 41 52 47 56 20 61 72 65 |ents of |ARGV are|
|00006250| 6e 27 74 20 72 65 61 6c | 6c 79 20 63 6f 6e 73 74 |n't real|ly const|
|00006260| 2c 20 62 65 63 61 75 73 | 65 20 77 65 20 70 65 72 |, becaus|e we per|
|00006270| 6d 75 74 65 20 74 68 65 | 6d 2e 0a 20 20 20 42 75 |mute the|m.. Bu|
|00006280| 74 20 77 65 20 70 72 65 | 74 65 6e 64 20 74 68 65 |t we pre|tend the|
|00006290| 79 27 72 65 20 63 6f 6e | 73 74 20 69 6e 20 74 68 |y're con|st in th|
|000062a0| 65 20 70 72 6f 74 6f 74 | 79 70 65 20 74 6f 20 62 |e protot|ype to b|
|000062b0| 65 20 63 6f 6d 70 61 74 | 69 62 6c 65 0a 20 20 20 |e compat|ible. |
|000062c0| 77 69 74 68 20 6f 74 68 | 65 72 20 73 79 73 74 65 |with oth|er syste|
|000062d0| 6d 73 2e 0a 0a 20 20 20 | 4c 4f 4e 47 4f 50 54 53 |ms... |LONGOPTS|
|000062e0| 20 69 73 20 61 20 76 65 | 63 74 6f 72 20 6f 66 20 | is a ve|ctor of |
|000062f0| 60 73 74 72 75 63 74 20 | 6f 70 74 69 6f 6e 27 20 |`struct |option' |
|00006300| 74 65 72 6d 69 6e 61 74 | 65 64 20 62 79 20 61 6e |terminat|ed by an|
|00006310| 0a 20 20 20 65 6c 65 6d | 65 6e 74 20 63 6f 6e 74 |. elem|ent cont|
|00006320| 61 69 6e 69 6e 67 20 61 | 20 6e 61 6d 65 20 77 68 |aining a| name wh|
|00006330| 69 63 68 20 69 73 20 7a | 65 72 6f 2e 0a 0a 20 20 |ich is z|ero... |
|00006340| 20 4c 4f 4e 47 49 4e 44 | 20 72 65 74 75 72 6e 73 | LONGIND| returns|
|00006350| 20 74 68 65 20 69 6e 64 | 65 78 20 69 6e 20 4c 4f | the ind|ex in LO|
|00006360| 4e 47 4f 50 54 20 6f 66 | 20 74 68 65 20 6c 6f 6e |NGOPT of| the lon|
|00006370| 67 2d 6e 61 6d 65 64 20 | 6f 70 74 69 6f 6e 20 66 |g-named |option f|
|00006380| 6f 75 6e 64 2e 0a 20 20 | 20 49 74 20 69 73 20 6f |ound.. | It is o|
|00006390| 6e 6c 79 20 76 61 6c 69 | 64 20 77 68 65 6e 20 61 |nly vali|d when a|
|000063a0| 20 6c 6f 6e 67 2d 6e 61 | 6d 65 64 20 6f 70 74 69 | long-na|med opti|
|000063b0| 6f 6e 20 68 61 73 20 62 | 65 65 6e 20 66 6f 75 6e |on has b|een foun|
|000063c0| 64 20 62 79 20 74 68 65 | 20 6d 6f 73 74 0a 20 20 |d by the| most. |
|000063d0| 20 72 65 63 65 6e 74 20 | 63 61 6c 6c 2e 0a 0a 20 | recent |call... |
|000063e0| 20 20 49 66 20 4c 4f 4e | 47 5f 4f 4e 4c 59 20 69 | If LON|G_ONLY i|
|000063f0| 73 20 6e 6f 6e 7a 65 72 | 6f 2c 20 27 2d 27 20 61 |s nonzer|o, '-' a|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.