home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume26 / feedpipe / part01 next >
SHell self-extracting ARchive  |  1991-12-14  |  20.4 KB

view JSON data     |     view as text     |     open on a Mac     |     open on a PC

This file was processed as: SHell self-extracting ARchive (archive/shar).

You can browse this item here: part01

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert SHell self-extracting ARchive (archive/shar) magic Supported
1% dexvert Text File (text/txt) fallback Supported
100% file C source, ASCII text default
100% checkBytes Printable ASCII default
100% perlTextCheck Likely Text (Perl) default
100% siegfried fmt/329 Shell Archive Format default
100% detectItEasy Format: plain text[LF] default (weak)



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 4e 65 77 73 67 72 6f 75 | 70 73 3a 20 63 6f 6d 70 |Newsgrou|ps: comp|
|00000010| 2e 73 6f 75 72 63 65 73 | 2e 6d 69 73 63 0a 46 72 |.sources|.misc.Fr|
|00000020| 6f 6d 3a 20 64 61 72 63 | 79 40 64 72 75 69 64 20 |om: darc|y@druid |
|00000030| 28 44 27 41 72 63 79 20 | 4a 2e 4d 2e 20 43 61 69 |(D'Arcy |J.M. Cai|
|00000040| 6e 29 0a 53 75 62 6a 65 | 63 74 3a 20 20 76 32 36 |n).Subje|ct: v26|
|00000050| 69 31 30 35 3a 20 20 66 | 65 65 64 70 69 70 65 20 |i105: f|eedpipe |
|00000060| 2d 20 66 65 65 64 20 61 | 20 70 72 6f 63 65 73 73 |- feed a| process|
|00000070| 20 74 6f 20 61 20 70 69 | 70 65 2c 20 50 61 72 74 | to a pi|pe, Part|
|00000080| 30 31 2f 30 31 0a 4d 65 | 73 73 61 67 65 2d 49 44 |01/01.Me|ssage-ID|
|00000090| 3a 20 3c 31 39 39 31 44 | 65 63 31 33 2e 31 37 30 |: <1991D|ec13.170|
|000000a0| 39 31 37 2e 32 36 37 39 | 35 40 73 70 61 72 6b 79 |917.2679|5@sparky|
|000000b0| 2e 69 6d 64 2e 73 74 65 | 72 6c 69 6e 67 2e 63 6f |.imd.ste|rling.co|
|000000c0| 6d 3e 0a 58 2d 4d 64 34 | 2d 53 69 67 6e 61 74 75 |m>.X-Md4|-Signatu|
|000000d0| 72 65 3a 20 35 38 35 38 | 35 66 39 35 35 31 64 30 |re: 5858|5f9551d0|
|000000e0| 30 39 63 62 66 39 34 39 | 33 39 38 66 31 38 63 63 |09cbf949|398f18cc|
|000000f0| 30 31 31 35 0a 44 61 74 | 65 3a 20 46 72 69 2c 20 |0115.Dat|e: Fri, |
|00000100| 31 33 20 44 65 63 20 31 | 39 39 31 20 31 37 3a 30 |13 Dec 1|991 17:0|
|00000110| 39 3a 31 37 20 47 4d 54 | 0a 41 70 70 72 6f 76 65 |9:17 GMT|.Approve|
|00000120| 64 3a 20 6b 65 6e 74 40 | 73 70 61 72 6b 79 2e 69 |d: kent@|sparky.i|
|00000130| 6d 64 2e 73 74 65 72 6c | 69 6e 67 2e 63 6f 6d 0a |md.sterl|ing.com.|
|00000140| 0a 53 75 62 6d 69 74 74 | 65 64 2d 62 79 3a 20 64 |.Submitt|ed-by: d|
|00000150| 61 72 63 79 40 64 72 75 | 69 64 20 28 44 27 41 72 |arcy@dru|id (D'Ar|
|00000160| 63 79 20 4a 2e 4d 2e 20 | 43 61 69 6e 29 0a 50 6f |cy J.M. |Cain).Po|
|00000170| 73 74 69 6e 67 2d 6e 75 | 6d 62 65 72 3a 20 56 6f |sting-nu|mber: Vo|
|00000180| 6c 75 6d 65 20 32 36 2c | 20 49 73 73 75 65 20 31 |lume 26,| Issue 1|
|00000190| 30 35 0a 41 72 63 68 69 | 76 65 2d 6e 61 6d 65 3a |05.Archi|ve-name:|
|000001a0| 20 66 65 65 64 70 69 70 | 65 2f 70 61 72 74 30 31 | feedpip|e/part01|
|000001b0| 0a 45 6e 76 69 72 6f 6e | 6d 65 6e 74 3a 20 55 4e |.Environ|ment: UN|
|000001c0| 49 58 2c 20 41 4e 53 49 | 2d 43 0a 0a 46 6f 72 20 |IX, ANSI|-C..For |
|000001d0| 69 6e 66 6f 72 6d 61 74 | 69 6f 6e 20 73 65 65 20 |informat|ion see |
|000001e0| 52 45 41 44 4d 45 2e 20 | 20 46 6f 72 20 63 6f 6e |README. | For con|
|000001f0| 76 65 6e 69 65 6e 63 65 | 20 74 68 69 73 20 69 73 |venience| this is|
|00000200| 20 74 68 65 20 66 69 72 | 73 74 20 66 69 6c 65 20 | the fir|st file |
|00000210| 69 6e 0a 74 68 65 20 73 | 68 61 72 20 64 69 73 74 |in.the s|har dist|
|00000220| 72 69 62 75 74 69 6f 6e | 2e 20 20 4e 6f 74 65 20 |ribution|. Note |
|00000230| 74 68 61 74 20 61 6e 20 | 41 4e 53 49 20 63 6f 6d |that an |ANSI com|
|00000240| 70 69 6c 65 72 20 69 73 | 20 72 65 71 75 69 72 65 |piler is| require|
|00000250| 64 2e 0a 0a 23 21 2f 62 | 69 6e 2f 73 68 0a 23 20 |d...#!/b|in/sh.# |
|00000260| 54 68 69 73 20 69 73 20 | 61 20 73 68 65 6c 6c 20 |This is |a shell |
|00000270| 61 72 63 68 69 76 65 20 | 28 70 72 6f 64 75 63 65 |archive |(produce|
|00000280| 64 20 62 79 20 73 68 61 | 72 20 33 2e 34 39 29 0a |d by sha|r 3.49).|
|00000290| 23 20 54 6f 20 65 78 74 | 72 61 63 74 20 74 68 65 |# To ext|ract the|
|000002a0| 20 66 69 6c 65 73 20 66 | 72 6f 6d 20 74 68 69 73 | files f|rom this|
|000002b0| 20 61 72 63 68 69 76 65 | 2c 20 73 61 76 65 20 69 | archive|, save i|
|000002c0| 74 20 74 6f 20 61 20 66 | 69 6c 65 2c 20 72 65 6d |t to a f|ile, rem|
|000002d0| 6f 76 65 0a 23 20 65 76 | 65 72 79 74 68 69 6e 67 |ove.# ev|erything|
|000002e0| 20 61 62 6f 76 65 20 74 | 68 65 20 22 21 2f 62 69 | above t|he "!/bi|
|000002f0| 6e 2f 73 68 22 20 6c 69 | 6e 65 20 61 62 6f 76 65 |n/sh" li|ne above|
|00000300| 2c 20 61 6e 64 20 74 79 | 70 65 20 22 73 68 20 66 |, and ty|pe "sh f|
|00000310| 69 6c 65 5f 6e 61 6d 65 | 22 2e 0a 23 0a 23 20 6d |ile_name|"..#.# m|
|00000320| 61 64 65 20 31 32 2f 30 | 38 2f 31 39 39 31 20 31 |ade 12/0|8/1991 1|
|00000330| 35 3a 35 39 20 55 54 43 | 20 62 79 20 64 61 72 63 |5:59 UTC| by darc|
|00000340| 79 40 64 72 75 69 64 0a | 23 20 53 6f 75 72 63 65 |y@druid.|# Source|
|00000350| 20 64 69 72 65 63 74 6f | 72 79 20 2f 75 73 72 2f | directo|ry /usr/|
|00000360| 64 61 72 63 79 2f 77 6f | 72 6b 2f 66 65 65 64 70 |darcy/wo|rk/feedp|
|00000370| 69 70 65 0a 23 0a 23 20 | 65 78 69 73 74 69 6e 67 |ipe.#.# |existing|
|00000380| 20 66 69 6c 65 73 20 57 | 49 4c 4c 20 62 65 20 6f | files W|ILL be o|
|00000390| 76 65 72 77 72 69 74 74 | 65 6e 0a 23 0a 23 20 20 |verwritt|en.#.# |
|000003a0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000003b0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000003c0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000003d0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000003e0| 20 20 20 20 20 20 20 20 | 0a 23 20 20 20 20 20 20 | |.# |
|000003f0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000400| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000410| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000420| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000430| 20 20 20 20 0a 23 0a 23 | 20 54 68 69 73 20 73 68 | .#.#| This sh|
|00000440| 61 72 20 63 6f 6e 74 61 | 69 6e 73 3a 0a 23 20 6c |ar conta|ins:.# l|
|00000450| 65 6e 67 74 68 20 20 6d | 6f 64 65 20 20 20 20 20 |ength m|ode |
|00000460| 20 20 6e 61 6d 65 0a 23 | 20 2d 2d 2d 2d 2d 2d 20 | name.#| ------ |
|00000470| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 20 2d 2d 2d 2d 2d |--------|-- -----|
|00000480| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000490| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000004a0| 2d 2d 2d 2d 2d 0a 23 20 | 20 20 31 37 37 37 20 2d |-----.# | 1777 -|
|000004b0| 72 77 2d 72 2d 2d 2d 2d | 2d 20 52 45 41 44 4d 45 |rw-r----|- README|
|000004c0| 0a 23 20 20 20 31 34 36 | 31 20 2d 72 77 2d 72 2d |.# 146|1 -rw-r-|
|000004d0| 2d 2d 2d 2d 20 66 65 65 | 64 70 69 70 65 2e 31 0a |---- fee|dpipe.1.|
|000004e0| 23 20 20 20 34 33 30 36 | 20 2d 72 77 2d 72 2d 2d |# 4306| -rw-r--|
|000004f0| 2d 2d 2d 20 66 65 65 64 | 70 69 70 65 2e 63 0a 23 |--- feed|pipe.c.#|
|00000500| 20 20 20 31 36 31 30 20 | 2d 72 77 2d 72 2d 2d 2d | 1610 |-rw-r---|
|00000510| 2d 2d 20 72 65 61 64 63 | 66 67 2e 63 0a 23 20 20 |-- readc|fg.c.# |
|00000520| 20 35 33 37 37 20 2d 72 | 77 2d 72 2d 2d 2d 2d 2d | 5377 -r|w-r-----|
|00000530| 20 67 65 74 6c 69 6e 65 | 2e 63 0a 23 20 20 20 31 | getline|.c.# 1|
|00000540| 36 31 33 20 2d 72 77 2d | 72 77 2d 72 2d 2d 20 4d |613 -rw-|rw-r-- M|
|00000550| 61 6b 65 66 69 6c 65 0a | 23 20 20 20 20 33 35 31 |akefile.|# 351|
|00000560| 20 2d 72 77 2d 72 2d 2d | 2d 2d 2d 20 66 65 65 64 | -rw-r--|--- feed|
|00000570| 70 69 70 65 2e 68 0a 23 | 0a 69 66 20 74 65 73 74 |pipe.h.#|.if test|
|00000580| 20 2d 72 20 5f 73 68 61 | 72 5f 73 65 71 5f 2e 74 | -r _sha|r_seq_.t|
|00000590| 6d 70 3b 20 74 68 65 6e | 0a 09 65 63 68 6f 20 27 |mp; then|..echo '|
|000005a0| 4d 75 73 74 20 75 6e 70 | 61 63 6b 20 61 72 63 68 |Must unp|ack arch|
|000005b0| 69 76 65 73 20 69 6e 20 | 73 65 71 75 65 6e 63 65 |ives in |sequence|
|000005c0| 21 27 0a 09 65 63 68 6f | 20 50 6c 65 61 73 65 20 |!'..echo| Please |
|000005d0| 75 6e 70 61 63 6b 20 70 | 61 72 74 20 60 63 61 74 |unpack p|art `cat|
|000005e0| 20 5f 73 68 61 72 5f 73 | 65 71 5f 2e 74 6d 70 60 | _shar_s|eq_.tmp`|
|000005f0| 20 6e 65 78 74 0a 09 65 | 78 69 74 20 31 0a 66 69 | next..e|xit 1.fi|
|00000600| 0a 23 20 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |.# =====|========|
|00000610| 20 52 45 41 44 4d 45 20 | 3d 3d 3d 3d 3d 3d 3d 3d | README |========|
|00000620| 3d 3d 3d 3d 3d 3d 0a 73 | 65 64 20 27 73 2f 5e 58 |======.s|ed 's/^X|
|00000630| 2f 2f 27 20 3c 3c 20 27 | 53 48 41 52 5f 45 4f 46 |//' << '|SHAR_EOF|
|00000640| 27 20 3e 20 27 52 45 41 | 44 4d 45 27 20 26 26 0a |' > 'REA|DME' &&.|
|00000650| 46 65 65 64 70 69 70 65 | 20 69 73 20 61 20 70 72 |Feedpipe| is a pr|
|00000660| 6f 67 72 61 6d 20 74 6f | 20 6d 61 6b 65 20 70 72 |ogram to| make pr|
|00000670| 6f 63 65 73 73 65 73 20 | 61 70 70 65 61 72 20 61 |ocesses |appear a|
|00000680| 73 20 66 69 6c 65 73 20 | 28 61 63 74 75 61 6c 6c |s files |(actuall|
|00000690| 79 20 61 20 6e 61 6d 65 | 64 0a 70 69 70 65 29 20 |y a name|d.pipe) |
|000006a0| 74 6f 20 6f 74 68 65 72 | 20 70 72 6f 63 65 73 73 |to other| process|
|000006b0| 65 73 2e 20 20 41 20 74 | 72 69 76 69 61 6c 20 75 |es. A t|rivial u|
|000006c0| 73 65 20 6f 66 20 74 68 | 69 73 20 77 6f 75 6c 64 |se of th|is would|
|000006d0| 20 62 65 20 61 73 20 61 | 20 72 61 6e 64 6f 6d 20 | be as a| random |
|000006e0| 73 69 67 0a 67 65 6e 65 | 72 61 74 6f 72 2e 20 20 |sig.gene|rator. |
|000006f0| 4d 6f 72 65 20 75 73 65 | 66 75 6c 20 69 73 20 74 |More use|ful is t|
|00000700| 6f 20 6d 61 6b 65 20 63 | 75 72 72 65 6e 74 20 69 |o make c|urrent i|
|00000710| 6e 66 6f 72 6d 61 74 69 | 6f 6e 20 61 76 61 69 6c |nformati|on avail|
|00000720| 61 62 6c 65 20 61 73 20 | 61 20 66 69 6c 65 0a 74 |able as |a file.t|
|00000730| 6f 20 70 72 6f 63 65 73 | 73 65 73 20 73 75 63 68 |o proces|ses such|
|00000740| 20 61 73 20 55 55 43 50 | 2e 0a 58 0a 41 6c 73 6f | as UUCP|..X.Also|
|00000750| 20 69 6e 63 6c 75 64 65 | 64 20 61 73 20 69 74 20 | include|d as it |
|00000760| 69 73 20 75 73 65 64 20 | 62 79 20 66 65 65 64 70 |is used |by feedp|
|00000770| 69 70 65 20 69 73 20 6d | 79 20 67 65 74 6c 69 6e |ipe is m|y getlin|
|00000780| 65 20 66 75 6e 63 74 69 | 6f 6e 2e 20 20 4e 6f 74 |e functi|on. Not|
|00000790| 65 20 74 68 69 73 0a 69 | 73 20 6e 6f 74 20 71 75 |e this.i|s not qu|
|000007a0| 69 74 65 20 6c 69 6b 65 | 20 74 68 65 20 42 53 44 |ite like| the BSD|
|000007b0| 20 67 65 74 6c 69 6e 65 | 2e 20 20 53 65 65 20 74 | getline|. See t|
|000007c0| 68 61 74 20 66 69 6c 65 | 20 66 6f 72 20 64 65 74 |hat file| for det|
|000007d0| 61 69 6c 73 2e 0a 58 0a | 41 20 6d 61 6e 20 70 61 |ails..X.|A man pa|
|000007e0| 67 65 20 69 73 20 70 72 | 6f 76 69 64 65 64 20 61 |ge is pr|ovided a|
|000007f0| 73 20 66 65 65 64 70 69 | 70 65 2e 31 0a 58 0a 48 |s feedpi|pe.1.X.H|
|00000800| 65 72 65 20 69 73 20 61 | 20 73 61 6d 70 6c 65 20 |ere is a| sample |
|00000810| 63 6f 6e 66 69 67 75 72 | 61 74 69 6f 6e 20 66 69 |configur|ation fi|
|00000820| 6c 65 20 66 6f 72 20 69 | 74 20 77 68 69 63 68 20 |le for i|t which |
|00000830| 64 65 6d 6f 6e 73 74 72 | 61 74 65 73 20 73 6f 6d |demonstr|ates som|
|00000840| 65 20 6f 66 20 74 68 65 | 0a 75 73 65 73 20 74 6f |e of the|.uses to|
|00000850| 20 77 68 69 63 68 20 49 | 20 61 6d 20 70 75 74 74 | which I| am putt|
|00000860| 69 6e 67 20 69 74 2e 0a | 58 0a 2d 2d 2d 2d 2d 2d |ing it..|X.------|
|00000870| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000880| 2d 20 53 74 61 72 74 20 | 6f 66 20 63 6f 6e 66 69 |- Start |of confi|
|00000890| 67 75 72 61 74 69 6f 6e | 20 66 69 6c 65 20 2d 2d |guration| file --|
|000008a0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000008b0| 2d 2d 2d 2d 2d 2d 2d 2d | 0a 23 20 43 6f 6e 66 69 |--------|.# Confi|
|000008c0| 67 75 72 61 74 69 6f 6e | 20 66 69 6c 65 20 66 6f |guration| file fo|
|000008d0| 72 20 66 65 65 64 70 69 | 70 65 0a 23 20 57 72 69 |r feedpi|pe.# Wri|
|000008e0| 74 74 65 6e 20 62 79 20 | 44 27 41 72 63 79 20 4a |tten by |D'Arcy J|
|000008f0| 2e 4d 2e 20 43 61 69 6e | 0a 58 0a 23 20 54 68 69 |.M. Cain|.X.# Thi|
|00000900| 73 20 66 69 6c 65 20 63 | 6f 6e 74 61 69 6e 73 20 |s file c|ontains |
|00000910| 74 68 65 20 69 6e 66 6f | 72 6d 61 74 69 6f 6e 20 |the info|rmation |
|00000920| 75 73 65 64 20 62 79 20 | 66 65 65 64 70 69 70 65 |used by |feedpipe|
|00000930| 20 74 6f 20 63 72 65 61 | 74 65 20 66 69 6c 65 73 | to crea|te files|
|00000940| 0a 58 0a 23 20 46 69 72 | 73 74 20 74 68 65 20 69 |.X.# Fir|st the i|
|00000950| 6e 66 6f 72 6d 61 74 69 | 6f 6e 20 66 69 6c 65 73 |nformati|on files|
|00000960| 2e 20 20 54 68 65 20 70 | 72 6f 67 72 61 6d 20 70 |. The p|rogram p|
|00000970| 75 62 69 6e 66 6f 20 69 | 73 20 62 61 73 69 63 61 |ubinfo i|s basica|
|00000980| 6c 6c 79 20 61 20 63 61 | 74 0a 23 20 66 72 6f 6d |lly a ca|t.# from|
|00000990| 20 61 20 68 65 72 65 20 | 66 69 6c 65 2e 20 20 54 | a here |file. T|
|000009a0| 68 65 20 73 65 63 6f 6e | 64 20 65 6e 74 72 79 20 |he secon|d entry |
|000009b0| 69 73 20 74 68 65 20 63 | 6f 6d 70 72 65 73 73 65 |is the c|ompresse|
|000009c0| 64 20 76 65 72 73 69 6f | 6e 0a 2f 75 73 72 2f 73 |d versio|n./usr/s|
|000009d0| 70 6f 6f 6c 2f 75 75 63 | 70 70 75 62 6c 69 63 2f |pool/uuc|ppublic/|
|000009e0| 70 75 62 2f 69 6e 66 6f | 2f 72 65 61 64 6d 65 09 |pub/info|/readme.|
|000009f0| 09 09 75 75 63 70 20 75 | 75 63 70 20 30 36 34 34 |..uucp u|ucp 0644|
|00000a00| 20 5c 0a 58 09 2f 75 73 | 72 2f 6c 62 69 6e 2f 70 | \.X./us|r/lbin/p|
|00000a10| 75 62 69 6e 66 6f 0a 2f | 75 73 72 2f 73 70 6f 6f |ubinfo./|usr/spoo|
|00000a20| 6c 2f 75 75 63 70 70 75 | 62 6c 69 63 2f 70 75 62 |l/uucppu|blic/pub|
|00000a30| 2f 69 6e 66 6f 2f 72 65 | 61 64 6d 65 2e 5a 09 09 |/info/re|adme.Z..|
|00000a40| 09 75 75 63 70 20 75 75 | 63 70 20 30 36 34 34 20 |.uucp uu|cp 0644 |
|00000a50| 5c 0a 58 09 2f 75 73 72 | 2f 6c 62 69 6e 2f 70 75 |\.X./usr|/lbin/pu|
|00000a60| 62 69 6e 66 6f 20 7c 20 | 2f 75 73 72 2f 6c 62 69 |binfo | |/usr/lbi|
|00000a70| 6e 2f 63 6f 6d 70 72 65 | 73 73 0a 58 0a 23 20 6c |n/compre|ss.X.# l|
|00000a80| 73 20 2d 6c 52 20 6f 66 | 20 6d 79 20 70 75 62 6c |s -lR of| my publ|
|00000a90| 69 63 20 64 69 72 65 63 | 74 6f 72 69 65 73 20 2d |ic direc|tories -|
|00000aa0| 20 6e 6f 74 65 20 75 73 | 65 20 6f 66 20 65 63 68 | note us|e of ech|
|00000ab0| 6f 20 61 6e 64 20 64 61 | 74 65 0a 2f 75 73 72 2f |o and da|te./usr/|
|00000ac0| 73 70 6f 6f 6c 2f 75 75 | 63 70 70 75 62 6c 69 63 |spool/uu|cppublic|
|00000ad0| 2f 70 75 62 2f 69 6e 66 | 6f 2f 6c 73 2d 6c 52 2e |/pub/inf|o/ls-lR.|
|00000ae0| 5a 09 09 09 75 75 63 70 | 20 75 75 63 70 20 30 36 |Z...uucp| uucp 06|
|00000af0| 34 34 20 5c 0a 58 09 28 | 65 63 68 6f 20 22 6c 73 |44 \.X.(|echo "ls|
|00000b00| 20 2d 6c 52 20 61 73 20 | 6f 66 20 5c 63 22 3b 20 | -lR as |of \c"; |
|00000b10| 64 61 74 65 3b 20 6c 73 | 20 2d 6c 52 20 2f 75 73 |date; ls| -lR /us|
|00000b20| 72 2f 73 70 6f 6f 6c 2f | 75 75 63 70 70 75 62 6c |r/spool/|uucppubl|
|00000b30| 69 63 2f 70 75 62 29 20 | 7c 20 5c 0a 58 09 2f 75 |ic/pub) || \.X./u|
|00000b40| 73 72 2f 6c 62 69 6e 2f | 63 6f 6d 70 72 65 73 73 |sr/lbin/|compress|
|00000b50| 0a 58 0a 23 20 54 68 69 | 73 20 69 73 20 74 68 65 |.X.# Thi|s is the|
|00000b60| 20 55 55 43 50 20 63 6c | 6f 6e 65 20 74 68 61 74 | UUCP cl|one that|
|00000b70| 20 49 20 61 6d 20 77 6f | 72 6b 69 6e 67 20 6f 6e | I am wo|rking on|
|00000b80| 2e 20 20 4e 6f 74 65 20 | 70 61 20 69 73 20 61 20 |. Note |pa is a |
|00000b90| 70 72 6f 67 72 61 6d 20 | 74 68 61 74 0a 23 20 63 |program |that.# c|
|00000ba0| 72 65 61 74 65 73 20 61 | 20 63 70 69 6f 20 61 72 |reates a| cpio ar|
|00000bb0| 63 68 69 76 65 20 6f 66 | 20 61 20 64 69 72 65 63 |chive of| a direc|
|00000bc0| 74 6f 72 79 20 61 6e 64 | 20 77 72 69 74 65 73 20 |tory and| writes |
|00000bd0| 69 74 20 74 6f 20 69 74 | 73 20 73 74 64 6f 75 74 |it to it|s stdout|
|00000be0| 2e 20 20 74 68 69 73 0a | 23 20 63 61 75 73 65 73 |. this.|# causes|
|00000bf0| 20 74 68 65 20 76 65 72 | 79 20 6c 61 74 65 73 74 | the ver|y latest|
|00000c00| 20 76 65 72 73 69 6f 6e | 20 6f 66 20 74 68 65 20 | version| of the |
|00000c10| 73 6f 75 72 63 65 20 74 | 72 65 65 20 74 6f 20 62 |source t|ree to b|
|00000c20| 65 20 6d 61 64 65 20 61 | 76 61 69 6c 61 62 6c 65 |e made a|vailable|
|00000c30| 0a 23 20 74 6f 20 55 55 | 43 50 0a 2f 75 73 72 2f |.# to UU|CP./usr/|
|00000c40| 73 70 6f 6f 6c 2f 75 75 | 63 70 70 75 62 6c 69 63 |spool/uu|cppublic|
|00000c50| 2f 70 75 62 2f 61 72 63 | 68 69 76 65 2f 75 75 64 |/pub/arc|hive/uud|
|00000c60| 6f 73 2e 43 50 2e 5a 09 | 64 61 72 63 79 20 70 72 |os.CP.Z.|darcy pr|
|00000c70| 6f 67 72 61 6d 20 30 36 | 34 34 20 5c 0a 58 09 63 |ogram 06|44 \.X.c|
|00000c80| 64 20 2f 75 73 72 2f 64 | 61 72 63 79 3b 20 2f 75 |d /usr/d|arcy; /u|
|00000c90| 73 72 2f 6c 62 69 6e 2f | 70 61 20 75 75 64 6f 73 |sr/lbin/|pa uudos|
|00000ca0| 20 32 3e 20 2f 64 65 76 | 2f 6e 75 6c 6c 0a 2d 2d | 2> /dev|/null.--|
|00000cb0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000cc0| 2d 2d 2d 2d 2d 2d 2d 20 | 65 6e 64 20 6f 66 20 63 |------- |end of c|
|00000cd0| 6f 6e 66 69 67 75 72 61 | 74 69 6f 6e 20 66 69 6c |onfigura|tion fil|
|00000ce0| 65 20 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |e ------|--------|
|00000cf0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 0a 58 0a 41 |--------|----.X.A|
|00000d00| 6e 79 20 63 6f 6d 6d 65 | 6e 74 73 2c 20 62 75 67 |ny comme|nts, bug|
|00000d10| 73 2c 20 73 75 67 67 65 | 73 74 69 6f 6e 73 20 65 |s, sugge|stions e|
|00000d20| 74 63 20 77 65 6c 63 6f | 6d 65 0a 58 0a 44 27 41 |tc welco|me.X.D'A|
|00000d30| 72 63 79 20 4a 2e 4d 2e | 20 43 61 69 6e 0a 64 61 |rcy J.M.| Cain.da|
|00000d40| 72 63 79 40 64 72 75 69 | 64 2e 55 55 43 50 0a 58 |rcy@drui|d.UUCP.X|
|00000d50| 0a 53 48 41 52 5f 45 4f | 46 0a 63 68 6d 6f 64 20 |.SHAR_EO|F.chmod |
|00000d60| 30 36 34 30 20 52 45 41 | 44 4d 45 20 7c 7c 0a 65 |0640 REA|DME ||.e|
|00000d70| 63 68 6f 20 27 72 65 73 | 74 6f 72 65 20 6f 66 20 |cho 'res|tore of |
|00000d80| 52 45 41 44 4d 45 20 66 | 61 69 6c 65 64 27 0a 57 |README f|ailed'.W|
|00000d90| 63 5f 63 3d 22 60 77 63 | 20 2d 63 20 3c 20 27 52 |c_c="`wc| -c < 'R|
|00000da0| 45 41 44 4d 45 27 60 22 | 0a 74 65 73 74 20 31 37 |EADME'`"|.test 17|
|00000db0| 37 37 20 2d 65 71 20 22 | 24 57 63 5f 63 22 20 7c |77 -eq "|$Wc_c" ||
|00000dc0| 7c 0a 09 65 63 68 6f 20 | 27 52 45 41 44 4d 45 3a ||..echo |'README:|
|00000dd0| 20 6f 72 69 67 69 6e 61 | 6c 20 73 69 7a 65 20 31 | origina|l size 1|
|00000de0| 37 37 37 2c 20 63 75 72 | 72 65 6e 74 20 73 69 7a |777, cur|rent siz|
|00000df0| 65 27 20 22 24 57 63 5f | 63 22 0a 23 20 3d 3d 3d |e' "$Wc_|c".# ===|
|00000e00| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 20 66 65 65 64 70 |========|== feedp|
|00000e10| 69 70 65 2e 31 20 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |ipe.1 ==|========|
|00000e20| 3d 3d 3d 3d 0a 73 65 64 | 20 27 73 2f 5e 58 2f 2f |====.sed| 's/^X//|
|00000e30| 27 20 3c 3c 20 27 53 48 | 41 52 5f 45 4f 46 27 20 |' << 'SH|AR_EOF' |
|00000e40| 3e 20 27 66 65 65 64 70 | 69 70 65 2e 31 27 20 26 |> 'feedp|ipe.1' &|
|00000e50| 26 0a 2e 54 48 20 46 45 | 45 44 50 49 50 45 20 31 |&..TH FE|EDPIPE 1|
|00000e60| 4c 20 22 4c 6f 63 61 6c | 20 43 6f 6d 6d 61 6e 64 |L "Local| Command|
|00000e70| 22 0a 2e 53 48 20 4e 41 | 4d 45 20 0a 2e 42 20 66 |"..SH NA|ME ..B f|
|00000e80| 65 65 64 70 69 70 65 5c | 5e 20 0a 2d 20 46 65 65 |eedpipe\|^ .- Fee|
|00000e90| 64 20 70 69 70 65 20 66 | 72 6f 6d 20 63 6f 6d 6d |d pipe f|rom comm|
|00000ea0| 61 6e 64 20 61 66 74 65 | 72 20 70 69 70 65 20 73 |and afte|r pipe s|
|00000eb0| 74 61 72 74 73 20 62 65 | 69 6e 67 20 72 65 61 64 |tarts be|ing read|
|00000ec0| 0a 2e 53 48 20 53 59 4e | 4f 50 53 49 53 20 0a 2e |..SH SYN|OPSIS ..|
|00000ed0| 42 20 66 65 65 64 70 69 | 70 65 5c 5e 20 0a 63 6f |B feedpi|pe\^ .co|
|00000ee0| 6e 66 69 67 5f 66 69 6c | 65 0a 2e 53 48 20 44 45 |nfig_fil|e..SH DE|
|00000ef0| 53 43 52 49 50 54 49 4f | 4e 20 0a 2e 42 20 46 65 |SCRIPTIO|N ..B Fe|
|00000f00| 65 64 70 69 70 65 0a 72 | 75 6e 73 20 61 20 73 70 |edpipe.r|uns a sp|
|00000f10| 65 63 69 66 69 65 64 20 | 63 6f 6d 6d 61 6e 64 20 |ecified |command |
|00000f20| 77 72 69 74 69 6e 67 20 | 74 68 65 20 6f 75 74 70 |writing |the outp|
|00000f30| 75 74 20 74 6f 20 61 20 | 73 70 65 63 69 66 69 65 |ut to a |specifie|
|00000f40| 64 0a 70 69 70 65 2e 20 | 20 41 66 74 65 72 20 6f |d.pipe. | After o|
|00000f50| 70 65 6e 69 6e 67 20 74 | 68 65 20 70 69 70 65 20 |pening t|he pipe |
|00000f60| 69 74 20 72 65 6d 6f 76 | 65 73 20 74 68 65 20 70 |it remov|es the p|
|00000f70| 69 70 65 20 6e 61 6d 65 | 20 61 6e 64 20 66 6f 72 |ipe name| and for|
|00000f80| 6b 73 0a 61 20 6e 65 77 | 20 70 72 6f 63 65 73 73 |ks.a new| process|
|00000f90| 20 74 6f 0a 64 6f 20 74 | 68 65 20 73 61 6d 65 20 | to.do t|he same |
|00000fa0| 74 68 69 6e 67 20 61 67 | 61 69 6e 2e 0a 2e 50 50 |thing ag|ain...PP|
|00000fb0| 0a 54 68 65 20 6f 70 65 | 6e 20 66 6f 72 20 77 72 |.The ope|n for wr|
|00000fc0| 69 74 69 6e 67 20 6f 6e | 20 74 68 65 20 70 69 70 |iting on| the pip|
|00000fd0| 65 20 77 69 6c 6c 20 62 | 6c 6f 63 6b 20 75 6e 74 |e will b|lock unt|
|00000fe0| 69 6c 20 73 6f 6d 65 6f | 6e 65 20 6f 70 65 6e 73 |il someo|ne opens|
|00000ff0| 0a 74 68 65 20 6f 74 68 | 65 72 20 65 6e 64 2e 20 |.the oth|er end. |
|00001000| 20 54 68 69 73 20 6d 65 | 61 6e 73 20 74 68 61 74 | This me|ans that|
|00001010| 20 74 68 65 20 63 6f 6d | 6d 61 6e 64 20 74 6f 20 | the com|mand to |
|00001020| 62 65 20 72 75 6e 20 77 | 69 6c 6c 20 62 65 0a 72 |be run w|ill be.r|
|00001030| 75 6e 20 6f 6e 6c 79 20 | 77 68 65 6e 20 73 6f 6d |un only |when som|
|00001040| 65 6f 6e 65 20 72 65 61 | 64 73 20 74 68 65 20 70 |eone rea|ds the p|
|00001050| 69 70 65 2e 20 20 54 68 | 69 73 20 69 73 20 64 65 |ipe. Th|is is de|
|00001060| 73 69 67 6e 65 64 20 74 | 6f 20 6d 61 6b 65 0a 74 |signed t|o make.t|
|00001070| 68 65 20 6f 75 74 70 75 | 74 20 6f 66 20 74 68 65 |he outpu|t of the|
|00001080| 20 70 69 70 65 20 75 70 | 20 74 6f 20 64 61 74 65 | pipe up| to date|
|00001090| 2e 0a 2e 50 50 0a 54 68 | 65 0a 2e 49 20 63 6f 6e |...PP.Th|e..I con|
|000010a0| 66 69 67 5f 66 69 6c 65 | 0a 69 73 20 75 73 65 64 |fig_file|.is used|
|000010b0| 20 74 6f 20 74 65 6c 6c | 0a 2e 42 20 66 65 65 64 | to tell|..B feed|
|000010c0| 70 69 70 65 0a 74 68 65 | 20 64 65 74 61 69 6c 73 |pipe.the| details|
|000010d0| 20 6f 66 20 74 68 65 20 | 66 65 65 64 73 2e 20 20 | of the |feeds. |
|000010e0| 45 61 63 68 20 6c 69 6e | 65 20 63 61 75 73 65 73 |Each lin|e causes|
|000010f0| 20 61 20 70 72 6f 63 65 | 73 73 20 74 6f 20 62 65 | a proce|ss to be|
|00001100| 20 66 6f 72 6b 65 64 20 | 61 6e 64 0a 61 20 66 65 | forked |and.a fe|
|00001110| 65 64 20 73 74 61 72 74 | 65 64 2e 20 20 54 68 65 |ed start|ed. The|
|00001120| 20 6c 69 6e 65 73 20 61 | 72 65 20 73 65 70 61 72 | lines a|re separ|
|00001130| 61 74 65 64 20 69 6e 74 | 6f 20 74 68 65 20 66 6f |ated int|o the fo|
|00001140| 6c 6c 6f 77 69 6e 67 20 | 73 70 61 63 65 0a 64 65 |llowing |space.de|
|00001150| 6c 69 6d 69 74 65 64 20 | 66 69 65 6c 64 73 3a 0a |limited |fields:.|
|00001160| 2e 73 70 0a 2e 6e 66 0a | 2e 69 6e 20 2b 34 0a 4e |.sp..nf.|.in +4.N|
|00001170| 61 6d 65 20 6f 66 20 70 | 69 70 65 0a 6f 77 6e 65 |ame of p|ipe.owne|
|00001180| 72 20 6f 66 20 70 69 70 | 65 20 28 22 2d 22 20 6d |r of pip|e ("-" m|
|00001190| 65 61 6e 73 20 75 69 64 | 20 6f 66 20 72 75 6e 6e |eans uid| of runn|
|000011a0| 69 6e 67 20 70 72 6f 63 | 65 73 73 29 0a 67 72 6f |ing proc|ess).gro|
|000011b0| 75 70 20 6f 66 20 70 69 | 70 65 20 28 22 2d 22 20 |up of pi|pe ("-" |
|000011c0| 6d 65 61 6e 73 20 67 69 | 64 20 6f 66 20 72 75 6e |means gi|d of run|
|000011d0| 6e 69 6e 67 20 70 72 6f | 63 65 73 73 29 0a 6d 6f |ning pro|cess).mo|
|000011e0| 64 65 20 74 6f 20 6f 70 | 65 6e 20 70 69 70 65 20 |de to op|en pipe |
|000011f0| 69 6e 0a 43 6f 6d 6d 61 | 6e 64 20 74 6f 20 66 65 |in.Comma|nd to fe|
|00001200| 65 64 20 74 6f 20 70 69 | 70 65 0a 2e 69 6e 20 2d |ed to pi|pe..in -|
|00001210| 34 0a 2e 50 50 0a 54 68 | 65 20 63 6f 6d 6d 61 6e |4..PP.Th|e comman|
|00001220| 64 20 74 6f 20 73 65 6e | 64 20 63 6f 6e 73 69 73 |d to sen|d consis|
|00001230| 74 73 20 6f 66 20 61 6c | 6c 20 74 65 78 74 20 73 |ts of al|l text s|
|00001240| 74 61 72 74 69 6e 67 20 | 61 74 20 74 68 65 20 73 |tarting |at the s|
|00001250| 65 63 6f 6e 64 20 66 69 | 65 6c 64 2e 0a 54 68 65 |econd fi|eld..The|
|00001260| 20 73 65 71 75 65 6e 63 | 65 20 62 61 63 6b 73 6c | sequenc|e backsl|
|00001270| 61 73 68 20 66 6f 6c 6c | 6f 77 65 64 20 62 79 20 |ash foll|owed by |
|00001280| 61 20 6e 65 77 6c 69 6e | 65 20 69 73 20 69 67 6e |a newlin|e is ign|
|00001290| 6f 72 65 64 20 61 6c 6c | 6f 77 69 6e 67 20 6c 61 |ored all|owing la|
|000012a0| 72 67 65 0a 6c 69 6e 65 | 73 20 74 6f 20 62 65 20 |rge.line|s to be |
|000012b0| 73 70 6c 69 74 20 75 70 | 20 66 6f 72 20 72 65 61 |split up| for rea|
|000012c0| 64 61 62 69 6c 69 74 79 | 2e 20 20 45 76 65 72 79 |dability|. Every|
|000012d0| 74 68 69 6e 67 20 66 6f | 6c 6c 6f 77 69 6e 67 20 |thing fo|llowing |
|000012e0| 74 68 65 20 22 23 22 0a | 63 68 61 72 61 63 74 65 |the "#".|characte|
|000012f0| 72 20 69 73 20 69 67 6e | 6f 72 65 64 20 61 73 20 |r is ign|ored as |
|00001300| 61 72 65 20 62 6c 61 6e | 6b 20 6c 69 6e 65 73 20 |are blan|k lines |
|00001310| 61 66 74 65 72 20 74 68 | 65 20 61 62 6f 76 65 20 |after th|e above |
|00001320| 73 75 62 73 74 69 74 75 | 74 69 6f 6e 73 2e 0a 4e |substitu|tions..N|
|00001330| 6f 20 66 75 72 74 68 65 | 72 20 70 72 65 2d 70 72 |o furthe|r pre-pr|
|00001340| 6f 63 65 73 73 69 6e 67 | 20 69 73 20 64 6f 6e 65 |ocessing| is done|
|00001350| 20 6f 6e 20 74 68 65 20 | 6c 69 6e 65 20 73 6f 20 | on the |line so |
|00001360| 61 6e 79 20 62 61 63 6b | 73 6c 61 73 68 65 73 2c |any back|slashes,|
|00001370| 20 6f 74 68 65 72 0a 74 | 68 61 6e 20 74 68 6f 73 | other.t|han thos|
|00001380| 65 20 70 72 65 63 65 64 | 69 6e 67 20 61 20 6e 65 |e preced|ing a ne|
|00001390| 77 6c 69 6e 65 2c 20 61 | 72 65 20 70 61 73 73 65 |wline, a|re passe|
|000013a0| 64 20 74 6f 20 74 68 65 | 20 63 6f 6d 6d 61 6e 64 |d to the| command|
|000013b0| 2e 0a 2e 53 48 20 43 41 | 56 45 41 54 0a 59 6f 75 |...SH CA|VEAT.You|
|000013c0| 20 73 68 6f 75 6c 64 20 | 6e 65 76 65 72 20 70 75 | should |never pu|
|000013d0| 74 20 74 68 65 20 70 72 | 6f 67 72 61 6d 20 74 6f |t the pr|ogram to|
|000013e0| 20 72 75 6e 20 69 6e 20 | 61 20 64 69 72 65 63 74 | run in |a direct|
|000013f0| 6f 72 79 20 77 72 69 74 | 65 61 62 6c 65 20 62 79 |ory writ|eable by|
|00001400| 20 55 55 43 50 2e 0a 53 | 48 41 52 5f 45 4f 46 0a | UUCP..S|HAR_EOF.|
|00001410| 63 68 6d 6f 64 20 30 36 | 34 30 20 66 65 65 64 70 |chmod 06|40 feedp|
|00001420| 69 70 65 2e 31 20 7c 7c | 0a 65 63 68 6f 20 27 72 |ipe.1 |||.echo 'r|
|00001430| 65 73 74 6f 72 65 20 6f | 66 20 66 65 65 64 70 69 |estore o|f feedpi|
|00001440| 70 65 2e 31 20 66 61 69 | 6c 65 64 27 0a 57 63 5f |pe.1 fai|led'.Wc_|
|00001450| 63 3d 22 60 77 63 20 2d | 63 20 3c 20 27 66 65 65 |c="`wc -|c < 'fee|
|00001460| 64 70 69 70 65 2e 31 27 | 60 22 0a 74 65 73 74 20 |dpipe.1'|`".test |
|00001470| 31 34 36 31 20 2d 65 71 | 20 22 24 57 63 5f 63 22 |1461 -eq| "$Wc_c"|
|00001480| 20 7c 7c 0a 09 65 63 68 | 6f 20 27 66 65 65 64 70 | ||..ech|o 'feedp|
|00001490| 69 70 65 2e 31 3a 20 6f | 72 69 67 69 6e 61 6c 20 |ipe.1: o|riginal |
|000014a0| 73 69 7a 65 20 31 34 36 | 31 2c 20 63 75 72 72 65 |size 146|1, curre|
|000014b0| 6e 74 20 73 69 7a 65 27 | 20 22 24 57 63 5f 63 22 |nt size'| "$Wc_c"|
|000014c0| 0a 23 20 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |.# =====|========|
|000014d0| 20 66 65 65 64 70 69 70 | 65 2e 63 20 3d 3d 3d 3d | feedpip|e.c ====|
|000014e0| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 0a 73 65 64 20 27 |========|==.sed '|
|000014f0| 73 2f 5e 58 2f 2f 27 20 | 3c 3c 20 27 53 48 41 52 |s/^X//' |<< 'SHAR|
|00001500| 5f 45 4f 46 27 20 3e 20 | 27 66 65 65 64 70 69 70 |_EOF' > |'feedpip|
|00001510| 65 2e 63 27 20 26 26 0a | 2f 2a 0a 66 65 65 64 70 |e.c' &&.|/*.feedp|
|00001520| 69 70 65 2e 63 0a 57 72 | 69 74 74 65 6e 20 62 79 |ipe.c.Wr|itten by|
|00001530| 20 44 27 41 72 63 79 20 | 4a 2e 4d 2e 20 43 61 69 | D'Arcy |J.M. Cai|
|00001540| 6e 0a 58 0a 46 65 65 64 | 73 20 63 6f 6d 6d 61 6e |n.X.Feed|s comman|
|00001550| 64 20 74 6f 20 61 20 6e | 61 6d 65 64 20 70 69 70 |d to a n|amed pip|
|00001560| 65 0a 2a 2f 0a 58 0a 23 | 69 6e 63 6c 75 64 65 09 |e.*/.X.#|include.|
|00001570| 3c 73 74 64 69 6f 2e 68 | 3e 0a 23 69 6e 63 6c 75 |<stdio.h|>.#inclu|
|00001580| 64 65 09 3c 73 74 64 6c | 69 62 2e 68 3e 0a 23 69 |de.<stdl|ib.h>.#i|
|00001590| 6e 63 6c 75 64 65 09 3c | 70 72 6f 63 65 73 73 2e |nclude.<|process.|
|000015a0| 68 3e 0a 23 69 6e 63 6c | 75 64 65 09 3c 73 69 67 |h>.#incl|ude.<sig|
|000015b0| 6e 61 6c 2e 68 3e 0a 23 | 69 6e 63 6c 75 64 65 09 |nal.h>.#|include.|
|000015c0| 3c 69 6f 2e 68 3e 0a 23 | 69 6e 63 6c 75 64 65 09 |<io.h>.#|include.|
|000015d0| 3c 73 74 72 69 6e 67 2e | 68 3e 0a 23 69 6e 63 6c |<string.|h>.#incl|
|000015e0| 75 64 65 09 3c 65 72 72 | 6e 6f 2e 68 3e 0a 23 69 |ude.<err|no.h>.#i|
|000015f0| 6e 63 6c 75 64 65 09 3c | 6d 61 6c 6c 6f 63 2e 68 |nclude.<|malloc.h|
|00001600| 3e 0a 23 69 6e 63 6c 75 | 64 65 09 3c 70 77 64 2e |>.#inclu|de.<pwd.|
|00001610| 68 3e 0a 23 69 6e 63 6c | 75 64 65 09 3c 67 72 70 |h>.#incl|ude.<grp|
|00001620| 2e 68 3e 0a 23 69 6e 63 | 6c 75 64 65 09 3c 73 79 |.h>.#inc|lude.<sy|
|00001630| 73 2f 73 74 61 74 2e 68 | 3e 0a 23 69 6e 63 6c 75 |s/stat.h|>.#inclu|
|00001640| 64 65 09 22 66 65 65 64 | 70 69 70 65 2e 68 22 0a |de."feed|pipe.h".|
|00001650| 58 0a 2f 2a 20 67 6c 6f | 62 61 6c 73 20 2a 2f 0a |X./* glo|bals */.|
|00001660| 46 50 5f 43 46 47 09 2a | 66 70 5f 63 66 67 3b 0a |FP_CFG.*|fp_cfg;.|
|00001670| 63 68 61 72 09 2a 70 72 | 6f 67 6e 61 6d 65 3b 0a |char.*pr|ogname;.|
|00001680| 58 0a 73 74 61 74 69 63 | 20 63 68 61 72 09 2a 66 |X.static| char.*f|
|00001690| 5f 6e 61 6d 65 3b 0a 58 | 0a 73 74 61 74 69 63 20 |_name;.X|.static |
|000016a0| 76 6f 69 64 09 63 6c 65 | 61 6e 75 70 28 69 6e 74 |void.cle|anup(int|
|000016b0| 20 73 69 67 29 0a 7b 0a | 58 09 75 6e 6c 69 6e 6b | sig).{.|X.unlink|
|000016c0| 28 66 5f 6e 61 6d 65 29 | 3b 0a 58 09 65 78 69 74 |(f_name)|;.X.exit|
|000016d0| 28 73 69 67 29 3b 0a 7d | 0a 58 0a 2f 2a 20 66 75 |(sig);.}|.X./* fu|
|000016e0| 6e 63 74 69 6f 6e 20 63 | 61 6c 6c 65 64 20 66 6f |nction c|alled fo|
|000016f0| 72 20 65 61 63 68 20 6c | 69 6e 65 20 69 6e 20 63 |r each l|ine in c|
|00001700| 6f 6e 66 69 67 75 72 61 | 74 69 6f 6e 20 66 69 6c |onfigura|tion fil|
|00001710| 65 20 2a 2f 0a 73 74 61 | 74 69 63 20 76 6f 69 64 |e */.sta|tic void|
|00001720| 09 66 65 65 64 70 69 70 | 65 28 46 50 5f 43 46 47 |.feedpip|e(FP_CFG|
|00001730| 20 66 63 29 0a 7b 0a 58 | 09 69 6e 74 09 09 63 68 | fc).{.X|.int..ch|
|00001740| 69 6c 64 2c 20 6b 2c 20 | 75 69 64 2c 20 67 69 64 |ild, k, |uid, gid|
|00001750| 3b 0a 58 09 46 49 4c 45 | 09 2a 70 69 70 65 5f 66 |;.X.FILE|.*pipe_f|
|00001760| 70 2c 20 2a 66 70 3b 0a | 58 0a 58 09 2f 2a 20 66 |p, *fp;.|X.X./* f|
|00001770| 6f 72 6b 20 61 6e 64 20 | 63 68 65 63 6b 20 66 6f |ork and |check fo|
|00001780| 72 20 65 72 72 6f 72 20 | 2a 2f 0a 58 09 69 66 20 |r error |*/.X.if |
|00001790| 28 28 63 68 69 6c 64 20 | 3d 20 66 6f 72 6b 28 29 |((child |= fork()|
|000017a0| 29 20 3d 3d 20 2d 31 29 | 0a 58 09 7b 0a 58 09 09 |) == -1)|.X.{.X..|
|000017b0| 66 70 72 69 6e 74 66 28 | 73 74 64 65 72 72 2c 20 |fprintf(|stderr, |
|000017c0| 22 25 73 3a 20 43 61 6e | 27 74 20 66 6f 72 6b 20 |"%s: Can|'t fork |
|000017d0| 28 25 73 29 5c 6e 22 2c | 20 70 72 6f 67 6e 61 6d |(%s)\n",| prognam|
|000017e0| 65 2c 20 73 74 72 65 72 | 72 6f 72 28 65 72 72 6e |e, strer|ror(errn|
|000017f0| 6f 29 29 3b 0a 58 09 09 | 65 78 69 74 28 33 29 3b |o));.X..|exit(3);|
|00001800| 0a 58 09 7d 0a 58 0a 58 | 09 2f 2a 20 69 66 20 6e |.X.}.X.X|./* if n|
|00001810| 6f 20 65 72 72 6f 72 20 | 61 6e 64 20 70 61 72 65 |o error |and pare|
|00001820| 6e 74 20 70 72 6f 63 65 | 73 73 20 74 68 65 6e 20 |nt proce|ss then |
|00001830| 72 65 74 75 72 6e 20 69 | 6d 6d 65 64 69 61 74 65 |return i|mmediate|
|00001840| 6c 79 20 2a 2f 0a 58 09 | 69 66 20 28 63 68 69 6c |ly */.X.|if (chil|
|00001850| 64 29 0a 58 09 09 72 65 | 74 75 72 6e 3b 0a 58 0a |d).X..re|turn;.X.|
|00001860| 58 09 2f 2a 20 77 65 20 | 61 72 65 20 6e 6f 77 20 |X./* we |are now |
|00001870| 61 20 6e 65 77 20 70 72 | 6f 63 65 73 73 20 77 69 |a new pr|ocess wi|
|00001880| 74 68 20 61 20 63 6f 6d | 6d 61 6e 64 20 74 6f 20 |th a com|mand to |
|00001890| 72 75 6e 20 2a 2f 0a 58 | 09 66 5f 6e 61 6d 65 20 |run */.X|.f_name |
|000018a0| 3d 20 66 63 2e 6e 61 6d | 65 3b 0a 58 0a 58 09 73 |= fc.nam|e;.X.X.s|
|000018b0| 69 67 6e 61 6c 28 53 49 | 47 48 55 50 2c 20 63 6c |ignal(SI|GHUP, cl|
|000018c0| 65 61 6e 75 70 29 3b 0a | 58 09 73 69 67 6e 61 6c |eanup);.|X.signal|
|000018d0| 28 53 49 47 49 4e 54 2c | 20 63 6c 65 61 6e 75 70 |(SIGINT,| cleanup|
|000018e0| 29 3b 0a 58 09 73 69 67 | 6e 61 6c 28 53 49 47 54 |);.X.sig|nal(SIGT|
|000018f0| 45 52 4d 2c 20 63 6c 65 | 61 6e 75 70 29 3b 0a 58 |ERM, cle|anup);.X|
|00001900| 0a 58 09 2f 2a 20 74 68 | 65 20 63 68 69 6c 64 20 |.X./* th|e child |
|00001910| 64 6f 65 73 6e 27 74 20 | 6e 65 65 64 20 74 68 69 |doesn't |need thi|
|00001920| 73 20 61 72 72 61 79 20 | 2a 2f 0a 58 09 66 72 65 |s array |*/.X.fre|
|00001930| 65 28 66 70 5f 63 66 67 | 29 3b 0a 58 0a 58 09 2f |e(fp_cfg|);.X.X./|
|00001940| 2a 20 6d 6f 64 65 20 69 | 73 20 66 6f 72 20 70 65 |* mode i|s for pe|
|00001950| 72 6d 69 73 73 69 6f 6e | 73 20 6f 6e 6c 79 20 2d |rmission|s only -|
|00001960| 20 69 74 27 73 20 61 6c | 77 61 79 73 20 61 20 70 | it's al|ways a p|
|00001970| 69 70 65 20 2a 2f 0a 58 | 09 66 63 2e 6d 6f 64 65 |ipe */.X|.fc.mode|
|00001980| 20 26 3d 20 30 30 30 37 | 37 37 3b 0a 58 09 66 63 | &= 0007|77;.X.fc|
|00001990| 2e 6d 6f 64 65 20 7c 3d | 20 53 5f 49 46 49 46 4f |.mode |=| S_IFIFO|
|000019a0| 3b 0a 58 0a 58 09 69 66 | 20 28 66 63 2e 6f 77 6e |;.X.X.if| (fc.own|
|000019b0| 65 72 20 3d 3d 20 4e 55 | 4c 4c 29 0a 58 09 09 75 |er == NU|LL).X..u|
|000019c0| 69 64 20 3d 20 67 65 74 | 75 69 64 28 29 3b 0a 58 |id = get|uid();.X|
|000019d0| 09 65 6c 73 65 0a 58 09 | 7b 0a 58 09 09 73 74 72 |.else.X.|{.X..str|
|000019e0| 75 63 74 20 70 61 73 73 | 77 64 09 2a 70 77 3b 0a |uct pass|wd.*pw;.|
|000019f0| 58 0a 58 09 09 69 66 20 | 28 28 70 77 20 3d 20 67 |X.X..if |((pw = g|
|00001a00| 65 74 70 77 6e 61 6d 28 | 66 63 2e 6f 77 6e 65 72 |etpwnam(|fc.owner|
|00001a10| 29 29 20 3d 3d 20 4e 55 | 4c 4c 29 0a 58 09 09 7b |)) == NU|LL).X..{|
|00001a20| 0a 58 09 09 09 66 70 72 | 69 6e 74 66 28 73 74 64 |.X...fpr|intf(std|
|00001a30| 65 72 72 2c 20 22 25 73 | 3a 20 4e 6f 20 73 75 63 |err, "%s|: No suc|
|00001a40| 68 20 75 73 65 72 20 25 | 73 5c 6e 22 2c 20 70 72 |h user %|s\n", pr|
|00001a50| 6f 67 6e 61 6d 65 2c 20 | 66 63 2e 6f 77 6e 65 72 |ogname, |fc.owner|
|00001a60| 29 3b 0a 58 09 09 09 65 | 78 69 74 28 34 29 3b 0a |);.X...e|xit(4);.|
|00001a70| 58 09 09 7d 0a 58 0a 58 | 09 09 75 69 64 20 3d 20 |X..}.X.X|..uid = |
|00001a80| 70 77 2d 3e 70 77 5f 75 | 69 64 3b 0a 58 09 7d 0a |pw->pw_u|id;.X.}.|
|00001a90| 58 0a 58 09 69 66 20 28 | 66 63 2e 67 72 6f 75 70 |X.X.if (|fc.group|
|00001aa0| 20 3d 3d 20 4e 55 4c 4c | 29 0a 58 09 09 67 69 64 | == NULL|).X..gid|
|00001ab0| 20 3d 20 67 65 74 67 69 | 64 28 29 3b 0a 58 09 65 | = getgi|d();.X.e|
|00001ac0| 6c 73 65 0a 58 09 7b 0a | 58 09 09 73 74 72 75 63 |lse.X.{.|X..struc|
|00001ad0| 74 20 67 72 6f 75 70 09 | 2a 67 72 3b 0a 58 0a 58 |t group.|*gr;.X.X|
|00001ae0| 09 09 69 66 20 28 28 67 | 72 20 3d 20 67 65 74 67 |..if ((g|r = getg|
|00001af0| 72 6e 61 6d 28 66 63 2e | 67 72 6f 75 70 29 29 20 |rnam(fc.|group)) |
|00001b00| 3d 3d 20 4e 55 4c 4c 29 | 0a 58 09 09 7b 0a 58 09 |== NULL)|.X..{.X.|
|00001b10| 09 09 66 70 72 69 6e 74 | 66 28 73 74 64 65 72 72 |..fprint|f(stderr|
|00001b20| 2c 20 22 25 73 3a 20 4e | 6f 20 73 75 63 68 20 67 |, "%s: N|o such g|
|00001b30| 72 6f 75 70 20 25 73 5c | 6e 22 2c 20 70 72 6f 67 |roup %s\|n", prog|
|00001b40| 6e 61 6d 65 2c 20 66 63 | 2e 67 72 6f 75 70 29 3b |name, fc|.group);|
|00001b50| 0a 58 09 09 09 65 78 69 | 74 28 35 29 3b 0a 58 09 |.X...exi|t(5);.X.|
|00001b60| 09 7d 0a 58 0a 58 09 09 | 67 69 64 20 3d 20 67 72 |.}.X.X..|gid = gr|
|00001b70| 2d 3e 67 72 5f 67 69 64 | 3b 0a 58 09 7d 0a 58 0a |->gr_gid|;.X.}.X.|
|00001b80| 58 09 2f 2a 20 74 68 69 | 73 20 6c 6f 6f 70 20 6d |X./* thi|s loop m|
|00001b90| 61 79 20 73 65 65 6d 20 | 61 20 6c 69 74 74 6c 65 |ay seem |a little|
|00001ba0| 20 73 74 72 61 6e 67 65 | 20 2a 2f 0a 58 09 2f 2a | strange| */.X./*|
|00001bb0| 20 65 61 63 68 20 69 74 | 65 72 61 74 69 6f 6e 20 | each it|eration |
|00001bc0| 74 68 72 6f 75 67 68 20 | 69 74 20 69 73 20 61 63 |through |it is ac|
|00001bd0| 74 75 61 6c 6c 79 20 61 | 20 6e 65 77 20 70 72 6f |tually a| new pro|
|00001be0| 63 65 73 73 20 2a 2f 0a | 58 09 66 6f 72 20 28 3b |cess */.|X.for (;|
|00001bf0| 3b 29 0a 58 09 7b 0a 58 | 09 09 63 68 61 72 09 62 |;).X.{.X|..char.b|
|00001c00| 75 66 5b 42 55 46 53 49 | 5a 5d 3b 0a 58 0a 58 09 |uf[BUFSI|Z];.X.X.|
|00001c10| 09 2f 2a 20 72 65 6d 6f | 76 65 20 61 6e 79 20 65 |./* remo|ve any e|
|00001c20| 78 69 73 74 69 6e 67 20 | 66 69 6c 65 20 6f 72 20 |xisting |file or |
|00001c30| 70 69 70 65 20 2a 2f 0a | 58 09 09 75 6e 6c 69 6e |pipe */.|X..unlin|
|00001c40| 6b 28 66 63 2e 6e 61 6d | 65 29 3b 0a 58 0a 58 09 |k(fc.nam|e);.X.X.|
|00001c50| 09 2f 2a 20 63 72 65 61 | 74 65 20 74 68 65 20 6e |./* crea|te the n|
|00001c60| 65 77 20 70 69 70 65 20 | 2a 2f 0a 58 09 09 69 66 |ew pipe |*/.X..if|
|00001c70| 20 28 6d 6b 6e 6f 64 28 | 66 63 2e 6e 61 6d 65 2c | (mknod(|fc.name,|
|00001c80| 20 66 63 2e 6d 6f 64 65 | 2c 20 30 29 29 0a 58 09 | fc.mode|, 0)).X.|
|00001c90| 09 7b 0a 58 09 09 09 66 | 70 72 69 6e 74 66 28 73 |.{.X...f|printf(s|
|00001ca0| 74 64 65 72 72 2c 20 22 | 25 73 3a 20 43 61 6e 27 |tderr, "|%s: Can'|
|00001cb0| 74 20 63 72 65 61 74 65 | 20 70 69 70 65 20 25 73 |t create| pipe %s|
|00001cc0| 20 28 25 73 29 5c 6e 22 | 2c 0a 58 09 09 09 09 09 | (%s)\n"|,.X.....|
|00001cd0| 09 09 09 70 72 6f 67 6e | 61 6d 65 2c 20 66 63 2e |...progn|ame, fc.|
|00001ce0| 6e 61 6d 65 2c 20 73 74 | 72 65 72 72 6f 72 28 65 |name, st|rerror(e|
|00001cf0| 72 72 6e 6f 29 29 3b 0a | 58 09 09 09 65 78 69 74 |rrno));.|X...exit|
|00001d00| 28 36 29 3b 0a 58 09 09 | 7d 0a 58 0a 58 09 09 69 |(6);.X..|}.X.X..i|
|00001d10| 66 20 28 63 68 6f 77 6e | 28 66 63 2e 6e 61 6d 65 |f (chown|(fc.name|
|00001d20| 2c 20 75 69 64 2c 20 67 | 69 64 29 29 0a 58 09 09 |, uid, g|id)).X..|
|00001d30| 7b 0a 58 09 09 09 66 70 | 72 69 6e 74 66 28 73 74 |{.X...fp|rintf(st|
|00001d40| 64 65 72 72 2c 20 22 25 | 73 3a 20 43 61 6e 27 74 |derr, "%|s: Can't|
|00001d50| 20 63 68 61 6e 67 65 20 | 67 72 6f 75 70 20 61 6e | change |group an|
|00001d60| 64 2f 6f 72 20 6f 77 6e | 65 72 20 25 73 20 28 25 |d/or own|er %s (%|
|00001d70| 73 29 5c 6e 22 2c 0a 58 | 09 09 09 09 09 09 09 09 |s)\n",.X|........|
|00001d80| 70 72 6f 67 6e 61 6d 65 | 2c 20 66 63 2e 6e 61 6d |progname|, fc.nam|
|00001d90| 65 2c 20 73 74 72 65 72 | 72 6f 72 28 65 72 72 6e |e, strer|ror(errn|
|00001da0| 6f 29 29 3b 0a 58 09 09 | 09 65 78 69 74 28 37 29 |o));.X..|.exit(7)|
|00001db0| 3b 0a 58 09 09 7d 0a 58 | 0a 58 09 09 2f 2a 20 74 |;.X..}.X|.X../* t|
|00001dc0| 68 69 73 20 6f 70 65 6e | 20 77 69 6c 6c 20 62 6c |his open| will bl|
|00001dd0| 6f 63 6b 20 75 6e 74 69 | 6c 20 73 6f 6d 65 6f 6e |ock unti|l someon|
|00001de0| 65 20 72 65 61 64 73 20 | 74 68 65 20 6f 74 68 65 |e reads |the othe|
|00001df0| 72 20 65 6e 64 20 2a 2f | 0a 58 09 09 69 66 20 28 |r end */|.X..if (|
|00001e00| 28 70 69 70 65 5f 66 70 | 20 3d 20 66 6f 70 65 6e |(pipe_fp| = fopen|
|00001e10| 28 66 63 2e 6e 61 6d 65 | 2c 20 22 77 74 22 29 29 |(fc.name|, "wt"))|
|00001e20| 20 3d 3d 20 4e 55 4c 4c | 29 0a 58 09 09 7b 0a 58 | == NULL|).X..{.X|
|00001e30| 09 09 09 66 70 72 69 6e | 74 66 28 73 74 64 65 72 |...fprin|tf(stder|
|00001e40| 72 2c 20 22 25 73 3a 20 | 43 61 6e 27 74 20 6f 70 |r, "%s: |Can't op|
|00001e50| 65 6e 20 70 69 70 65 20 | 25 73 20 28 25 73 29 5c |en pipe |%s (%s)\|
|00001e60| 6e 22 2c 0a 58 09 09 09 | 09 09 09 09 09 70 72 6f |n",.X...|.....pro|
|00001e70| 67 6e 61 6d 65 2c 20 66 | 63 2e 6e 61 6d 65 2c 20 |gname, f|c.name, |
|00001e80| 73 74 72 65 72 72 6f 72 | 28 65 72 72 6e 6f 29 29 |strerror|(errno))|
|00001e90| 3b 0a 58 09 09 09 65 78 | 69 74 28 38 29 3b 0a 58 |;.X...ex|it(8);.X|
|00001ea0| 09 09 7d 0a 58 0a 58 09 | 09 2f 2a 20 77 68 65 6e |..}.X.X.|./* when|
|00001eb0| 20 77 65 20 67 65 74 20 | 68 65 72 65 20 73 6f 6d | we get |here som|
|00001ec0| 65 6f 6e 65 20 69 73 20 | 72 65 61 64 69 6e 67 20 |eone is |reading |
|00001ed0| 74 68 65 20 70 69 70 65 | 20 77 65 20 6f 70 65 6e |the pipe| we open|
|00001ee0| 65 64 20 2a 2f 0a 58 09 | 09 2f 2a 20 61 74 20 74 |ed */.X.|./* at t|
|00001ef0| 68 69 73 20 70 6f 69 6e | 74 20 77 65 20 66 6f 72 |his poin|t we for|
|00001f00| 6b 20 61 20 6e 65 77 20 | 70 72 6f 63 65 73 73 20 |k a new |process |
|00001f10| 74 6f 20 63 72 65 61 74 | 65 20 74 68 65 20 6e 6f |to creat|e the no|
|00001f20| 64 65 20 2a 2f 0a 58 09 | 09 2f 2a 20 61 67 61 69 |de */.X.|./* agai|
|00001f30| 6e 20 61 6e 64 20 62 6c | 6f 63 6b 20 6f 6e 20 6f |n and bl|ock on o|
|00001f40| 70 65 6e 69 6e 67 20 69 | 74 20 2d 20 74 68 69 73 |pening i|t - this|
|00001f50| 20 61 6c 6c 6f 77 73 20 | 61 6e 6f 74 68 65 72 20 | allows |another |
|00001f60| 70 72 6f 63 65 73 73 20 | 2a 2f 0a 58 09 09 2f 2a |process |*/.X../*|
|00001f70| 20 74 6f 20 6f 70 65 6e | 20 74 68 65 20 73 61 6d | to open| the sam|
|00001f80| 65 20 70 69 70 65 20 61 | 6e 64 20 67 65 74 20 74 |e pipe a|nd get t|
|00001f90| 68 65 20 66 75 6c 6c 20 | 66 69 6c 65 20 61 66 74 |he full |file aft|
|00001fa0| 65 72 20 61 20 76 65 72 | 79 20 2a 2f 0a 58 09 09 |er a ver|y */.X..|
|00001fb0| 2f 2a 20 73 68 6f 72 74 | 20 64 65 6c 61 79 20 2a |/* short| delay *|
|00001fc0| 2f 0a 58 0a 58 09 09 2f | 2a 20 6e 6f 74 65 20 74 |/.X.X../|* note t|
|00001fd0| 68 61 74 20 65 72 72 6f | 72 20 6f 6e 20 66 6f 72 |hat erro|r on for|
|00001fe0| 6b 20 64 6f 65 73 6e 27 | 74 20 73 74 6f 70 20 75 |k doesn'|t stop u|
|00001ff0| 73 20 69 6d 6d 65 64 69 | 61 74 65 6c 79 20 2a 2f |s immedi|ately */|
|00002000| 0a 58 09 09 69 66 20 28 | 28 63 68 69 6c 64 20 3d |.X..if (|(child =|
|00002010| 20 66 6f 72 6b 28 29 29 | 20 21 3d 20 30 29 0a 58 | fork())| != 0).X|
|00002020| 09 09 7b 0a 58 09 09 09 | 2f 2a 20 6f 70 65 6e 20 |..{.X...|/* open |
|00002030| 74 68 65 20 63 6f 6d 6d | 61 6e 64 20 66 6f 72 20 |the comm|and for |
|00002040| 72 65 61 64 69 6e 67 20 | 2a 2f 0a 58 09 09 09 69 |reading |*/.X...i|
|00002050| 66 20 28 28 66 70 20 3d | 20 70 6f 70 65 6e 28 66 |f ((fp =| popen(f|
|00002060| 63 2e 63 6d 64 2c 20 22 | 72 74 22 29 29 20 3d 3d |c.cmd, "|rt")) ==|
|00002070| 20 4e 55 4c 4c 29 0a 58 | 09 09 09 7b 0a 58 09 09 | NULL).X|...{.X..|
|00002080| 09 09 66 70 72 69 6e 74 | 66 28 73 74 64 65 72 72 |..fprint|f(stderr|
|00002090| 2c 20 22 25 73 3a 20 43 | 61 6e 27 74 20 6f 70 65 |, "%s: C|an't ope|
|000020a0| 6e 20 63 6f 6d 6d 61 6e | 64 20 25 73 20 28 25 73 |n comman|d %s (%s|
|000020b0| 29 5c 6e 22 2c 0a 58 09 | 09 09 09 09 09 09 09 09 |)\n",.X.|........|
|000020c0| 70 72 6f 67 6e 61 6d 65 | 2c 20 66 63 2e 63 6d 64 |progname|, fc.cmd|
|000020d0| 2c 20 73 74 72 65 72 72 | 6f 72 28 65 72 72 6e 6f |, strerr|or(errno|
|000020e0| 29 29 3b 0a 58 09 09 09 | 09 65 78 69 74 28 39 29 |));.X...|.exit(9)|
|000020f0| 3b 0a 58 09 09 09 7d 0a | 58 0a 58 09 09 09 2f 2a |;.X...}.|X.X.../*|
|00002100| 20 73 68 6f 76 65 6c 20 | 74 68 65 6d 20 62 69 74 | shovel |them bit|
|00002110| 73 20 2a 2f 0a 58 09 09 | 09 77 68 69 6c 65 20 28 |s */.X..|.while (|
|00002120| 28 6b 20 3d 20 66 72 65 | 61 64 28 62 75 66 2c 20 |(k = fre|ad(buf, |
|00002130| 31 2c 20 42 55 46 53 49 | 5a 2c 20 66 70 29 29 20 |1, BUFSI|Z, fp)) |
|00002140| 21 3d 20 30 29 0a 58 09 | 09 09 09 66 77 72 69 74 |!= 0).X.|...fwrit|
|00002150| 65 28 62 75 66 2c 20 31 | 2c 20 6b 2c 20 70 69 70 |e(buf, 1|, k, pip|
|00002160| 65 5f 66 70 29 3b 0a 58 | 0a 58 09 09 09 2f 2a 20 |e_fp);.X|.X.../* |
|00002170| 63 6c 65 61 6e 75 70 20 | 2a 2f 0a 58 09 09 09 66 |cleanup |*/.X...f|
|00002180| 63 6c 6f 73 65 28 66 70 | 29 3b 0a 58 09 09 09 66 |close(fp|);.X...f|
|00002190| 63 6c 6f 73 65 28 70 69 | 70 65 5f 66 70 29 3b 0a |close(pi|pe_fp);.|
|000021a0| 58 0a 58 09 09 09 2f 2a | 20 6e 6f 77 20 63 68 65 |X.X.../*| now che|
|000021b0| 63 6b 20 66 6f 72 20 66 | 61 69 6c 65 64 20 66 6f |ck for f|ailed fo|
|000021c0| 72 6b 20 2a 2f 0a 58 09 | 09 09 69 66 20 28 63 68 |rk */.X.|..if (ch|
|000021d0| 69 6c 64 20 3d 3d 20 2d | 31 29 0a 58 09 09 09 7b |ild == -|1).X...{|
|000021e0| 0a 58 09 09 09 09 66 70 | 72 69 6e 74 66 28 73 74 |.X....fp|rintf(st|
|000021f0| 64 65 72 72 2c 20 22 25 | 73 3a 20 43 61 6e 27 74 |derr, "%|s: Can't|
|00002200| 20 66 6f 72 6b 20 66 6f | 72 20 6e 65 78 74 20 25 | fork fo|r next %|
|00002210| 73 20 28 25 73 29 5c 6e | 22 2c 0a 58 09 09 09 09 |s (%s)\n|",.X....|
|00002220| 09 09 09 09 09 70 72 6f | 67 6e 61 6d 65 2c 20 66 |.....pro|gname, f|
|00002230| 63 2e 6e 61 6d 65 2c 20 | 73 74 72 65 72 72 6f 72 |c.name, |strerror|
|00002240| 28 65 72 72 6e 6f 29 29 | 3b 0a 58 09 09 09 09 65 |(errno))|;.X....e|
|00002250| 78 69 74 28 31 30 29 3b | 0a 58 09 09 09 7d 0a 58 |xit(10);|.X...}.X|
|00002260| 0a 58 09 09 09 2f 2a 20 | 65 78 69 74 20 69 6e 20 |.X.../* |exit in |
|00002270| 61 6e 79 20 63 61 73 65 | 20 62 75 74 20 77 69 74 |any case| but wit|
|00002280| 68 20 6e 6f 20 65 72 72 | 6f 72 20 2a 2f 0a 58 09 |h no err|or */.X.|
|00002290| 09 09 65 78 69 74 28 30 | 29 3b 0a 58 09 09 7d 0a |..exit(0|);.X..}.|
|000022a0| 58 0a 58 09 09 2f 2a 20 | 63 6c 6f 73 65 20 74 68 |X.X../* |close th|
|000022b0| 65 20 70 69 70 65 20 2a | 2f 0a 58 09 09 66 63 6c |e pipe *|/.X..fcl|
|000022c0| 6f 73 65 28 70 69 70 65 | 5f 66 70 29 3b 0a 58 09 |ose(pipe|_fp);.X.|
|000022d0| 7d 0a 7d 0a 58 0a 2f 2a | 20 73 74 61 72 74 20 74 |}.}.X./*| start t|
|000022e0| 68 65 20 62 75 62 62 6c | 65 20 6d 61 63 68 69 6e |he bubbl|e machin|
|000022f0| 65 20 2a 2f 0a 69 6e 74 | 09 09 6d 61 69 6e 28 69 |e */.int|..main(i|
|00002300| 6e 74 20 61 72 67 63 2c | 20 63 68 61 72 20 2a 2a |nt argc,| char **|
|00002310| 61 72 67 76 29 0a 7b 0a | 58 09 46 49 4c 45 09 2a |argv).{.|X.FILE.*|
|00002320| 66 70 3b 0a 58 09 69 6e | 74 09 09 6b 2c 20 6e 65 |fp;.X.in|t..k, ne|
|00002330| 6e 74 73 3b 0a 58 0a 58 | 09 2f 2a 20 73 65 74 20 |nts;.X.X|./* set |
|00002340| 75 6d 61 73 6b 20 73 6f | 20 74 68 61 74 20 63 6f |umask so| that co|
|00002350| 6e 66 69 67 20 66 69 6c | 65 20 68 61 73 20 66 75 |nfig fil|e has fu|
|00002360| 6c 6c 20 63 6f 6e 74 72 | 6f 6c 20 2a 2f 0a 58 09 |ll contr|ol */.X.|
|00002370| 75 6d 61 73 6b 28 30 29 | 3b 0a 58 0a 58 09 2f 2a |umask(0)|;.X.X./*|
|00002380| 20 67 65 74 20 74 68 65 | 20 70 72 6f 67 72 61 6d | get the| program|
|00002390| 20 6e 61 6d 65 20 66 6f | 72 20 65 72 72 6f 72 20 | name fo|r error |
|000023a0| 6d 65 73 73 61 67 65 73 | 20 2a 2f 0a 58 09 69 66 |messages| */.X.if|
|000023b0| 20 28 28 70 72 6f 67 6e | 61 6d 65 20 3d 20 73 74 | ((progn|ame = st|
|000023c0| 72 72 63 68 72 28 61 72 | 67 76 5b 30 5d 2c 20 27 |rrchr(ar|gv[0], '|
|000023d0| 2f 27 29 29 20 3d 3d 20 | 4e 55 4c 4c 29 0a 58 09 |/')) == |NULL).X.|
|000023e0| 09 70 72 6f 67 6e 61 6d | 65 20 3d 20 61 72 67 76 |.prognam|e = argv|
|000023f0| 5b 30 5d 3b 0a 58 09 65 | 6c 73 65 0a 58 09 09 70 |[0];.X.e|lse.X..p|
|00002400| 72 6f 67 6e 61 6d 65 2b | 2b 3b 0a 58 0a 58 09 2f |rogname+|+;.X.X./|
|00002410| 2a 20 77 65 20 65 78 70 | 65 63 74 20 6f 6e 65 20 |* we exp|ect one |
|00002420| 61 6e 64 20 6f 6e 6c 79 | 20 6f 6e 65 20 61 72 67 |and only| one arg|
|00002430| 75 6d 65 6e 74 20 63 75 | 72 72 65 6e 74 6c 79 20 |ument cu|rrently |
|00002440| 2a 2f 0a 58 09 69 66 20 | 28 61 72 67 63 20 21 3d |*/.X.if |(argc !=|
|00002450| 20 32 29 0a 58 09 7b 0a | 58 09 09 66 70 72 69 6e | 2).X.{.|X..fprin|
|00002460| 74 66 28 73 74 64 65 72 | 72 2c 20 22 55 73 61 67 |tf(stder|r, "Usag|
|00002470| 65 3a 20 25 73 20 63 6f | 6e 66 69 67 5f 66 69 6c |e: %s co|nfig_fil|
|00002480| 65 5c 6e 22 2c 20 70 72 | 6f 67 6e 61 6d 65 29 3b |e\n", pr|ogname);|
|00002490| 0a 58 09 09 65 78 69 74 | 28 31 29 3b 0a 58 09 7d |.X..exit|(1);.X.}|
|000024a0| 0a 58 0a 58 09 2f 2a 20 | 67 69 76 65 20 69 74 20 |.X.X./* |give it |
|000024b0| 69 74 73 20 6f 77 6e 20 | 70 72 6f 63 65 73 73 20 |its own |process |
|000024c0| 67 72 6f 75 70 20 2a 2f | 0a 58 09 73 65 74 70 67 |group */|.X.setpg|
|000024d0| 72 70 28 29 3b 0a 58 0a | 58 09 2f 2a 20 6f 70 65 |rp();.X.|X./* ope|
|000024e0| 6e 20 74 68 65 20 63 6f | 6e 66 69 67 75 72 61 74 |n the co|nfigurat|
|000024f0| 69 6f 6e 20 66 69 6c 65 | 20 2a 2f 0a 58 09 69 66 |ion file| */.X.if|
|00002500| 20 28 28 66 70 20 3d 20 | 66 6f 70 65 6e 28 61 72 | ((fp = |fopen(ar|
|00002510| 67 76 5b 31 5d 2c 20 22 | 72 74 22 29 29 20 3d 3d |gv[1], "|rt")) ==|
|00002520| 20 4e 55 4c 4c 29 0a 58 | 09 7b 0a 58 09 09 66 70 | NULL).X|.{.X..fp|
|00002530| 72 69 6e 74 66 28 73 74 | 64 65 72 72 2c 20 22 25 |rintf(st|derr, "%|
|00002540| 73 3a 20 43 61 6e 27 74 | 20 6f 70 65 6e 20 63 6f |s: Can't| open co|
|00002550| 6e 66 69 67 75 72 61 74 | 69 6f 6e 20 66 69 6c 65 |nfigurat|ion file|
|00002560| 20 28 25 73 29 5c 6e 22 | 2c 0a 58 09 09 09 09 09 | (%s)\n"|,.X.....|
|00002570| 09 70 72 6f 67 6e 61 6d | 65 2c 20 73 74 72 65 72 |.prognam|e, strer|
|00002580| 72 6f 72 28 65 72 72 6e | 6f 29 29 3b 0a 58 09 09 |ror(errn|o));.X..|
|00002590| 65 78 69 74 28 32 29 3b | 0a 58 09 7d 0a 58 0a 58 |exit(2);|.X.}.X.X|
|000025a0| 09 2f 2a 20 61 6e 64 20 | 72 65 61 64 20 69 74 20 |./* and |read it |
|000025b0| 2a 2f 0a 58 09 69 66 20 | 28 21 28 6e 65 6e 74 73 |*/.X.if |(!(nents|
|000025c0| 20 3d 20 72 65 61 64 63 | 66 67 28 66 70 29 29 29 | = readc|fg(fp)))|
|000025d0| 0a 58 09 09 65 78 69 74 | 28 65 72 72 6e 6f 29 3b |.X..exit|(errno);|
|000025e0| 0a 58 0a 58 09 2f 2a 20 | 73 74 61 72 74 20 61 20 |.X.X./* |start a |
|000025f0| 70 72 6f 63 65 73 73 20 | 66 6f 72 20 65 61 63 68 |process |for each|
|00002600| 20 61 63 74 69 76 65 20 | 6c 69 6e 65 20 2a 2f 0a | active |line */.|
|00002610| 58 09 66 6f 72 20 28 6b | 20 3d 20 30 3b 20 6b 20 |X.for (k| = 0; k |
|00002620| 3c 20 6e 65 6e 74 73 3b | 20 6b 2b 2b 29 0a 58 09 |< nents;| k++).X.|
|00002630| 09 66 65 65 64 70 69 70 | 65 28 66 70 5f 63 66 67 |.feedpip|e(fp_cfg|
|00002640| 5b 6b 5d 29 3b 0a 58 0a | 58 09 2f 2a 20 66 72 65 |[k]);.X.|X./* fre|
|00002650| 65 20 74 68 65 20 6d 65 | 6d 6f 72 79 20 69 6e 20 |e the me|mory in |
|00002660| 74 68 65 20 70 61 72 65 | 6e 74 20 70 72 6f 63 65 |the pare|nt proce|
|00002670| 73 73 20 61 6e 64 20 65 | 78 69 74 20 2a 2f 0a 58 |ss and e|xit */.X|
|00002680| 09 66 72 65 65 28 66 70 | 5f 63 66 67 29 3b 0a 58 |.free(fp|_cfg);.X|
|00002690| 09 72 65 74 75 72 6e 28 | 30 29 3b 0a 7d 0a 53 48 |.return(|0);.}.SH|
|000026a0| 41 52 5f 45 4f 46 0a 63 | 68 6d 6f 64 20 30 36 34 |AR_EOF.c|hmod 064|
|000026b0| 30 20 66 65 65 64 70 69 | 70 65 2e 63 20 7c 7c 0a |0 feedpi|pe.c ||.|
|000026c0| 65 63 68 6f 20 27 72 65 | 73 74 6f 72 65 20 6f 66 |echo 're|store of|
|000026d0| 20 66 65 65 64 70 69 70 | 65 2e 63 20 66 61 69 6c | feedpip|e.c fail|
|000026e0| 65 64 27 0a 57 63 5f 63 | 3d 22 60 77 63 20 2d 63 |ed'.Wc_c|="`wc -c|
|000026f0| 20 3c 20 27 66 65 65 64 | 70 69 70 65 2e 63 27 60 | < 'feed|pipe.c'`|
|00002700| 22 0a 74 65 73 74 20 34 | 33 30 36 20 2d 65 71 20 |".test 4|306 -eq |
|00002710| 22 24 57 63 5f 63 22 20 | 7c 7c 0a 09 65 63 68 6f |"$Wc_c" |||..echo|
|00002720| 20 27 66 65 65 64 70 69 | 70 65 2e 63 3a 20 6f 72 | 'feedpi|pe.c: or|
|00002730| 69 67 69 6e 61 6c 20 73 | 69 7a 65 20 34 33 30 36 |iginal s|ize 4306|
|00002740| 2c 20 63 75 72 72 65 6e | 74 20 73 69 7a 65 27 20 |, curren|t size' |
|00002750| 22 24 57 63 5f 63 22 0a | 23 20 3d 3d 3d 3d 3d 3d |"$Wc_c".|# ======|
|00002760| 3d 3d 3d 3d 3d 3d 3d 20 | 72 65 61 64 63 66 67 2e |======= |readcfg.|
|00002770| 63 20 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |c ======|========|
|00002780| 0a 73 65 64 20 27 73 2f | 5e 58 2f 2f 27 20 3c 3c |.sed 's/|^X//' <<|
|00002790| 20 27 53 48 41 52 5f 45 | 4f 46 27 20 3e 20 27 72 | 'SHAR_E|OF' > 'r|
|000027a0| 65 61 64 63 66 67 2e 63 | 27 20 26 26 0a 2f 2a 0a |eadcfg.c|' &&./*.|
|000027b0| 72 65 61 64 63 66 67 2e | 63 0a 57 72 69 74 74 65 |readcfg.|c.Writte|
|000027c0| 6e 20 62 79 20 44 27 41 | 72 63 79 20 4a 2e 4d 2e |n by D'A|rcy J.M.|
|000027d0| 20 43 61 69 6e 0a 58 0a | 52 65 61 64 73 20 63 6f | Cain.X.|Reads co|
|000027e0| 6e 66 69 67 75 72 61 74 | 69 6f 6e 20 66 69 6c 65 |nfigurat|ion file|
|000027f0| 20 66 6f 72 20 66 65 65 | 64 70 69 70 65 0a 66 69 | for fee|dpipe.fi|
|00002800| 6c 6c 73 20 69 6e 20 74 | 68 65 20 66 70 5f 63 66 |lls in t|he fp_cf|
|00002810| 67 20 61 72 72 61 79 20 | 61 6e 64 20 72 65 74 75 |g array |and retu|
|00002820| 72 6e 73 20 74 68 65 20 | 6e 75 6d 62 65 72 20 6f |rns the |number o|
|00002830| 66 20 61 63 74 69 76 65 | 20 6c 69 6e 65 73 0a 2a |f active| lines.*|
|00002840| 2f 0a 58 0a 23 69 6e 63 | 6c 75 64 65 09 3c 73 74 |/.X.#inc|lude.<st|
|00002850| 64 69 6f 2e 68 3e 0a 23 | 69 6e 63 6c 75 64 65 09 |dio.h>.#|include.|
|00002860| 3c 73 74 64 6c 69 62 2e | 68 3e 0a 23 69 6e 63 6c |<stdlib.|h>.#incl|
|00002870| 75 64 65 09 3c 73 74 72 | 69 6e 67 2e 68 3e 0a 23 |ude.<str|ing.h>.#|
|00002880| 69 6e 63 6c 75 64 65 09 | 3c 63 74 79 70 65 2e 68 |include.|<ctype.h|
|00002890| 3e 0a 23 69 6e 63 6c 75 | 64 65 09 3c 6d 61 6c 6c |>.#inclu|de.<mall|
|000028a0| 6f 63 2e 68 3e 0a 23 69 | 6e 63 6c 75 64 65 09 22 |oc.h>.#i|nclude."|
|000028b0| 66 65 65 64 70 69 70 65 | 2e 68 22 0a 58 0a 69 6e |feedpipe|.h".X.in|
|000028c0| 74 09 09 72 65 61 64 63 | 66 67 28 46 49 4c 45 20 |t..readc|fg(FILE |
|000028d0| 2a 66 70 29 0a 7b 0a 58 | 09 63 68 61 72 09 2a 73 |*fp).{.X|.char.*s|
|000028e0| 74 72 3b 0a 58 09 69 6e | 74 09 09 6e 65 6e 74 73 |tr;.X.in|t..nents|
|000028f0| 20 3d 20 30 2c 20 6b 3b | 0a 58 0a 58 09 69 66 20 | = 0, k;|.X.X.if |
|00002900| 28 28 66 70 5f 63 66 67 | 20 3d 20 6d 61 6c 6c 6f |((fp_cfg| = mallo|
|00002910| 63 28 31 29 29 20 3d 3d | 20 4e 55 4c 4c 29 0a 58 |c(1)) ==| NULL).X|
|00002920| 09 09 72 65 74 75 72 6e | 28 30 29 3b 0a 58 0a 58 |..return|(0);.X.X|
|00002930| 09 77 68 69 6c 65 20 28 | 28 73 74 72 20 3d 20 78 |.while (|(str = x|
|00002940| 67 65 74 6c 69 6e 65 28 | 66 70 2c 20 31 29 29 20 |getline(|fp, 1)) |
|00002950| 21 3d 20 4e 55 4c 4c 29 | 0a 58 09 7b 0a 58 09 09 |!= NULL)|.X.{.X..|
|00002960| 69 66 20 28 28 66 70 5f | 63 66 67 20 3d 20 72 65 |if ((fp_|cfg = re|
|00002970| 61 6c 6c 6f 63 28 66 70 | 5f 63 66 67 2c 20 73 69 |alloc(fp|_cfg, si|
|00002980| 7a 65 6f 66 28 46 50 5f | 43 46 47 29 20 2a 20 28 |zeof(FP_|CFG) * (|
|00002990| 6e 65 6e 74 73 2b 31 29 | 29 29 20 3d 3d 20 4e 55 |nents+1)|)) == NU|
|000029a0| 4c 4c 29 0a 58 09 09 7b | 0a 58 09 09 09 66 72 65 |LL).X..{|.X...fre|
|000029b0| 65 28 73 74 72 29 3b 0a | 58 09 09 09 72 65 74 75 |e(str);.|X...retu|
|000029c0| 72 6e 28 30 29 3b 0a 58 | 09 09 7d 0a 58 0a 58 09 |rn(0);.X|..}.X.X.|
|000029d0| 09 69 66 20 28 28 66 70 | 5f 63 66 67 5b 6e 65 6e |.if ((fp|_cfg[nen|
|000029e0| 74 73 5d 2e 6e 61 6d 65 | 20 3d 20 73 74 72 74 6f |ts].name| = strto|
|000029f0| 6b 28 73 74 72 2c 20 22 | 20 5c 74 22 29 29 20 3d |k(str, "| \t")) =|
|00002a00| 3d 20 4e 55 4c 4c 20 7c | 7c 0a 58 09 09 09 28 66 |= NULL |||.X...(f|
|00002a10| 70 5f 63 66 67 5b 6e 65 | 6e 74 73 5d 2e 6f 77 6e |p_cfg[ne|nts].own|
|00002a20| 65 72 20 3d 20 73 74 72 | 74 6f 6b 28 4e 55 4c 4c |er = str|tok(NULL|
|00002a30| 2c 20 22 20 5c 74 22 29 | 29 20 3d 3d 20 4e 55 4c |, " \t")|) == NUL|
|00002a40| 4c 20 7c 7c 0a 58 09 09 | 09 28 66 70 5f 63 66 67 |L ||.X..|.(fp_cfg|
|00002a50| 5b 6e 65 6e 74 73 5d 2e | 67 72 6f 75 70 20 3d 20 |[nents].|group = |
|00002a60| 73 74 72 74 6f 6b 28 4e | 55 4c 4c 2c 20 22 20 5c |strtok(N|ULL, " \|
|00002a70| 74 22 29 29 20 3d 3d 20 | 4e 55 4c 4c 20 29 0a 58 |t")) == |NULL ).X|
|00002a80| 09 09 7b 0a 58 09 09 09 | 66 72 65 65 28 66 70 5f |..{.X...|free(fp_|
|00002a90| 63 66 67 29 3b 0a 58 09 | 09 09 66 70 72 69 6e 74 |cfg);.X.|..fprint|
|00002aa0| 66 28 73 74 64 65 72 72 | 2c 20 22 25 73 3a 20 49 |f(stderr|, "%s: I|
|00002ab0| 6e 76 61 6c 69 64 20 63 | 6f 6e 66 69 67 75 72 61 |nvalid c|onfigura|
|00002ac0| 74 69 6f 6e 20 66 6f 72 | 20 5c 22 25 73 5c 22 5c |tion for| \"%s\"\|
|00002ad0| 6e 22 2c 0a 58 09 09 09 | 09 09 09 09 70 72 6f 67 |n",.X...|....prog|
|00002ae0| 6e 61 6d 65 2c 20 73 74 | 72 29 3b 0a 58 09 09 09 |name, st|r);.X...|
|00002af0| 72 65 74 75 72 6e 28 30 | 29 3b 0a 58 09 09 7d 0a |return(0|);.X..}.|
|00002b00| 58 0a 58 09 09 69 66 20 | 28 21 73 74 72 63 6d 70 |X.X..if |(!strcmp|
|00002b10| 28 66 70 5f 63 66 67 5b | 6e 65 6e 74 73 5d 2e 6f |(fp_cfg[|nents].o|
|00002b20| 77 6e 65 72 2c 20 22 2d | 22 29 29 0a 58 09 09 09 |wner, "-|")).X...|
|00002b30| 66 70 5f 63 66 67 5b 6e | 65 6e 74 73 5d 2e 6f 77 |fp_cfg[n|ents].ow|
|00002b40| 6e 65 72 20 3d 20 4e 55 | 4c 4c 3b 0a 58 0a 58 09 |ner = NU|LL;.X.X.|
|00002b50| 09 69 66 20 28 21 73 74 | 72 63 6d 70 28 66 70 5f |.if (!st|rcmp(fp_|
|00002b60| 63 66 67 5b 6e 65 6e 74 | 73 5d 2e 67 72 6f 75 70 |cfg[nent|s].group|
|00002b70| 2c 20 22 2d 22 29 29 0a | 58 09 09 09 66 70 5f 63 |, "-")).|X...fp_c|
|00002b80| 66 67 5b 6e 65 6e 74 73 | 5d 2e 67 72 6f 75 70 20 |fg[nents|].group |
|00002b90| 3d 20 4e 55 4c 4c 3b 0a | 58 0a 58 09 09 66 70 5f |= NULL;.|X.X..fp_|
|00002ba0| 63 66 67 5b 6e 65 6e 74 | 73 5d 2e 63 6d 64 20 3d |cfg[nent|s].cmd =|
|00002bb0| 20 66 70 5f 63 66 67 5b | 6e 65 6e 74 73 5d 2e 67 | fp_cfg[|nents].g|
|00002bc0| 72 6f 75 70 3b 0a 58 0a | 58 09 09 77 68 69 6c 65 |roup;.X.|X..while|
|00002bd0| 20 28 2a 66 70 5f 63 66 | 67 5b 6e 65 6e 74 73 5d | (*fp_cf|g[nents]|
|00002be0| 2e 63 6d 64 2b 2b 29 0a | 58 09 09 09 3b 0a 58 0a |.cmd++).|X...;.X.|
|00002bf0| 58 09 09 66 70 5f 63 66 | 67 5b 6e 65 6e 74 73 5d |X..fp_cf|g[nents]|
|00002c00| 2e 6d 6f 64 65 20 3d 20 | 73 74 72 74 6f 6c 28 66 |.mode = |strtol(f|
|00002c10| 70 5f 63 66 67 5b 6e 65 | 6e 74 73 5d 2e 63 6d 64 |p_cfg[ne|nts].cmd|
|00002c20| 2c 20 26 66 70 5f 63 66 | 67 5b 6e 65 6e 74 73 5d |, &fp_cf|g[nents]|
|00002c30| 2e 63 6d 64 2c 20 30 29 | 3b 0a 58 0a 58 09 09 77 |.cmd, 0)|;.X.X..w|
|00002c40| 68 69 6c 65 20 28 69 73 | 73 70 61 63 65 28 2a 66 |hile (is|space(*f|
|00002c50| 70 5f 63 66 67 5b 6e 65 | 6e 74 73 5d 2e 63 6d 64 |p_cfg[ne|nts].cmd|
|00002c60| 29 29 0a 58 09 09 09 2a | 66 70 5f 63 66 67 5b 6e |)).X...*|fp_cfg[n|
|00002c70| 65 6e 74 73 5d 2e 63 6d | 64 2b 2b 20 3d 20 30 3b |ents].cm|d++ = 0;|
|00002c80| 0a 58 0a 58 09 09 69 66 | 20 28 21 2a 66 70 5f 63 |.X.X..if| (!*fp_c|
|00002c90| 66 67 5b 6e 65 6e 74 73 | 5d 2e 63 6d 64 29 0a 58 |fg[nents|].cmd).X|
|00002ca0| 09 09 7b 0a 58 09 09 09 | 66 72 65 65 28 66 70 5f |..{.X...|free(fp_|
|00002cb0| 63 66 67 29 3b 0a 58 09 | 09 09 66 70 72 69 6e 74 |cfg);.X.|..fprint|
|00002cc0| 66 28 73 74 64 65 72 72 | 2c 20 22 25 73 3a 20 49 |f(stderr|, "%s: I|
|00002cd0| 6e 76 61 6c 69 64 20 63 | 6f 6e 66 69 67 75 72 61 |nvalid c|onfigura|
|00002ce0| 74 69 6f 6e 20 66 6f 72 | 20 5c 22 25 73 5c 22 5c |tion for| \"%s\"\|
|00002cf0| 6e 22 2c 0a 58 09 09 09 | 09 09 09 09 70 72 6f 67 |n",.X...|....prog|
|00002d00| 6e 61 6d 65 2c 20 73 74 | 72 29 3b 0a 58 09 09 09 |name, st|r);.X...|
|00002d10| 72 65 74 75 72 6e 28 30 | 29 3b 0a 58 09 09 7d 0a |return(0|);.X..}.|
|00002d20| 58 0a 58 09 09 66 6f 72 | 20 28 6b 20 3d 20 30 3b |X.X..for| (k = 0;|
|00002d30| 20 6b 20 3c 20 6e 65 6e | 74 73 3b 20 6b 2b 2b 29 | k < nen|ts; k++)|
|00002d40| 0a 58 09 09 7b 0a 58 09 | 09 09 69 66 20 28 21 73 |.X..{.X.|..if (!s|
|00002d50| 74 72 63 6d 70 28 66 70 | 5f 63 66 67 5b 6b 5d 2e |trcmp(fp|_cfg[k].|
|00002d60| 6e 61 6d 65 2c 20 66 70 | 5f 63 66 67 5b 6e 65 6e |name, fp|_cfg[nen|
|00002d70| 74 73 5d 2e 6e 61 6d 65 | 29 29 0a 58 09 09 09 7b |ts].name|)).X...{|
|00002d80| 0a 58 09 09 09 09 66 72 | 65 65 28 66 70 5f 63 66 |.X....fr|ee(fp_cf|
|00002d90| 67 29 3b 0a 58 09 09 09 | 09 66 70 72 69 6e 74 66 |g);.X...|.fprintf|
|00002da0| 28 73 74 64 65 72 72 2c | 20 22 25 73 3a 20 44 75 |(stderr,| "%s: Du|
|00002db0| 70 6c 69 63 61 74 65 20 | 70 69 70 65 20 5c 22 25 |plicate |pipe \"%|
|00002dc0| 73 5c 22 5c 6e 22 2c 20 | 70 72 6f 67 6e 61 6d 65 |s\"\n", |progname|
|00002dd0| 2c 20 73 74 72 29 3b 0a | 58 09 09 09 09 72 65 74 |, str);.|X....ret|
|00002de0| 75 72 6e 28 30 29 3b 0a | 58 09 09 09 7d 0a 58 09 |urn(0);.|X...}.X.|
|00002df0| 09 7d 0a 58 0a 58 09 09 | 6e 65 6e 74 73 2b 2b 3b |.}.X.X..|nents++;|
|00002e00| 0a 58 09 7d 0a 58 0a 58 | 09 69 66 20 28 21 6e 65 |.X.}.X.X|.if (!ne|
|00002e10| 6e 74 73 29 0a 58 09 09 | 66 72 65 65 28 66 70 5f |nts).X..|free(fp_|
|00002e20| 63 66 67 29 3b 0a 58 0a | 58 09 72 65 74 75 72 6e |cfg);.X.|X.return|
|00002e30| 28 6e 65 6e 74 73 29 3b | 0a 7d 0a 53 48 41 52 5f |(nents);|.}.SHAR_|
|00002e40| 45 4f 46 0a 63 68 6d 6f | 64 20 30 36 34 30 20 72 |EOF.chmo|d 0640 r|
|00002e50| 65 61 64 63 66 67 2e 63 | 20 7c 7c 0a 65 63 68 6f |eadcfg.c| ||.echo|
|00002e60| 20 27 72 65 73 74 6f 72 | 65 20 6f 66 20 72 65 61 | 'restor|e of rea|
|00002e70| 64 63 66 67 2e 63 20 66 | 61 69 6c 65 64 27 0a 57 |dcfg.c f|ailed'.W|
|00002e80| 63 5f 63 3d 22 60 77 63 | 20 2d 63 20 3c 20 27 72 |c_c="`wc| -c < 'r|
|00002e90| 65 61 64 63 66 67 2e 63 | 27 60 22 0a 74 65 73 74 |eadcfg.c|'`".test|
|00002ea0| 20 31 36 31 30 20 2d 65 | 71 20 22 24 57 63 5f 63 | 1610 -e|q "$Wc_c|
|00002eb0| 22 20 7c 7c 0a 09 65 63 | 68 6f 20 27 72 65 61 64 |" ||..ec|ho 'read|
|00002ec0| 63 66 67 2e 63 3a 20 6f | 72 69 67 69 6e 61 6c 20 |cfg.c: o|riginal |
|00002ed0| 73 69 7a 65 20 31 36 31 | 30 2c 20 63 75 72 72 65 |size 161|0, curre|
|00002ee0| 6e 74 20 73 69 7a 65 27 | 20 22 24 57 63 5f 63 22 |nt size'| "$Wc_c"|
|00002ef0| 0a 23 20 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |.# =====|========|
|00002f00| 20 67 65 74 6c 69 6e 65 | 2e 63 20 3d 3d 3d 3d 3d | getline|.c =====|
|00002f10| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 0a 73 65 64 20 27 73 |========|=.sed 's|
|00002f20| 2f 5e 58 2f 2f 27 20 3c | 3c 20 27 53 48 41 52 5f |/^X//' <|< 'SHAR_|
|00002f30| 45 4f 46 27 20 3e 20 27 | 67 65 74 6c 69 6e 65 2e |EOF' > '|getline.|
|00002f40| 63 27 20 26 26 0a 2f 2a | 0a 4e 41 4d 45 0a 58 09 |c' &&./*|.NAME.X.|
|00002f50| 67 65 74 6c 69 6e 65 2c | 20 78 67 65 74 6c 69 6e |getline,| xgetlin|
|00002f60| 65 2c 20 77 67 65 74 6c | 69 6e 65 0a 58 0a 53 59 |e, wgetl|ine.X.SY|
|00002f70| 4e 4f 50 53 49 53 0a 58 | 09 63 68 61 72 20 2a 67 |NOPSIS.X|.char *g|
|00002f80| 65 74 6c 69 6e 65 28 46 | 49 4c 45 20 2a 66 70 2c |etline(F|ILE *fp,|
|00002f90| 20 69 6e 74 20 65 78 63 | 6c 75 73 69 76 65 29 3b | int exc|lusive);|
|00002fa0| 0a 58 09 63 68 61 72 20 | 2a 78 67 65 74 6c 69 6e |.X.char |*xgetlin|
|00002fb0| 65 28 46 49 4c 45 20 2a | 66 70 2c 20 69 6e 74 20 |e(FILE *|fp, int |
|00002fc0| 65 78 63 6c 75 73 69 76 | 65 29 3b 0a 58 09 63 68 |exclusiv|e);.X.ch|
|00002fd0| 61 72 20 2a 77 67 65 74 | 6c 69 6e 65 28 57 49 4e |ar *wget|line(WIN|
|00002fe0| 44 4f 57 20 77 69 6e 2c | 20 69 6e 74 20 65 78 63 |DOW win,| int exc|
|00002ff0| 6c 75 73 69 76 65 29 3b | 0a 58 0a 44 45 53 43 52 |lusive);|.X.DESCR|
|00003000| 49 50 54 49 4f 4e 0a 58 | 09 52 65 61 64 73 20 61 |IPTION.X|.Reads a|
|00003010| 20 6c 69 6e 65 20 66 72 | 6f 6d 20 74 68 65 20 73 | line fr|om the s|
|00003020| 74 72 65 61 6d 20 67 69 | 76 65 6e 20 62 79 20 66 |tream gi|ven by f|
|00003030| 70 20 28 6f 72 20 66 72 | 6f 6d 20 74 68 65 20 77 |p (or fr|om the w|
|00003040| 69 6e 64 6f 77 20 67 69 | 76 65 6e 20 62 79 0a 58 |indow gi|ven by.X|
|00003050| 09 77 69 6e 20 69 6e 20 | 77 67 65 74 6c 69 6e 65 |.win in |wgetline|
|00003060| 29 20 61 6e 64 20 72 65 | 74 75 72 6e 73 20 61 20 |) and re|turns a |
|00003070| 70 6f 69 6e 74 65 72 20 | 74 6f 20 74 68 65 20 73 |pointer |to the s|
|00003080| 74 72 69 6e 67 2e 20 20 | 54 68 65 72 65 20 69 73 |tring. |There is|
|00003090| 20 6e 6f 0a 58 09 6c 65 | 6e 67 74 68 20 72 65 73 | no.X.le|ngth res|
|000030a0| 74 72 69 63 74 69 6f 6e | 20 6f 6e 20 74 68 65 20 |triction| on the |
|000030b0| 72 65 74 75 72 6e 65 64 | 20 73 74 72 69 6e 67 2e |returned| string.|
|000030c0| 20 20 53 70 61 63 65 20 | 69 73 20 64 79 6e 61 6d | Space |is dynam|
|000030d0| 69 63 61 6c 6c 79 0a 58 | 09 61 6c 6c 6f 63 61 74 |ically.X|.allocat|
|000030e0| 65 64 20 66 6f 72 20 74 | 68 65 20 73 74 72 69 6e |ed for t|he strin|
|000030f0| 67 20 61 73 20 6e 65 65 | 64 65 64 2e 20 20 49 66 |g as nee|ded. If|
|00003100| 20 74 68 65 20 65 78 63 | 6c 75 73 69 76 65 20 66 | the exc|lusive f|
|00003110| 6c 61 67 20 69 73 20 73 | 65 74 20 74 68 65 6e 0a |lag is s|et then.|
|00003120| 58 09 74 68 65 20 73 70 | 61 63 65 20 77 6f 6e 27 |X.the sp|ace won'|
|00003130| 74 20 62 65 20 72 65 75 | 73 65 64 20 6f 6e 20 74 |t be reu|sed on t|
|00003140| 68 65 20 6e 65 78 74 20 | 63 61 6c 6c 2e 0a 58 0a |he next |call..X.|
|00003150| 58 09 49 6e 20 74 68 65 | 20 78 67 65 74 6c 69 6e |X.In the| xgetlin|
|00003160| 65 20 76 65 72 73 69 6f | 6e 20 61 6e 79 74 68 69 |e versio|n anythi|
|00003170| 6e 67 20 66 72 6f 6d 20 | 27 23 27 20 74 69 6c 6c |ng from |'#' till|
|00003180| 20 74 68 65 20 65 6e 64 | 20 6f 66 20 6c 69 6e 65 | the end| of line|
|00003190| 20 69 73 0a 58 09 69 67 | 6e 6f 72 65 64 20 61 6e | is.X.ig|nored an|
|000031a0| 64 20 41 20 20 74 72 61 | 69 6c 69 6e 67 20 27 5c |d A tra|iling '\|
|000031b0| 27 20 63 68 61 72 61 63 | 74 65 72 20 69 73 20 74 |' charac|ter is t|
|000031c0| 72 65 61 74 65 64 20 61 | 73 20 61 20 63 6f 6e 74 |reated a|s a cont|
|000031d0| 69 6e 75 61 74 69 6f 6e | 0a 58 09 63 68 61 72 61 |inuation|.X.chara|
|000031e0| 63 74 65 72 2e 20 20 41 | 66 74 65 72 20 74 68 69 |cter. A|fter thi|
|000031f0| 73 20 70 72 6f 63 65 73 | 73 69 6e 67 20 74 68 65 |s proces|sing the|
|00003200| 20 72 65 73 75 6c 74 69 | 6e 67 20 6c 69 6e 65 20 | resulti|ng line |
|00003210| 69 73 20 69 67 6e 6f 72 | 65 64 20 69 66 0a 58 09 |is ignor|ed if.X.|
|00003220| 69 74 20 69 73 20 65 6d | 70 74 79 2e 20 20 54 68 |it is em|pty. Th|
|00003230| 65 20 27 23 27 20 61 6e | 64 20 27 5c 27 20 63 68 |e '#' an|d '\' ch|
|00003240| 61 72 61 63 74 65 72 73 | 20 63 61 6e 20 62 65 20 |aracters| can be |
|00003250| 69 6e 63 6c 75 64 65 64 | 20 62 79 20 70 72 65 63 |included| by prec|
|00003260| 65 64 69 6e 67 0a 58 09 | 74 68 65 6d 20 77 69 74 |eding.X.|them wit|
|00003270| 68 20 61 20 27 5c 27 2e | 20 20 4e 6f 74 65 20 74 |h a '\'.| Note t|
|00003280| 68 61 74 20 74 68 65 20 | 6c 65 61 64 69 6e 67 20 |hat the |leading |
|00003290| 62 61 63 6b 73 6c 61 73 | 68 20 69 73 20 6c 65 66 |backslas|h is lef|
|000032a0| 74 20 69 6e 20 74 68 65 | 20 69 6e 70 75 74 0a 58 |t in the| input.X|
|000032b0| 09 73 74 72 69 6e 67 20 | 61 6e 64 20 6d 75 73 74 |.string |and must|
|000032c0| 20 62 65 20 64 65 61 6c | 74 20 77 69 74 68 20 62 | be deal|t with b|
|000032d0| 79 20 74 68 65 20 63 61 | 6c 6c 65 72 2e 20 20 54 |y the ca|ller. T|
|000032e0| 68 69 73 20 63 61 6e 20 | 62 65 20 73 6f 6d 65 77 |his can |be somew|
|000032f0| 68 61 74 20 6f 66 20 61 | 0a 58 09 70 72 6f 62 6c |hat of a|.X.probl|
|00003300| 65 6d 20 61 74 20 74 68 | 65 20 65 6e 64 20 6f 66 |em at th|e end of|
|00003310| 20 61 20 6c 69 6e 65 20 | 62 75 74 20 69 6e 20 67 | a line |but in g|
|00003320| 65 6e 65 72 61 6c 20 73 | 68 6f 75 6c 64 20 62 65 |eneral s|hould be|
|00003330| 20 77 6f 72 6b 61 62 6c | 65 2e 0a 58 0a 58 09 57 | workabl|e..X.X.W|
|00003340| 68 65 6e 20 74 68 65 20 | 65 78 63 6c 75 73 69 76 |hen the |exclusiv|
|00003350| 65 20 66 6c 61 67 20 69 | 73 20 73 65 74 20 74 68 |e flag i|s set th|
|00003360| 65 20 73 70 61 63 65 20 | 69 73 20 6d 61 64 65 20 |e space |is made |
|00003370| 61 76 61 69 6c 61 62 6c | 65 20 74 6f 20 74 68 65 |availabl|e to the|
|00003380| 0a 58 09 63 61 6c 6c 65 | 72 20 6f 6e 20 74 68 65 |.X.calle|r on the|
|00003390| 20 73 61 6d 65 20 62 61 | 73 69 73 20 61 73 20 6d | same ba|sis as m|
|000033a0| 61 6c 6c 6f 63 28 33 29 | 2e 20 20 57 68 65 6e 20 |alloc(3)|. When |
|000033b0| 66 69 6e 69 73 68 65 64 | 20 77 69 74 68 20 74 68 |finished| with th|
|000033c0| 65 0a 58 09 73 74 72 69 | 6e 67 20 69 74 20 73 68 |e.X.stri|ng it sh|
|000033d0| 6f 75 6c 64 20 62 65 20 | 66 72 65 65 27 65 64 2e |ould be |free'ed.|
|000033e0| 0a 58 0a 52 45 54 55 52 | 4e 53 0a 58 09 41 20 70 |.X.RETUR|NS.X.A p|
|000033f0| 6f 69 6e 74 65 72 20 74 | 6f 20 74 68 65 20 73 74 |ointer t|o the st|
|00003400| 72 69 6e 67 20 77 69 74 | 68 6f 75 74 20 74 68 65 |ring wit|hout the|
|00003410| 20 74 65 72 6d 69 6e 61 | 74 69 6e 67 20 6e 65 77 | termina|ting new|
|00003420| 6c 69 6e 65 20 69 73 20 | 72 65 74 75 72 6e 65 64 |line is |returned|
|00003430| 0a 58 09 69 66 20 73 75 | 63 63 65 73 73 66 75 6c |.X.if su|ccessful|
|00003440| 20 6f 72 20 4e 55 4c 4c | 20 69 66 20 74 68 65 72 | or NULL| if ther|
|00003450| 65 20 77 61 73 20 61 6e | 20 65 72 72 6f 72 20 6f |e was an| error o|
|00003460| 72 20 65 6e 64 20 6f 66 | 20 66 69 6c 65 2e 20 20 |r end of| file. |
|00003470| 55 73 65 0a 58 09 66 65 | 6f 66 28 33 29 20 61 6e |Use.X.fe|of(3) an|
|00003480| 64 20 66 65 72 72 6f 72 | 28 33 29 20 74 6f 20 66 |d ferror|(3) to f|
|00003490| 69 6e 64 20 6f 75 74 20 | 69 66 20 69 74 20 77 61 |ind out |if it wa|
|000034a0| 73 20 61 20 66 69 6c 65 | 20 65 72 72 6f 72 2c 20 |s a file| error, |
|000034b0| 6d 65 6d 6f 72 79 0a 58 | 09 61 6c 6c 6f 63 61 74 |memory.X|.allocat|
|000034c0| 69 6f 6e 20 70 72 6f 62 | 6c 65 6d 20 6f 72 20 45 |ion prob|lem or E|
|000034d0| 4f 46 20 63 6f 6e 64 69 | 74 69 6f 6e 2e 0a 58 0a |OF condi|tion..X.|
|000034e0| 41 55 54 48 4f 52 0a 58 | 09 44 27 41 72 63 79 20 |AUTHOR.X|.D'Arcy |
|000034f0| 4a 2e 4d 2e 20 43 61 69 | 6e 20 28 64 61 72 63 79 |J.M. Cai|n (darcy|
|00003500| 40 64 72 75 69 64 2e 55 | 55 43 50 29 0a 58 09 44 |@druid.U|UCP).X.D|
|00003510| 27 41 72 63 79 20 43 61 | 69 6e 20 43 6f 6e 73 75 |'Arcy Ca|in Consu|
|00003520| 6c 74 69 6e 67 0a 58 0a | 43 41 56 45 41 54 53 0a |lting.X.|CAVEATS.|
|00003530| 58 09 54 68 69 73 20 66 | 75 6e 63 74 69 6f 6e 20 |X.This f|unction |
|00003540| 69 73 20 69 6e 20 74 68 | 65 20 70 75 62 6c 69 63 |is in th|e public|
|00003550| 20 64 6f 6d 61 69 6e 2e | 0a 2a 2f 0a 58 0a 23 69 | domain.|.*/.X.#i|
|00003560| 6e 63 6c 75 64 65 09 3c | 73 74 64 69 6f 2e 68 3e |nclude.<|stdio.h>|
|00003570| 0a 23 69 6e 63 6c 75 64 | 65 09 3c 65 72 72 6e 6f |.#includ|e.<errno|
|00003580| 2e 68 3e 0a 23 69 6e 63 | 6c 75 64 65 09 3c 6d 61 |.h>.#inc|lude.<ma|
|00003590| 6c 6c 6f 63 2e 68 3e 0a | 58 0a 2f 2a 20 61 73 63 |lloc.h>.|X./* asc|
|000035a0| 69 69 2e 68 20 64 65 66 | 69 6e 65 73 20 74 68 65 |ii.h def|ines the|
|000035b0| 20 43 54 52 4c 20 6d 61 | 63 72 6f 20 2a 2f 0a 23 | CTRL ma|cro */.#|
|000035c0| 69 6e 63 6c 75 64 65 09 | 3c 61 73 63 69 69 2e 68 |include.|<ascii.h|
|000035d0| 3e 0a 58 0a 2f 2a 20 49 | 20 6f 72 69 67 69 6e 61 |>.X./* I| origina|
|000035e0| 6c 6c 79 20 77 61 73 20 | 67 6f 69 6e 67 20 74 6f |lly was |going to|
|000035f0| 20 75 73 65 20 38 30 20 | 68 65 72 65 20 61 73 20 | use 80 |here as |
|00003600| 74 68 65 20 6d 6f 73 74 | 20 63 6f 6d 6d 6f 6e 20 |the most| common |
|00003610| 63 61 73 65 20 62 75 74 | 20 2a 2f 0a 2f 2a 20 64 |case but| */./* d|
|00003620| 65 63 69 64 65 64 20 74 | 68 61 74 20 61 20 66 65 |ecided t|hat a fe|
|00003630| 77 20 65 78 74 72 61 20 | 62 79 74 65 73 20 74 6f |w extra |bytes to|
|00003640| 20 73 61 76 65 20 61 20 | 6d 61 6c 6c 6f 63 20 66 | save a |malloc f|
|00003650| 72 6f 6d 20 74 69 6d 65 | 20 74 6f 20 74 69 6d 65 |rom time| to time|
|00003660| 20 2a 2f 0a 2f 2a 20 77 | 6f 75 6c 64 20 62 65 20 | */./* w|ould be |
|00003670| 61 20 62 65 74 74 65 72 | 20 63 68 6f 69 63 65 2e |a better| choice.|
|00003680| 20 20 43 6f 6d 6d 65 6e | 74 73 20 77 65 6c 63 6f | Commen|ts welco|
|00003690| 6d 65 2e 20 20 2a 2f 0a | 23 64 65 66 69 6e 65 09 |me. */.|#define.|
|000036a0| 09 43 48 55 4e 4b 09 31 | 32 38 0a 58 0a 23 69 66 |.CHUNK.1|28.X.#if|
|000036b0| 64 65 66 09 58 43 41 54 | 0a 23 64 65 66 69 6e 65 |def.XCAT|.#define|
|000036c0| 09 58 47 45 54 4c 49 4e | 45 5f 56 45 52 53 49 4f |.XGETLIN|E_VERSIO|
|000036d0| 4e 0a 23 65 6e 64 69 66 | 0a 58 0a 23 69 66 64 65 |N.#endif|.X.#ifde|
|000036e0| 66 09 43 55 52 53 45 53 | 5f 56 45 52 53 49 4f 4e |f.CURSES|_VERSION|
|000036f0| 0a 23 69 6e 63 6c 75 64 | 65 09 3c 63 75 72 73 65 |.#includ|e.<curse|
|00003700| 73 2e 68 3e 0a 23 69 66 | 64 65 66 09 4b 41 4e 44 |s.h>.#if|def.KAND|
|00003710| 52 0a 63 68 61 72 09 2a | 77 67 65 74 6c 69 6e 65 |R.char.*|wgetline|
|00003720| 28 77 69 6e 2c 20 65 78 | 63 6c 75 73 69 76 65 29 |(win, ex|clusive)|
|00003730| 0a 57 49 4e 44 4f 57 20 | 2a 77 69 6e 3b 0a 69 6e |.WINDOW |*win;.in|
|00003740| 74 20 65 78 63 6c 75 73 | 69 76 65 3b 0a 23 65 6c |t exclus|ive;.#el|
|00003750| 73 65 0a 63 68 61 72 09 | 2a 77 67 65 74 6c 69 6e |se.char.|*wgetlin|
|00003760| 65 28 57 49 4e 44 4f 57 | 20 2a 77 69 6e 2c 20 69 |e(WINDOW| *win, i|
|00003770| 6e 74 20 65 78 63 6c 75 | 73 69 76 65 29 0a 23 65 |nt exclu|sive).#e|
|00003780| 6e 64 69 66 0a 23 65 6c | 73 65 0a 23 69 66 64 65 |ndif.#el|se.#ifde|
|00003790| 66 09 58 47 45 54 4c 49 | 4e 45 5f 56 45 52 53 49 |f.XGETLI|NE_VERSI|
|000037a0| 4f 4e 0a 23 64 65 66 69 | 6e 65 09 09 67 65 74 6c |ON.#defi|ne..getl|
|000037b0| 69 6e 65 09 09 78 67 65 | 74 6c 69 6e 65 0a 23 65 |ine..xge|tline.#e|
|000037c0| 6e 64 69 66 0a 23 69 66 | 64 65 66 09 4b 41 4e 44 |ndif.#if|def.KAND|
|000037d0| 52 0a 63 68 61 72 09 2a | 67 65 74 6c 69 6e 65 28 |R.char.*|getline(|
|000037e0| 66 70 2c 20 65 78 63 6c | 75 73 69 76 65 29 0a 46 |fp, excl|usive).F|
|000037f0| 49 4c 45 09 2a 66 70 3b | 0a 69 6e 74 09 09 65 78 |ILE.*fp;|.int..ex|
|00003800| 63 6c 75 73 69 76 65 3b | 0a 23 65 6c 73 65 0a 63 |clusive;|.#else.c|
|00003810| 68 61 72 09 2a 67 65 74 | 6c 69 6e 65 28 46 49 4c |har.*get|line(FIL|
|00003820| 45 20 2a 66 70 2c 20 69 | 6e 74 20 65 78 63 6c 75 |E *fp, i|nt exclu|
|00003830| 73 69 76 65 29 0a 23 65 | 6e 64 69 66 0a 23 65 6e |sive).#e|ndif.#en|
|00003840| 64 69 66 0a 7b 0a 58 09 | 73 74 61 74 69 63 20 63 |dif.{.X.|static c|
|00003850| 68 61 72 09 2a 62 75 66 | 20 3d 20 4e 55 4c 4c 3b |har.*buf| = NULL;|
|00003860| 0a 58 09 73 69 7a 65 5f | 74 09 73 7a 20 3d 20 43 |.X.size_|t.sz = C|
|00003870| 48 55 4e 4b 3b 09 09 2f | 2a 20 74 68 69 73 20 6b |HUNK;../|* this k|
|00003880| 65 65 70 73 20 74 72 61 | 63 6b 20 6f 66 20 74 68 |eeps tra|ck of th|
|00003890| 65 20 63 75 72 72 65 6e | 74 20 73 69 7a 65 20 6f |e curren|t size o|
|000038a0| 66 20 62 75 66 66 65 72 | 20 2a 2f 0a 58 09 73 69 |f buffer| */.X.si|
|000038b0| 7a 65 5f 74 09 69 20 3d | 20 30 3b 09 09 09 2f 2a |ze_t.i =| 0;.../*|
|000038c0| 20 69 6e 64 65 78 20 69 | 6e 74 6f 20 73 74 72 69 | index i|nto stri|
|000038d0| 6e 67 20 74 72 61 63 6b | 69 6e 67 20 63 75 72 72 |ng track|ing curr|
|000038e0| 65 6e 74 20 70 6f 73 69 | 74 69 6f 6e 20 2a 2f 0a |ent posi|tion */.|
|000038f0| 58 09 63 68 61 72 09 2a | 70 74 72 3b 09 09 09 2f |X.char.*|ptr;.../|
|00003900| 2a 20 73 69 6e 63 65 20 | 77 65 20 6d 61 79 20 73 |* since |we may s|
|00003910| 65 74 20 62 75 66 20 74 | 6f 20 4e 55 4c 4c 20 62 |et buf t|o NULL b|
|00003920| 65 66 6f 72 65 20 72 65 | 74 75 72 6e 69 6e 67 20 |efore re|turning |
|00003930| 2a 2f 0a 58 09 69 6e 74 | 09 09 63 3b 09 09 09 09 |*/.X.int|..c;....|
|00003940| 2f 2a 20 74 6f 20 73 74 | 6f 72 65 20 67 65 74 63 |/* to st|ore getc|
|00003950| 20 72 65 74 75 72 6e 20 | 2a 2f 0a 23 69 66 64 65 | return |*/.#ifde|
|00003960| 66 09 58 47 45 54 4c 49 | 4e 45 5f 56 45 52 53 49 |f.XGETLI|NE_VERSI|
|00003970| 4f 4e 0a 58 09 69 6e 74 | 09 09 69 6e 5f 63 6f 6d |ON.X.int|..in_com|
|00003980| 6d 65 6e 74 20 3d 20 30 | 3b 09 2f 2a 20 69 66 20 |ment = 0|;./* if |
|00003990| 77 65 20 61 72 65 20 69 | 6e 20 61 20 63 6f 6d 6d |we are i|n a comm|
|000039a0| 65 6e 74 20 2a 2f 0a 23 | 65 6e 64 69 66 0a 58 0a |ent */.#|endif.X.|
|000039b0| 58 09 2f 2a 20 73 74 61 | 72 74 20 6f 75 74 20 77 |X./* sta|rt out w|
|000039c0| 69 74 68 20 62 75 66 20 | 73 65 74 20 74 6f 20 43 |ith buf |set to C|
|000039d0| 48 55 4e 4b 20 2b 20 32 | 20 62 79 74 65 73 20 2a |HUNK + 2| bytes *|
|000039e0| 2f 0a 58 09 2f 2a 20 6e | 6f 74 65 20 74 68 61 74 |/.X./* n|ote that|
|000039f0| 20 69 66 20 74 68 69 73 | 20 72 6f 75 74 69 6e 65 | if this| routine|
|00003a00| 20 77 61 73 20 70 72 65 | 76 69 6f 75 73 6c 79 20 | was pre|viously |
|00003a10| 63 61 6c 6c 65 64 20 77 | 69 74 68 20 65 78 63 6c |called w|ith excl|
|00003a20| 75 73 69 76 65 20 2a 2f | 0a 58 09 2f 2a 20 73 65 |usive */|.X./* se|
|00003a30| 74 20 74 68 61 74 20 6d | 61 6c 6c 6f 63 20 72 61 |t that m|alloc ra|
|00003a40| 74 68 65 72 20 74 68 61 | 6e 20 72 65 61 6c 6c 6f |ther tha|n reallo|
|00003a50| 63 20 77 69 6c 6c 20 62 | 65 20 63 61 6c 6c 65 64 |c will b|e called|
|00003a60| 20 64 75 65 20 74 6f 20 | 62 75 66 20 2a 2f 0a 58 | due to |buf */.X|
|00003a70| 09 2f 2a 20 62 65 69 6e | 67 20 73 65 74 20 74 6f |./* bein|g set to|
|00003a80| 20 4e 55 4c 4c 20 69 6e | 20 74 68 65 20 22 69 66 | NULL in| the "if|
|00003a90| 20 28 65 78 63 6c 75 73 | 69 76 65 29 20 63 6f 64 | (exclus|ive) cod|
|00003aa0| 65 20 61 74 20 65 6e 64 | 20 6f 66 20 72 6f 75 74 |e at end| of rout|
|00003ab0| 69 6e 65 20 2a 2f 0a 58 | 09 69 66 20 28 62 75 66 |ine */.X|.if (buf|
|00003ac0| 20 3d 3d 20 4e 55 4c 4c | 29 0a 58 09 09 62 75 66 | == NULL|).X..buf|
|00003ad0| 20 3d 20 28 63 68 61 72 | 20 2a 29 28 6d 61 6c 6c | = (char| *)(mall|
|00003ae0| 6f 63 28 43 48 55 4e 4b | 20 2b 20 32 29 29 3b 0a |oc(CHUNK| + 2));.|
|00003af0| 58 09 65 6c 73 65 0a 58 | 09 09 62 75 66 20 3d 20 |X.else.X|..buf = |
|00003b00| 28 63 68 61 72 20 2a 29 | 28 72 65 61 6c 6c 6f 63 |(char *)|(realloc|
|00003b10| 28 62 75 66 2c 20 43 48 | 55 4e 4b 20 2b 20 32 29 |(buf, CH|UNK + 2)|
|00003b20| 29 3b 0a 58 0a 58 09 2f | 2a 20 63 68 65 63 6b 20 |);.X.X./|* check |
|00003b30| 66 6f 72 20 6d 65 6d 6f | 72 79 20 70 72 6f 62 6c |for memo|ry probl|
|00003b40| 65 6d 20 2a 2f 0a 58 09 | 69 66 20 28 62 75 66 20 |em */.X.|if (buf |
|00003b50| 3d 3d 20 4e 55 4c 4c 29 | 0a 58 09 09 72 65 74 75 |== NULL)|.X..retu|
|00003b60| 72 6e 28 4e 55 4c 4c 29 | 3b 0a 58 0a 23 69 66 64 |rn(NULL)|;.X.#ifd|
|00003b70| 65 66 09 43 55 52 53 45 | 53 5f 56 45 52 53 49 4f |ef.CURSE|S_VERSIO|
|00003b80| 4e 0a 58 09 2f 2a 20 67 | 65 74 20 63 68 61 72 61 |N.X./* g|et chara|
|00003b90| 63 74 65 72 73 20 66 72 | 6f 6d 20 77 69 6e 64 6f |cters fr|om windo|
|00003ba0| 77 20 75 6e 74 69 6c 20 | 6e 65 77 6c 69 6e 65 20 |w until |newline |
|00003bb0| 6f 72 20 63 61 72 72 69 | 61 67 65 20 72 65 74 75 |or carri|age retu|
|00003bc0| 72 6e 20 2a 2f 0a 58 09 | 77 68 69 6c 65 20 28 28 |rn */.X.|while ((|
|00003bd0| 63 20 3d 20 77 67 65 74 | 63 68 28 77 69 6e 29 29 |c = wget|ch(win))|
|00003be0| 20 21 3d 20 27 5c 6e 27 | 20 26 26 20 63 20 21 3d | != '\n'| && c !=|
|00003bf0| 20 27 5c 72 27 29 0a 23 | 65 6c 73 65 0a 58 09 2f | '\r').#|else.X./|
|00003c00| 2a 20 67 65 74 20 63 68 | 61 72 61 63 74 65 72 73 |* get ch|aracters|
|00003c10| 20 66 72 6f 6d 20 73 74 | 72 65 61 6d 20 75 6e 74 | from st|ream unt|
|00003c20| 69 6c 20 45 4f 46 20 2a | 2f 0a 23 69 66 64 65 66 |il EOF *|/.#ifdef|
|00003c30| 09 58 47 45 54 4c 49 4e | 45 5f 56 45 52 53 49 4f |.XGETLIN|E_VERSIO|
|00003c40| 4e 0a 58 09 77 68 69 6c | 65 20 28 28 63 20 3d 20 |N.X.whil|e ((c = |
|00003c50| 67 65 74 63 28 66 70 29 | 29 20 21 3d 20 45 4f 46 |getc(fp)|) != EOF|
|00003c60| 29 0a 23 65 6c 73 65 0a | 58 09 77 68 69 6c 65 20 |).#else.|X.while |
|00003c70| 28 28 63 20 3d 20 67 65 | 74 63 28 66 70 29 29 20 |((c = ge|tc(fp)) |
|00003c80| 21 3d 20 45 4f 46 20 26 | 26 20 63 20 21 3d 20 27 |!= EOF &|& c != '|
|00003c90| 5c 6e 27 29 0a 23 65 6e | 64 69 66 0a 23 65 6e 64 |\n').#en|dif.#end|
|00003ca0| 69 66 0a 58 09 7b 0a 23 | 69 66 64 65 66 09 58 47 |if.X.{.#|ifdef.XG|
|00003cb0| 45 54 4c 49 4e 45 5f 56 | 45 52 53 49 4f 4e 0a 58 |ETLINE_V|ERSION.X|
|00003cc0| 09 09 62 75 66 5b 69 5d | 20 3d 20 63 3b 0a 58 0a |..buf[i]| = c;.X.|
|00003cd0| 58 09 09 2f 2a 20 6e 65 | 77 20 6c 69 6e 65 20 6f |X../* ne|w line o|
|00003ce0| 6e 6c 79 20 77 61 79 20 | 74 6f 20 65 6e 64 20 63 |nly way |to end c|
|00003cf0| 6f 6d 6d 65 6e 74 20 2a | 2f 0a 58 09 09 69 66 20 |omment *|/.X..if |
|00003d00| 28 63 20 3d 3d 20 27 5c | 6e 27 29 0a 58 09 09 7b |(c == '\|n').X..{|
|00003d10| 0a 58 09 09 09 69 66 20 | 28 69 29 0a 58 09 09 09 |.X...if |(i).X...|
|00003d20| 09 62 72 65 61 6b 3b 0a | 58 0a 58 09 09 09 69 6e |.break;.|X.X...in|
|00003d30| 5f 63 6f 6d 6d 65 6e 74 | 20 3d 20 30 3b 0a 58 09 |_comment| = 0;.X.|
|00003d40| 09 7d 0a 58 09 09 65 6c | 73 65 20 69 66 20 28 69 |.}.X..el|se if (i|
|00003d50| 6e 5f 63 6f 6d 6d 65 6e | 74 29 0a 58 09 09 7b 0a |n_commen|t).X..{.|
|00003d60| 58 09 09 09 2f 2a 20 63 | 6f 6e 74 69 6e 75 61 74 |X.../* c|ontinuat|
|00003d70| 69 6f 6e 20 73 74 69 6c | 6c 20 65 6e 64 73 20 63 |ion stil|l ends c|
|00003d80| 6f 6d 6d 65 6e 74 20 2d | 20 61 6c 74 65 72 6e 61 |omment -| alterna|
|00003d90| 74 69 76 65 20 77 6f 75 | 6c 64 20 62 65 20 73 69 |tive wou|ld be si|
|00003da0| 6c 6c 79 20 2a 2f 0a 58 | 09 09 09 69 66 20 28 63 |lly */.X|...if (c|
|00003db0| 20 3d 3d 20 27 5c 5c 27 | 20 26 26 20 28 63 20 3d | == '\\'| && (c =|
|00003dc0| 20 67 65 74 63 28 66 70 | 29 29 20 3d 3d 20 27 5c | getc(fp|)) == '\|
|00003dd0| 6e 27 29 0a 58 09 09 09 | 09 69 6e 5f 63 6f 6d 6d |n').X...|.in_comm|
|00003de0| 65 6e 74 20 3d 20 30 3b | 0a 58 09 09 7d 0a 58 09 |ent = 0;|.X..}.X.|
|00003df0| 09 65 6c 73 65 20 69 66 | 20 28 63 20 3d 3d 20 27 |.else if| (c == '|
|00003e00| 23 27 29 0a 58 09 09 09 | 69 6e 5f 63 6f 6d 6d 65 |#').X...|in_comme|
|00003e10| 6e 74 20 3d 20 31 3b 0a | 58 09 09 65 6c 73 65 20 |nt = 1;.|X..else |
|00003e20| 69 66 20 28 63 20 3d 3d | 20 27 5c 5c 27 29 0a 58 |if (c ==| '\\').X|
|00003e30| 09 09 7b 0a 58 09 09 09 | 69 66 20 28 28 63 20 3d |..{.X...|if ((c =|
|00003e40| 20 67 65 74 63 28 66 70 | 29 29 20 21 3d 20 27 5c | getc(fp|)) != '\|
|00003e50| 6e 27 20 26 26 20 63 20 | 21 3d 20 45 4f 46 29 0a |n' && c |!= EOF).|
|00003e60| 58 09 09 09 7b 0a 58 09 | 09 09 09 62 75 66 5b 69 |X...{.X.|...buf[i|
|00003e70| 2b 2b 5d 20 3d 20 27 5c | 5c 27 3b 0a 58 09 09 09 |++] = '\|\';.X...|
|00003e80| 09 62 75 66 5b 69 2b 2b | 5d 20 3d 20 63 3b 0a 58 |.buf[i++|] = c;.X|
|00003e90| 09 09 09 7d 0a 58 09 09 | 09 65 6c 73 65 0a 58 09 |...}.X..|.else.X.|
|00003ea0| 09 09 09 62 75 66 5b 69 | 2b 2b 5d 20 3d 20 27 20 |...buf[i|++] = ' |
|00003eb0| 27 3b 0a 58 09 09 7d 0a | 58 09 09 65 6c 73 65 0a |';.X..}.|X..else.|
|00003ec0| 58 09 09 09 69 2b 2b 3b | 0a 58 0a 23 65 6c 73 65 |X...i++;|.X.#else|
|00003ed0| 0a 58 09 09 2f 2a 20 74 | 68 65 20 66 6f 6c 6c 6f |.X../* t|he follo|
|00003ee0| 77 69 6e 67 20 6e 65 65 | 64 65 64 20 69 6e 20 63 |wing nee|ded in c|
|00003ef0| 61 73 65 20 77 65 20 61 | 72 65 20 69 6e 20 63 62 |ase we a|re in cb|
|00003f00| 72 65 61 6b 20 6f 72 20 | 72 61 77 20 6d 6f 64 65 |reak or |raw mode|
|00003f10| 20 2a 2f 0a 23 69 66 64 | 65 66 09 43 55 52 53 45 | */.#ifd|ef.CURSE|
|00003f20| 53 5f 56 45 52 53 49 4f | 4e 0a 58 09 09 69 66 20 |S_VERSIO|N.X..if |
|00003f30| 28 63 20 3d 3d 20 43 54 | 52 4c 28 27 4c 27 29 29 |(c == CT|RL('L'))|
|00003f40| 0a 58 09 09 09 63 6c 65 | 61 72 6f 6b 28 77 69 6e |.X...cle|arok(win|
|00003f50| 2c 20 31 29 3b 0a 58 09 | 09 65 6c 73 65 0a 23 65 |, 1);.X.|.else.#e|
|00003f60| 6e 64 69 66 0a 58 09 09 | 69 66 20 28 63 20 21 3d |ndif.X..|if (c !=|
|00003f70| 20 27 5c 62 27 29 0a 58 | 09 09 09 62 75 66 5b 69 | '\b').X|...buf[i|
|00003f80| 2b 2b 5d 20 3d 20 63 3b | 0a 58 09 09 65 6c 73 65 |++] = c;|.X..else|
|00003f90| 20 69 66 20 28 69 29 0a | 58 09 09 09 69 2d 2d 3b | if (i).|X...i--;|
|00003fa0| 0a 23 65 6e 64 69 66 0a | 58 0a 58 09 09 2f 2a 20 |.#endif.|X.X../* |
|00003fb0| 63 68 65 63 6b 20 66 6f | 72 20 62 75 66 66 65 72 |check fo|r buffer|
|00003fc0| 20 6f 76 65 72 66 6c 6f | 77 20 2a 2f 0a 58 09 09 | overflo|w */.X..|
|00003fd0| 69 66 20 28 69 20 3e 3d | 20 73 7a 29 0a 58 09 09 |if (i >=| sz).X..|
|00003fe0| 09 69 66 20 28 28 62 75 | 66 20 3d 20 28 63 68 61 |.if ((bu|f = (cha|
|00003ff0| 72 20 2a 29 28 72 65 61 | 6c 6c 6f 63 28 62 75 66 |r *)(rea|lloc(buf|
|00004000| 2c 20 28 73 7a 20 2b 3d | 20 43 48 55 4e 4b 29 20 |, (sz +=| CHUNK) |
|00004010| 2b 20 32 29 29 29 20 3d | 3d 20 4e 55 4c 4c 29 0a |+ 2))) =|= NULL).|
|00004020| 58 09 09 09 09 72 65 74 | 75 72 6e 28 4e 55 4c 4c |X....ret|urn(NULL|
|00004030| 29 3b 0a 58 09 7d 0a 58 | 0a 58 09 2f 2a 20 69 73 |);.X.}.X|.X./* is|
|00004040| 20 74 68 65 72 65 20 61 | 6e 79 74 68 69 6e 67 20 | there a|nything |
|00004050| 74 6f 20 72 65 74 75 72 | 6e 3f 20 2a 2f 0a 23 69 |to retur|n? */.#i|
|00004060| 66 6e 64 65 66 09 43 55 | 52 53 45 53 5f 56 45 52 |fndef.CU|RSES_VER|
|00004070| 53 49 4f 4e 0a 58 09 69 | 66 20 28 63 20 3d 3d 20 |SION.X.i|f (c == |
|00004080| 45 4f 46 20 26 26 20 21 | 69 29 0a 58 09 7b 0a 58 |EOF && !|i).X.{.X|
|00004090| 09 09 66 72 65 65 28 62 | 75 66 29 3b 0a 58 09 09 |..free(b|uf);.X..|
|000040a0| 62 75 66 20 3d 20 4e 55 | 4c 4c 3b 0a 58 09 09 72 |buf = NU|LL;.X..r|
|000040b0| 65 74 75 72 6e 28 4e 55 | 4c 4c 29 3b 0a 58 09 7d |eturn(NU|LL);.X.}|
|000040c0| 0a 23 65 6e 64 69 66 0a | 58 0a 58 09 62 75 66 5b |.#endif.|X.X.buf[|
|000040d0| 69 2b 2b 5d 20 3d 20 30 | 3b 09 2f 2a 20 79 65 73 |i++] = 0|;./* yes|
|000040e0| 20 49 20 77 61 6e 74 20 | 74 68 65 20 2b 2b 20 2a | I want |the ++ *|
|000040f0| 2f 0a 58 0a 58 09 2f 2a | 20 74 68 65 20 72 65 61 |/.X.X./*| the rea|
|00004100| 6c 6c 6f 63 20 6d 61 79 | 20 62 65 20 6f 76 65 72 |lloc may| be over|
|00004110| 6b 69 6c 6c 20 68 65 72 | 65 20 69 6e 20 6d 6f 73 |kill her|e in mos|
|00004120| 74 20 63 61 73 65 73 20 | 2d 20 70 65 72 68 61 70 |t cases |- perhap|
|00004130| 73 20 69 74 20 2a 2f 0a | 58 09 2f 2a 20 73 68 6f |s it */.|X./* sho|
|00004140| 75 6c 64 20 62 65 20 6d | 6f 76 65 64 20 74 6f 20 |uld be m|oved to |
|00004150| 74 68 65 20 27 69 66 20 | 28 65 78 63 6c 75 73 69 |the 'if |(exclusi|
|00004160| 76 65 29 27 20 62 6c 6f | 63 6b 20 2a 2f 0a 58 09 |ve)' blo|ck */.X.|
|00004170| 70 74 72 20 3d 20 62 75 | 66 20 3d 20 28 63 68 61 |ptr = bu|f = (cha|
|00004180| 72 20 2a 29 28 72 65 61 | 6c 6c 6f 63 28 62 75 66 |r *)(rea|lloc(buf|
|00004190| 2c 20 69 29 29 3b 0a 58 | 0a 58 09 2f 2a 20 70 72 |, i));.X|.X./* pr|
|000041a0| 65 76 65 6e 74 20 72 65 | 75 73 65 20 69 66 20 6e |event re|use if n|
|000041b0| 65 63 65 73 73 61 72 79 | 20 2a 2f 0a 58 09 69 66 |ecessary| */.X.if|
|000041c0| 20 28 65 78 63 6c 75 73 | 69 76 65 29 0a 58 09 09 | (exclus|ive).X..|
|000041d0| 62 75 66 20 3d 20 4e 55 | 4c 4c 3b 0a 58 0a 58 09 |buf = NU|LL;.X.X.|
|000041e0| 72 65 74 75 72 6e 28 70 | 74 72 29 3b 0a 7d 0a 58 |return(p|tr);.}.X|
|000041f0| 0a 2f 2a 20 64 6f 6e 27 | 74 20 62 6f 74 68 65 72 |./* don'|t bother|
|00004200| 20 77 69 74 68 20 54 45 | 53 54 5f 4d 4f 44 55 4c | with TE|ST_MODUL|
|00004210| 45 20 69 66 20 62 75 69 | 6c 64 69 6e 67 20 63 75 |E if bui|lding cu|
|00004220| 72 73 65 73 20 76 65 72 | 73 69 6f 6e 20 2a 2f 0a |rses ver|sion */.|
|00004230| 2f 2a 20 6d 6f 73 74 20 | 6f 66 20 74 68 65 20 74 |/* most |of the t|
|00004240| 65 73 74 69 6e 67 20 66 | 6f 72 20 74 68 65 20 63 |esting f|or the c|
|00004250| 75 72 73 65 73 20 76 65 | 72 73 69 6f 6e 20 63 61 |urses ve|rsion ca|
|00004260| 6e 20 62 65 20 64 6f 6e | 65 20 61 73 20 67 65 74 |n be don|e as get|
|00004270| 6c 69 6e 65 20 2a 2f 0a | 23 69 66 64 65 66 09 54 |line */.|#ifdef.T|
|00004280| 45 53 54 5f 4d 4f 44 55 | 4c 45 0a 69 6e 74 09 09 |EST_MODU|LE.int..|
|00004290| 6d 61 69 6e 28 76 6f 69 | 64 29 0a 7b 0a 58 09 63 |main(voi|d).{.X.c|
|000042a0| 68 61 72 09 2a 70 3b 0a | 58 0a 58 09 77 68 69 6c |har.*p;.|X.X.whil|
|000042b0| 65 20 28 28 70 20 3d 20 | 67 65 74 6c 69 6e 65 28 |e ((p = |getline(|
|000042c0| 73 74 64 69 6e 2c 20 30 | 29 29 20 21 3d 20 4e 55 |stdin, 0|)) != NU|
|000042d0| 4c 4c 29 0a 58 09 09 70 | 72 69 6e 74 66 28 22 25 |LL).X..p|rintf("%|
|000042e0| 73 5c 6e 22 2c 20 70 29 | 3b 0a 58 0a 58 09 72 65 |s\n", p)|;.X.X.re|
|000042f0| 74 75 72 6e 28 30 29 3b | 0a 7d 0a 23 65 6e 64 69 |turn(0);|.}.#endi|
|00004300| 66 0a 58 0a 23 69 66 64 | 65 66 09 58 43 41 54 0a |f.X.#ifd|ef.XCAT.|
|00004310| 23 69 6e 63 6c 75 64 65 | 09 3c 73 74 72 69 6e 67 |#include|.<string|
|00004320| 2e 68 3e 0a 58 0a 73 74 | 61 74 69 63 20 76 6f 69 |.h>.X.st|atic voi|
|00004330| 64 09 78 63 61 74 28 46 | 49 4c 45 20 2a 66 70 29 |d.xcat(F|ILE *fp)|
|00004340| 0a 7b 0a 58 09 63 68 61 | 72 09 2a 70 3b 0a 58 0a |.{.X.cha|r.*p;.X.|
|00004350| 58 09 77 68 69 6c 65 20 | 28 28 70 20 3d 20 78 67 |X.while |((p = xg|
|00004360| 65 74 6c 69 6e 65 28 66 | 70 2c 20 30 29 29 20 21 |etline(f|p, 0)) !|
|00004370| 3d 20 4e 55 4c 4c 29 0a | 58 09 09 70 72 69 6e 74 |= NULL).|X..print|
|00004380| 66 28 22 25 73 5c 6e 22 | 2c 20 70 29 3b 0a 7d 0a |f("%s\n"|, p);.}.|
|00004390| 58 0a 69 6e 74 09 09 6d | 61 69 6e 28 69 6e 74 20 |X.int..m|ain(int |
|000043a0| 61 72 67 63 2c 20 63 68 | 61 72 20 2a 2a 61 72 67 |argc, ch|ar **arg|
|000043b0| 76 29 0a 7b 0a 58 09 46 | 49 4c 45 09 2a 66 70 3b |v).{.X.F|ILE.*fp;|
|000043c0| 0a 58 09 69 6e 74 09 09 | 6b 3b 0a 58 0a 58 09 69 |.X.int..|k;.X.X.i|
|000043d0| 66 20 28 61 72 67 63 20 | 3c 20 32 29 0a 58 09 09 |f (argc |< 2).X..|
|000043e0| 78 63 61 74 28 73 74 64 | 69 6e 29 3b 0a 58 09 65 |xcat(std|in);.X.e|
|000043f0| 6c 73 65 20 66 6f 72 20 | 28 6b 20 3d 20 31 3b 20 |lse for |(k = 1; |
|00004400| 6b 20 3c 20 61 72 67 63 | 3b 20 6b 2b 2b 29 0a 58 |k < argc|; k++).X|
|00004410| 09 7b 0a 58 09 09 69 66 | 20 28 28 66 70 20 3d 20 |.{.X..if| ((fp = |
|00004420| 66 6f 70 65 6e 28 61 72 | 67 76 5b 6b 5d 2c 20 22 |fopen(ar|gv[k], "|
|00004430| 72 22 29 29 20 3d 3d 20 | 4e 55 4c 4c 29 0a 58 09 |r")) == |NULL).X.|
|00004440| 09 09 66 70 72 69 6e 74 | 66 28 73 74 64 65 72 72 |..fprint|f(stderr|
|00004450| 2c 20 22 78 63 61 74 3a | 20 43 61 6e 27 74 20 6f |, "xcat:| Can't o|
|00004460| 70 65 6e 20 66 69 6c 65 | 20 25 73 20 2d 20 25 73 |pen file| %s - %s|
|00004470| 5c 6e 22 2c 0a 58 09 09 | 09 09 09 09 09 09 09 09 |\n",.X..|........|
|00004480| 61 72 67 76 5b 6b 5d 2c | 20 73 74 72 65 72 72 6f |argv[k],| strerro|
|00004490| 72 28 65 72 72 6e 6f 29 | 29 3b 0a 58 09 09 65 6c |r(errno)|);.X..el|
|000044a0| 73 65 0a 58 09 09 7b 0a | 58 09 09 09 78 63 61 74 |se.X..{.|X...xcat|
|000044b0| 28 66 70 29 3b 0a 58 09 | 09 09 66 63 6c 6f 73 65 |(fp);.X.|..fclose|
|000044c0| 28 66 70 29 3b 0a 58 09 | 09 7d 0a 58 09 7d 0a 58 |(fp);.X.|.}.X.}.X|
|000044d0| 0a 58 09 72 65 74 75 72 | 6e 28 30 29 3b 0a 7d 0a |.X.retur|n(0);.}.|
|000044e0| 23 65 6e 64 69 66 0a 58 | 0a 53 48 41 52 5f 45 4f |#endif.X|.SHAR_EO|
|000044f0| 46 0a 63 68 6d 6f 64 20 | 30 36 34 30 20 67 65 74 |F.chmod |0640 get|
|00004500| 6c 69 6e 65 2e 63 20 7c | 7c 0a 65 63 68 6f 20 27 |line.c |||.echo '|
|00004510| 72 65 73 74 6f 72 65 20 | 6f 66 20 67 65 74 6c 69 |restore |of getli|
|00004520| 6e 65 2e 63 20 66 61 69 | 6c 65 64 27 0a 57 63 5f |ne.c fai|led'.Wc_|
|00004530| 63 3d 22 60 77 63 20 2d | 63 20 3c 20 27 67 65 74 |c="`wc -|c < 'get|
|00004540| 6c 69 6e 65 2e 63 27 60 | 22 0a 74 65 73 74 20 35 |line.c'`|".test 5|
|00004550| 33 37 37 20 2d 65 71 20 | 22 24 57 63 5f 63 22 20 |377 -eq |"$Wc_c" |
|00004560| 7c 7c 0a 09 65 63 68 6f | 20 27 67 65 74 6c 69 6e |||..echo| 'getlin|
|00004570| 65 2e 63 3a 20 6f 72 69 | 67 69 6e 61 6c 20 73 69 |e.c: ori|ginal si|
|00004580| 7a 65 20 35 33 37 37 2c | 20 63 75 72 72 65 6e 74 |ze 5377,| current|
|00004590| 20 73 69 7a 65 27 20 22 | 24 57 63 5f 63 22 0a 23 | size' "|$Wc_c".#|
|000045a0| 20 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 20 4d | =======|====== M|
|000045b0| 61 6b 65 66 69 6c 65 20 | 3d 3d 3d 3d 3d 3d 3d 3d |akefile |========|
|000045c0| 3d 3d 3d 3d 3d 3d 0a 73 | 65 64 20 27 73 2f 5e 58 |======.s|ed 's/^X|
|000045d0| 2f 2f 27 20 3c 3c 20 27 | 53 48 41 52 5f 45 4f 46 |//' << '|SHAR_EOF|
|000045e0| 27 20 3e 20 27 4d 61 6b | 65 66 69 6c 65 27 20 26 |' > 'Mak|efile' &|
|000045f0| 26 0a 23 20 4d 61 6b 65 | 66 69 6c 65 20 66 6f 72 |&.# Make|file for|
|00004600| 20 66 65 65 64 70 69 70 | 65 0a 23 20 57 72 69 74 | feedpip|e.# Writ|
|00004610| 74 65 6e 20 62 79 20 44 | 27 41 72 63 79 20 4a 2e |ten by D|'Arcy J.|
|00004620| 4d 2e 20 43 61 69 6e 0a | 23 0a 58 0a 23 20 49 66 |M. Cain.|#.X.# If|
|00004630| 20 79 6f 75 20 70 75 74 | 20 67 65 74 6c 69 6e 65 | you put| getline|
|00004640| 20 61 6e 64 20 66 72 69 | 65 6e 64 73 20 69 6e 20 | and fri|ends in |
|00004650| 79 6f 75 72 20 6c 6f 63 | 61 6c 20 6c 69 62 72 61 |your loc|al libra|
|00004660| 72 79 20 61 73 20 49 20 | 64 6f 20 74 68 65 6e 20 |ry as I |do then |
|00004670| 72 65 70 6c 61 63 65 0a | 23 20 63 61 69 6e 20 62 |replace.|# cain b|
|00004680| 65 6c 6f 77 20 77 69 74 | 68 20 74 68 65 20 6c 69 |elow wit|h the li|
|00004690| 62 72 61 72 79 20 6e 61 | 6d 65 2e 20 20 49 66 20 |brary na|me. If |
|000046a0| 6e 6f 74 20 74 68 65 6e | 20 72 65 6d 6f 76 65 20 |not then| remove |
|000046b0| 74 68 65 20 63 6f 6d 6d | 65 6e 74 20 63 68 61 72 |the comm|ent char|
|000046c0| 61 63 74 65 72 0a 23 20 | 69 6e 20 74 68 65 20 4f |acter.# |in the O|
|000046d0| 42 4a 45 43 54 53 20 6c | 69 73 74 20 74 6f 20 69 |BJECTS l|ist to i|
|000046e0| 6e 63 6c 75 64 65 20 78 | 67 65 74 6c 69 6e 65 2e |nclude x|getline.|
|000046f0| 6f 20 74 68 65 72 65 2e | 0a 4c 44 4c 49 42 53 20 |o there.|.LDLIBS |
|00004700| 3d 09 2d 6c 63 61 69 6e | 0a 4f 42 4a 45 43 54 53 |=.-lcain|.OBJECTS|
|00004710| 20 3d 09 66 65 65 64 70 | 69 70 65 2e 6f 20 72 65 | =.feedp|ipe.o re|
|00004720| 61 64 63 66 67 2e 6f 20 | 23 20 78 67 65 74 6c 69 |adcfg.o |# xgetli|
|00004730| 6e 65 2e 6f 0a 58 0a 4e | 41 4d 45 20 3d 09 09 66 |ne.o.X.N|AME =..f|
|00004740| 65 65 64 70 69 70 65 0a | 43 46 4c 41 47 53 3d 09 |eedpipe.|CFLAGS=.|
|00004750| 09 2d 4f 20 2d 57 61 6c | 6c 20 2d 61 6e 73 69 20 |.-O -Wal|l -ansi |
|00004760| 2d 70 65 64 61 6e 74 69 | 63 20 2d 57 63 61 73 74 |-pedanti|c -Wcast|
|00004770| 2d 71 75 61 6c 20 2d 57 | 69 64 2d 63 6c 61 73 68 |-qual -W|id-clash|
|00004780| 2d 33 31 20 5c 0a 58 09 | 09 09 2d 57 73 68 61 64 |-31 \.X.|..-Wshad|
|00004790| 6f 77 20 2d 57 70 6f 69 | 6e 74 65 72 2d 61 72 69 |ow -Wpoi|nter-ari|
|000047a0| 74 68 20 2d 57 77 72 69 | 74 65 2d 73 74 72 69 6e |th -Wwri|te-strin|
|000047b0| 67 73 20 2d 67 0a 42 49 | 4e 20 3d 09 09 2f 75 73 |gs -g.BI|N =../us|
|000047c0| 72 2f 6c 62 69 6e 0a 44 | 49 53 54 20 3d 09 09 52 |r/lbin.D|IST =..R|
|000047d0| 45 41 44 4d 45 20 66 65 | 65 64 70 69 70 65 2e 31 |EADME fe|edpipe.1|
|000047e0| 20 66 65 65 64 70 69 70 | 65 2e 63 20 72 65 61 64 | feedpip|e.c read|
|000047f0| 63 66 67 2e 63 20 67 65 | 74 6c 69 6e 65 2e 63 20 |cfg.c ge|tline.c |
|00004800| 4d 61 6b 65 66 69 6c 65 | 20 66 65 65 64 70 69 70 |Makefile| feedpip|
|00004810| 65 2e 68 0a 66 65 65 64 | 70 69 70 65 3a 09 24 28 |e.h.feed|pipe:.$(|
|00004820| 4f 42 4a 45 43 54 53 29 | 0a 58 0a 63 6c 65 61 6e |OBJECTS)|.X.clean|
|00004830| 3a 0a 58 09 72 6d 20 20 | 2d 66 20 2a 2e 6f 20 2a |:.X.rm |-f *.o *|
|00004840| 2e 6f 62 6a 20 63 6f 72 | 65 20 74 65 73 74 0a 58 |.obj cor|e test.X|
|00004850| 0a 63 6c 6f 62 62 65 72 | 3a 09 63 6c 65 61 6e 0a |.clobber|:.clean.|
|00004860| 58 09 72 6d 20 2d 66 20 | 66 65 65 64 70 69 70 65 |X.rm -f |feedpipe|
|00004870| 20 24 28 4e 41 4d 45 29 | 2e 30 3f 20 24 28 4e 41 | $(NAME)|.0? $(NA|
|00004880| 4d 45 29 2e 67 65 6e 0a | 58 0a 6c 69 6e 6b 3a 0a |ME).gen.|X.link:.|
|00004890| 58 09 6c 6e 20 24 28 4c | 42 49 4e 53 29 20 2e 0a |X.ln $(L|BINS) ..|
|000048a0| 58 0a 69 6e 73 74 61 6c | 6c 3a 09 66 65 65 64 70 |X.instal|l:.feedp|
|000048b0| 69 70 65 0a 58 09 72 6d | 20 2d 66 20 24 28 42 49 |ipe.X.rm| -f $(BI|
|000048c0| 4e 29 2f 66 65 65 64 70 | 69 70 65 0a 58 09 63 68 |N)/feedp|ipe.X.ch|
|000048d0| 6d 6f 64 20 37 31 31 20 | 66 65 65 64 70 69 70 65 |mod 711 |feedpipe|
|000048e0| 0a 58 09 6c 6e 20 66 65 | 65 64 70 69 70 65 20 24 |.X.ln fe|edpipe $|
|000048f0| 28 42 49 4e 29 0a 58 0a | 64 69 73 74 3a 09 67 65 |(BIN).X.|dist:.ge|
|00004900| 6e 20 73 68 61 72 0a 58 | 0a 23 20 67 65 6e 20 73 |n shar.X|.# gen s|
|00004910| 74 75 66 66 20 6e 65 65 | 64 73 20 6d 79 20 67 65 |tuff nee|ds my ge|
|00004920| 6e 66 69 6c 65 73 20 70 | 61 63 6b 61 67 65 0a 67 |nfiles p|ackage.g|
|00004930| 65 6e 3a 09 24 28 4e 41 | 4d 45 29 2e 67 65 6e 0a |en:.$(NA|ME).gen.|
|00004940| 58 0a 24 28 4e 41 4d 45 | 29 2e 67 65 6e 3a 09 24 |X.$(NAME|).gen:.$|
|00004950| 28 44 49 53 54 29 0a 58 | 09 6d 6b 73 63 72 69 70 |(DIST).X|.mkscrip|
|00004960| 74 20 24 5e 20 3e 20 24 | 28 4e 41 4d 45 29 2e 67 |t $^ > $|(NAME).g|
|00004970| 65 6e 0a 58 0a 73 68 61 | 72 3a 09 24 28 4e 41 4d |en.X.sha|r:.$(NAM|
|00004980| 45 29 2e 30 31 0a 58 0a | 24 28 4e 41 4d 45 29 2e |E).01.X.|$(NAME).|
|00004990| 30 31 3a 09 24 28 44 49 | 53 54 29 0a 58 09 73 68 |01:.$(DI|ST).X.sh|
|000049a0| 61 72 20 2d 76 78 66 4c | 20 34 30 20 2d 6f 20 24 |ar -vxfL| 40 -o $|
|000049b0| 28 4e 41 4d 45 29 20 24 | 5e 0a 58 09 63 68 6d 6f |(NAME) $|^.X.chmo|
|000049c0| 64 20 36 34 34 20 24 28 | 4e 41 4d 45 29 2e 30 31 |d 644 $(|NAME).01|
|000049d0| 0a 58 09 72 6d 20 2d 66 | 20 2f 75 73 72 2f 73 70 |.X.rm -f| /usr/sp|
|000049e0| 6f 6f 6c 2f 75 75 63 70 | 70 75 62 6c 69 63 2f 70 |ool/uucp|public/p|
|000049f0| 75 62 2f 64 69 73 74 72 | 69 62 2f 24 28 4e 41 4d |ub/distr|ib/$(NAM|
|00004a00| 45 29 2e 73 68 61 72 0a | 58 09 6c 6e 20 24 28 4e |E).shar.|X.ln $(N|
|00004a10| 41 4d 45 29 2e 30 31 20 | 2f 75 73 72 2f 73 70 6f |AME).01 |/usr/spo|
|00004a20| 6f 6c 2f 75 75 63 70 70 | 75 62 6c 69 63 2f 70 75 |ol/uucpp|ublic/pu|
|00004a30| 62 2f 64 69 73 74 72 69 | 62 2f 24 28 4e 41 4d 45 |b/distri|b/$(NAME|
|00004a40| 29 2e 73 68 61 72 0a 58 | 0a 73 74 72 69 70 3a 09 |).shar.X|.strip:.|
|00004a50| 66 65 65 64 70 69 70 65 | 0a 58 09 73 74 72 69 70 |feedpipe|.X.strip|
|00004a60| 20 66 65 65 64 70 69 70 | 65 0a 58 0a 6d 63 73 3a | feedpip|e.X.mcs:|
|00004a70| 09 66 65 65 64 70 69 70 | 65 0a 58 09 6d 63 73 20 |.feedpip|e.X.mcs |
|00004a80| 2d 64 20 66 65 65 64 70 | 69 70 65 0a 58 0a 23 20 |-d feedp|ipe.X.# |
|00004a90| 54 68 65 20 66 6f 6c 6c | 6f 77 69 6e 67 20 69 73 |The foll|owing is|
|00004aa0| 20 74 6f 20 67 65 74 20 | 74 68 65 20 67 65 74 6c | to get |the getl|
|00004ab0| 69 6e 65 20 73 6f 75 72 | 63 65 20 69 6e 74 6f 20 |ine sour|ce into |
|00004ac0| 74 68 69 73 20 64 69 72 | 65 63 74 6f 72 79 20 66 |this dir|ectory f|
|00004ad0| 6f 72 0a 23 20 64 69 73 | 74 72 69 62 75 74 69 6f |or.# dis|tributio|
|00004ae0| 6e 20 70 75 72 70 6f 73 | 65 73 20 73 69 6e 63 65 |n purpos|es since|
|00004af0| 20 69 74 20 69 73 20 69 | 6e 20 6d 79 20 73 74 61 | it is i|n my sta|
|00004b00| 6e 64 61 72 64 20 6c 69 | 62 72 61 72 79 20 61 6e |ndard li|brary an|
|00004b10| 64 20 6e 6f 74 0a 23 20 | 61 63 74 75 61 6c 6c 79 |d not.# |actually|
|00004b20| 20 6e 65 65 64 65 64 20 | 66 6f 72 20 62 75 69 6c | needed |for buil|
|00004b30| 64 69 6e 67 2e 0a 58 0a | 67 65 74 6c 69 6e 65 2e |ding..X.|getline.|
|00004b40| 63 3a 09 2e 2e 2f 6c 69 | 62 72 61 72 79 2f 67 65 |c:.../li|brary/ge|
|00004b50| 74 6c 69 6e 65 2e 63 0a | 58 09 6c 6e 20 2e 2e 2f |tline.c.|X.ln ../|
|00004b60| 6c 69 62 72 61 72 79 2f | 67 65 74 6c 69 6e 65 2e |library/|getline.|
|00004b70| 63 20 2e 0a 58 0a 78 67 | 65 74 6c 69 6e 65 2e 6f |c ..X.xg|etline.o|
|00004b80| 3a 09 67 65 74 6c 69 6e | 65 2e 63 0a 58 09 24 28 |:.getlin|e.c.X.$(|
|00004b90| 43 43 29 20 24 28 43 46 | 4c 41 47 53 29 20 2d 44 |CC) $(CF|LAGS) -D|
|00004ba0| 58 47 45 54 4c 49 4e 45 | 5f 56 45 52 53 49 4f 4e |XGETLINE|_VERSION|
|00004bb0| 20 2d 63 20 67 65 74 6c | 69 6e 65 2e 63 20 2d 6f | -c getl|ine.c -o|
|00004bc0| 20 78 67 65 74 6c 69 6e | 65 2e 6f 0a 58 0a 23 20 | xgetlin|e.o.X.# |
|00004bd0| 6e 6f 74 20 6e 65 65 64 | 65 64 20 69 6e 20 66 65 |not need|ed in fe|
|00004be0| 65 64 70 69 70 65 20 62 | 75 74 20 69 74 27 73 20 |edpipe b|ut it's |
|00004bf0| 61 76 61 69 6c 61 62 6c | 65 20 69 6e 20 67 65 74 |availabl|e in get|
|00004c00| 6c 69 6e 65 20 61 6e 79 | 77 61 79 0a 77 67 65 74 |line any|way.wget|
|00004c10| 6c 69 6e 65 2e 6f 3a 09 | 67 65 74 6c 69 6e 65 2e |line.o:.|getline.|
|00004c20| 63 0a 58 09 24 28 43 43 | 29 20 24 28 43 46 4c 41 |c.X.$(CC|) $(CFLA|
|00004c30| 47 53 29 20 2d 44 43 55 | 52 53 45 53 5f 56 45 52 |GS) -DCU|RSES_VER|
|00004c40| 53 49 4f 4e 20 2d 63 20 | 67 65 74 6c 69 6e 65 2e |SION -c |getline.|
|00004c50| 63 20 2d 6f 20 77 67 65 | 74 6c 69 6e 65 2e 6f 0a |c -o wge|tline.o.|
|00004c60| 58 0a 53 48 41 52 5f 45 | 4f 46 0a 63 68 6d 6f 64 |X.SHAR_E|OF.chmod|
|00004c70| 20 30 36 36 34 20 4d 61 | 6b 65 66 69 6c 65 20 7c | 0664 Ma|kefile ||
|00004c80| 7c 0a 65 63 68 6f 20 27 | 72 65 73 74 6f 72 65 20 ||.echo '|restore |
|00004c90| 6f 66 20 4d 61 6b 65 66 | 69 6c 65 20 66 61 69 6c |of Makef|ile fail|
|00004ca0| 65 64 27 0a 57 63 5f 63 | 3d 22 60 77 63 20 2d 63 |ed'.Wc_c|="`wc -c|
|00004cb0| 20 3c 20 27 4d 61 6b 65 | 66 69 6c 65 27 60 22 0a | < 'Make|file'`".|
|00004cc0| 74 65 73 74 20 31 36 31 | 33 20 2d 65 71 20 22 24 |test 161|3 -eq "$|
|00004cd0| 57 63 5f 63 22 20 7c 7c | 0a 09 65 63 68 6f 20 27 |Wc_c" |||..echo '|
|00004ce0| 4d 61 6b 65 66 69 6c 65 | 3a 20 6f 72 69 67 69 6e |Makefile|: origin|
|00004cf0| 61 6c 20 73 69 7a 65 20 | 31 36 31 33 2c 20 63 75 |al size |1613, cu|
|00004d00| 72 72 65 6e 74 20 73 69 | 7a 65 27 20 22 24 57 63 |rrent si|ze' "$Wc|
|00004d10| 5f 63 22 0a 23 20 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |_c".# ==|========|
|00004d20| 3d 3d 3d 20 66 65 65 64 | 70 69 70 65 2e 68 20 3d |=== feed|pipe.h =|
|00004d30| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 0a 73 65 |========|=====.se|
|00004d40| 64 20 27 73 2f 5e 58 2f | 2f 27 20 3c 3c 20 27 53 |d 's/^X/|/' << 'S|
|00004d50| 48 41 52 5f 45 4f 46 27 | 20 3e 20 27 66 65 65 64 |HAR_EOF'| > 'feed|
|00004d60| 70 69 70 65 2e 68 27 20 | 26 26 0a 2f 2a 0a 66 65 |pipe.h' |&&./*.fe|
|00004d70| 65 64 70 69 70 65 2e 68 | 0a 57 72 69 74 74 65 6e |edpipe.h|.Written|
|00004d80| 20 62 79 20 44 27 41 72 | 63 79 20 4a 2e 4d 2e 20 | by D'Ar|cy J.M. |
|00004d90| 43 61 69 6e 0a 58 0a 68 | 65 61 64 65 72 20 66 69 |Cain.X.h|eader fi|
|00004da0| 6c 65 20 66 6f 72 20 66 | 65 65 64 70 69 70 65 0a |le for f|eedpipe.|
|00004db0| 2a 2f 0a 58 0a 74 79 70 | 65 64 65 66 20 73 74 72 |*/.X.typ|edef str|
|00004dc0| 75 63 74 20 7b 0a 58 09 | 63 68 61 72 09 2a 6e 61 |uct {.X.|char.*na|
|00004dd0| 6d 65 3b 09 09 2f 2a 20 | 6e 61 6d 65 20 6f 66 20 |me;../* |name of |
|00004de0| 74 68 65 20 70 69 70 65 | 20 2a 2f 0a 58 09 63 68 |the pipe| */.X.ch|
|00004df0| 61 72 09 2a 63 6d 64 3b | 09 09 2f 2a 20 63 6f 6d |ar.*cmd;|../* com|
|00004e00| 6d 61 6e 64 20 74 6f 20 | 66 65 65 64 20 74 6f 20 |mand to |feed to |
|00004e10| 70 69 70 65 20 2a 2f 0a | 58 09 63 68 61 72 09 2a |pipe */.|X.char.*|
|00004e20| 6f 77 6e 65 72 3b 09 09 | 2f 2a 20 66 69 6c 65 20 |owner;..|/* file |
|00004e30| 6f 77 6e 65 72 20 2a 2f | 0a 58 09 63 68 61 72 09 |owner */|.X.char.|
|00004e40| 2a 67 72 6f 75 70 3b 09 | 09 2f 2a 20 66 69 6c 65 |*group;.|./* file|
|00004e50| 20 67 72 6f 75 70 20 2a | 2f 0a 58 09 69 6e 74 09 | group *|/.X.int.|
|00004e60| 09 6d 6f 64 65 3b 09 09 | 2f 2a 20 66 69 6c 65 20 |.mode;..|/* file |
|00004e70| 6d 6f 64 65 20 2a 2f 0a | 7d 20 46 50 5f 43 46 47 |mode */.|} FP_CFG|
|00004e80| 3b 0a 58 0a 65 78 74 65 | 72 6e 20 46 50 5f 43 46 |;.X.exte|rn FP_CF|
|00004e90| 47 09 2a 66 70 5f 63 66 | 67 3b 0a 65 78 74 65 72 |G.*fp_cf|g;.exter|
|00004ea0| 6e 20 63 68 61 72 09 09 | 2a 70 72 6f 67 6e 61 6d |n char..|*prognam|
|00004eb0| 65 3b 0a 65 78 74 65 72 | 6e 20 69 6e 74 09 09 72 |e;.exter|n int..r|
|00004ec0| 65 61 64 63 66 67 28 46 | 49 4c 45 20 2a 66 70 29 |eadcfg(F|ILE *fp)|
|00004ed0| 3b 0a 53 48 41 52 5f 45 | 4f 46 0a 63 68 6d 6f 64 |;.SHAR_E|OF.chmod|
|00004ee0| 20 30 36 34 30 20 66 65 | 65 64 70 69 70 65 2e 68 | 0640 fe|edpipe.h|
|00004ef0| 20 7c 7c 0a 65 63 68 6f | 20 27 72 65 73 74 6f 72 | ||.echo| 'restor|
|00004f00| 65 20 6f 66 20 66 65 65 | 64 70 69 70 65 2e 68 20 |e of fee|dpipe.h |
|00004f10| 66 61 69 6c 65 64 27 0a | 57 63 5f 63 3d 22 60 77 |failed'.|Wc_c="`w|
|00004f20| 63 20 2d 63 20 3c 20 27 | 66 65 65 64 70 69 70 65 |c -c < '|feedpipe|
|00004f30| 2e 68 27 60 22 0a 74 65 | 73 74 20 33 35 31 20 2d |.h'`".te|st 351 -|
|00004f40| 65 71 20 22 24 57 63 5f | 63 22 20 7c 7c 0a 09 65 |eq "$Wc_|c" ||..e|
|00004f50| 63 68 6f 20 27 66 65 65 | 64 70 69 70 65 2e 68 3a |cho 'fee|dpipe.h:|
|00004f60| 20 6f 72 69 67 69 6e 61 | 6c 20 73 69 7a 65 20 33 | origina|l size 3|
|00004f70| 35 31 2c 20 63 75 72 72 | 65 6e 74 20 73 69 7a 65 |51, curr|ent size|
|00004f80| 27 20 22 24 57 63 5f 63 | 22 0a 65 78 69 74 20 30 |' "$Wc_c|".exit 0|
|00004f90| 0a 2d 2d 20 0a 44 27 41 | 72 63 79 20 4a 2e 4d 2e |.-- .D'A|rcy J.M.|
|00004fa0| 20 43 61 69 6e 20 28 64 | 61 72 63 79 40 64 72 75 | Cain (d|arcy@dru|
|00004fb0| 69 64 29 20 20 20 20 20 | 7c 0a 44 27 41 72 63 79 |id) ||.D'Arcy|
|00004fc0| 20 43 61 69 6e 20 43 6f | 6e 73 75 6c 74 69 6e 67 | Cain Co|nsulting|
|00004fd0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 7c 20 20 | | | |
|00004fe0| 20 54 68 65 72 65 27 73 | 20 6e 6f 20 67 6f 76 65 | There's| no gove|
|00004ff0| 72 6e 6d 65 6e 74 0a 54 | 6f 72 6f 6e 74 6f 2c 20 |rnment.T|oronto, |
|00005000| 4f 6e 74 61 72 69 6f 2c | 20 43 61 6e 61 64 61 20 |Ontario,| Canada |
|00005010| 20 20 20 20 20 20 20 20 | 20 20 7c 20 20 20 6c 69 | | | li|
|00005020| 6b 65 20 6e 6f 20 67 6f | 76 65 72 6e 6d 65 6e 74 |ke no go|vernment|
|00005030| 21 0a 2b 31 20 34 31 36 | 20 34 32 34 20 32 38 37 |!.+1 416| 424 287|
|00005040| 31 20 20 20 20 20 20 20 | 20 20 20 44 6f 44 23 30 |1 | DoD#0|
|00005050| 30 38 32 20 20 7c 0a 0a | 65 78 69 74 20 30 20 23 |082 |..|exit 0 #|
|00005060| 20 4a 75 73 74 20 69 6e | 20 63 61 73 65 2e 2e 2e | Just in| case...|
|00005070| 0a 2d 2d 20 0a 4b 65 6e | 74 20 4c 61 6e 64 66 69 |.-- .Ken|t Landfi|
|00005080| 65 6c 64 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |eld | |
|00005090| 20 20 20 20 20 20 49 4e | 54 45 52 4e 45 54 3a 20 | IN|TERNET: |
|000050a0| 6b 65 6e 74 40 73 70 61 | 72 6b 79 2e 49 4d 44 2e |kent@spa|rky.IMD.|
|000050b0| 53 74 65 72 6c 69 6e 67 | 2e 43 4f 4d 0a 53 74 65 |Sterling|.COM.Ste|
|000050c0| 72 6c 69 6e 67 20 53 6f | 66 74 77 61 72 65 2c 20 |rling So|ftware, |
|000050d0| 49 4d 44 20 20 20 20 20 | 20 20 20 20 20 20 55 55 |IMD | UU|
|000050e0| 43 50 3a 20 20 20 20 20 | 75 75 6e 65 74 21 73 70 |CP: |uunet!sp|
|000050f0| 61 72 6b 79 21 6b 65 6e | 74 0a 50 68 6f 6e 65 3a |arky!ken|t.Phone:|
|00005100| 20 20 20 20 28 34 30 32 | 29 20 32 39 31 2d 38 33 | (402|) 291-83|
|00005110| 30 30 20 20 20 20 20 20 | 20 20 20 46 41 58 3a 20 |00 | FAX: |
|00005120| 20 20 20 20 20 28 34 30 | 32 29 20 32 39 31 2d 34 | (40|2) 291-4|
|00005130| 33 36 32 0a 50 6c 65 61 | 73 65 20 73 65 6e 64 20 |362.Plea|se send |
|00005140| 63 6f 6d 70 2e 73 6f 75 | 72 63 65 73 2e 6d 69 73 |comp.sou|rces.mis|
|00005150| 63 2d 72 65 6c 61 74 65 | 64 20 6d 61 69 6c 20 74 |c-relate|d mail t|
|00005160| 6f 20 6b 65 6e 74 40 75 | 75 6e 65 74 2e 75 75 2e |o kent@u|unet.uu.|
|00005170| 6e 65 74 2e 0a | |net.. | |
+--------+-------------------------+-------------------------+--------+--------+