2 statusdict /setduplexmode known {
3 false statusdict /setduplexmode get exec
12 /CF /Courier findfont Ps scalefont def
13 /IF /Courier-Oblique findfont Ps scalefont def
14 /BF /Courier-Bold findfont Ps scalefont def
15 /CFs /Courier findfont SPs scalefont def
16 /IFs /Courier-Oblique findfont SPs scalefont def
17 /BFs /Courier-Bold findfont SPs scalefont def
18 /HF /Helvetica findfont Ps scalefont def
19 /Li CFs setfont (1234567890) stringwidth pop def
20 /Nl { /Vpos Vpos Lh sub def } def
21 /Lpt { 0 Vpos moveto } def
24 /Ip { Gb .5 setlinewidth
25 0 Tm moveto Rm 0 rlineto
26 gsave .98 setgray fill grestore stroke
27 0 0 moveto 0 Bf rlineto Rm 0 rlineto 0 Bf neg rlineto closepath
28 gsave .98 setgray fill grestore stroke
29 0 Bf moveto 0 Tm Bh sub lineto stroke newpath
31 /Cp { Ip .3 setlinewidth newpath
32 Li 0 Bf add moveto Li Tm Bh sub lineto stroke newpath
34 /So { gsave dup stringwidth pop Ps 3 div 0 exch rmoveto 0 rlineto fill grestore } def
35 /Ul { gsave dup stringwidth pop 0 -1 rmoveto 0 rlineto fill grestore } def
36 /Bs { gsave dup show grestore 0.5 0.5 rmoveto show } def
37 <</PageSize [605 806]>> setpagedevice
40 /Helvetica findfont 10 scalefont setfont
41 (Trueprint 3.6.5) show
43 /Helvetica-Bold findfont 20 scalefont setfont
46 (Printed on: Fri Apr 16 03:00:00 1982) show
48 (Last page number: 3) show
49 70 650 moveto (File: test1.c) show
50 70 625 moveto (File: test2.c) show
54 Ip HF setfont /Ypos Ps 2 div def
56 (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto
58 exch sub 2 div add (Function Index) stringwidth pop 2 div sub Ypos moveto
60 CF setfont /Vpos Tm Bh sub Ps sub def
61 Lpt( closepipe 2 (test1.c)
63 Lpt( fclosepipe..................2 (test1.c)) show Nl
64 Lpt( fopenpipe 2 (test1.c)
66 Lpt( getopt......................3 (test2.c)) show Nl
67 Lpt( openpipe 1 (test1.c)
72 Ip HF setfont /Ypos Ps 2 div def
74 (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto
76 exch sub 2 div add (File Index) stringwidth pop 2 div sub Ypos moveto
78 CF setfont /Vpos Tm Bh sub Ps sub def
79 Lpt( test1.c 1) BF setfont show CF setfont Nl
80 Lpt( closepipe...................2) show Nl
81 Lpt( fclosepipe 2) show Nl
82 Lpt( fopenpipe...................2) show Nl
83 Lpt( openpipe 1) show Nl
84 Lpt( test2.c 3) BF setfont show CF setfont Nl
85 Lpt( getopt 3) show Nl
89 Cp HF setfont /Ypos Ps 2 div def
91 (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1 of 3) stringwidth pop sub dup Ypos moveto
93 exch sub 2 div add (test1.c 1) stringwidth pop 2 div sub Ypos moveto
95 /Vpos Tm Bh sub Ps sub def
96 Lpt CFs setfont ( 1 ) show (/*) IF setfont show Nl
97 Lpt CFs setfont ( 2 ) show ( * Source file:) IF setfont show Nl
98 Lpt CFs setfont ( 3 ) show ( * openpipe.c) IF setfont show Nl
99 Lpt CFs setfont ( 4 ) show ( *) IF setfont show Nl
100 Lpt CFs setfont ( 5 ) show ( * Contains openpipe - a replacement for the non-POSIX function popen.) IF setfont show Nl
101 Lpt CFs setfont ( 6 ) show ( * This returns an int rather than a FILE * to make it general purpose -) IF setfont show Nl
102 Lpt CFs setfont ( 7 ) show ( * fdopen can be used outside to convert this to a FILE *) IF setfont show Nl
103 Lpt CFs setfont ( 8 ) show ( */) IF setfont show Nl
104 Lpt CFs setfont ( ) show () IF setfont show Nl
105 Lpt CFs setfont ( 10 ) show (#define _POSIX_SOURCE) CF setfont show Nl
106 Lpt CFs setfont ( ) show () CF setfont show Nl
107 Lpt CFs setfont ( 12 ) show (#include <errno.h>) CF setfont show Nl
108 Lpt CFs setfont ( 13 ) show (#include <stdio.h>) CF setfont show Nl
109 Lpt CFs setfont ( 14 ) show (#include <stdlib.h>) CF setfont show Nl
110 Lpt CFs setfont ( 15 ) show (#include <string.h>) CF setfont show Nl
111 Lpt CFs setfont ( 16 ) show (#include <sys/types.h>) CF setfont show Nl
112 Lpt CFs setfont ( 17 ) show (#include <sys/wait.h>) CF setfont show Nl
113 Lpt CFs setfont ( ) show () CF setfont show Nl
114 Lpt CFs setfont ( 19 ) show (#ifdef _ultrix) CF setfont show Nl
115 Lpt CFs setfont ( 20 ) show (extern int close\(int fildes\);) CF setfont show Nl
116 Lpt CFs setfont ( 21 ) show (extern int dup\(int fildes\);) CF setfont show Nl
117 Lpt CFs setfont ( 22 ) show (extern pid_t fork\(void\);) CF setfont show Nl
118 Lpt CFs setfont ( 23 ) show (extern int pipe\(int fildes[2]\);) CF setfont show Nl
119 Lpt CFs setfont ( 24 ) show (#else) CF setfont show Nl
120 Lpt CFs setfont ( 25 ) show (#include <unistd.h>) CF setfont show Nl
121 Lpt CFs setfont ( 26 ) show (#endif) CF setfont show Nl
122 Lpt CFs setfont ( ) show () CF setfont show Nl
123 Lpt CFs setfont ( 28 ) show (#include "trueprint.h") CF setfont show Nl
124 Lpt CFs setfont ( 29 ) show (#include "main.h") CF setfont show Nl
125 Lpt CFs setfont ( 30 ) show (#include "openpipe.h") CF setfont show Nl
126 Lpt CFs setfont ( ) show () CF setfont show Nl
127 Lpt CFs setfont ( 32 ) show (int) CF setfont show Nl
128 Lpt CFs setfont ( 33 ) show (openpipe) BF setfont show (\(const char *command, char *mode\)) CF setfont show Nl
129 Lpt CFs setfont ( ) show () BF setfont show Nl
130 Lpt CFs setfont ( 35 1 ) show ({) CF setfont show Nl
131 Lpt CFs setfont ( 36 1 ) show ( int fildes[2];) CF setfont show Nl
132 Lpt CFs setfont ( 37 1 ) show ( int parent_pipe_end;) CF setfont show Nl
133 Lpt CFs setfont ( 38 1 ) show ( int child_pipe_end;) CF setfont show Nl
134 Lpt CFs setfont ( 39 1 ) show ( char *child_pipe_mode;) CF setfont show Nl
135 Lpt CFs setfont ( ) show () CF setfont show Nl
136 Lpt CFs setfont ( 41 2 ) show ( if \(strcmp\(mode, "w"\) == 0\) {) CF setfont show Nl
137 Lpt CFs setfont ( 42 2 ) show ( parent_pipe_end = 1; child_pipe_end = 0;) CF setfont show Nl
138 Lpt CFs setfont ( 43 2 ) show ( child_pipe_mode = "read";) CF setfont show Nl
139 Lpt CFs setfont ( 44 2 ) show ( } else if \(strcmp\(mode, "r"\) == 0\) {) CF setfont show Nl
140 Lpt CFs setfont ( 45 2 ) show ( parent_pipe_end = 0; child_pipe_end = 1;) CF setfont show Nl
141 Lpt CFs setfont ( 46 2 ) show ( child_pipe_mode = "write";) CF setfont show Nl
142 Lpt CFs setfont ( 47 2 ) show ( } else {) CF setfont show Nl
143 Lpt CFs setfont ( 48 2 ) show ( \(void\)fprintf\(stderr, "%s: Internal error: popen\() CF setfont show Nl
144 Lpt CFs setfont ( ) show ( \) called with bad mode %s", cmd_name, mode\);) CF setfont show Nl
145 Lpt CFs setfont ( 49 2 ) show ( exit\(2\);) CF setfont show Nl
146 Lpt CFs setfont ( 50 1 ) show ( }) CF setfont show Nl
147 Lpt CFs setfont ( ) show () CF setfont show Nl
148 Lpt CFs setfont ( 52 2 ) show ( if \(pipe\(fildes\) != 0\) {) CF setfont show Nl
149 Lpt CFs setfont ( 53 2 ) show ( \(void\)fprintf\(stderr, "%s: Cannot create pipe, %s\\n", cmd_name, strerror\(errno\)\);) CF setfont show Nl
150 Lpt CFs setfont ( 54 2 ) show ( exit\(2\);) CF setfont show Nl
151 Lpt CFs setfont ( 55 1 ) show ( }) CF setfont show Nl
152 Lpt CFs setfont ( ) show () CF setfont show Nl
153 Lpt CFs setfont ( 57 2 ) show ( switch \(fork\(\)\) {) CF setfont show Nl
154 Lpt CFs setfont ( 58 2 ) show ( case -1:) CF setfont show Nl
155 Lpt CFs setfont ( 59 2 ) show ( ) CF setfont show (/* Error */) IF setfont show Nl
156 Lpt CFs setfont ( 60 2 ) show ( \(void\)fprintf\(stderr, "%s: Cannot fork, %s\\n", cmd_name, strerror\(errno\)\);) CF setfont show Nl
157 Lpt CFs setfont ( 61 2 ) show ( exit\(2\);) CF setfont show Nl
158 Lpt CFs setfont ( 62 2 ) show ( ) CF setfont show (/*NOTREACHED*/) IF setfont show Nl
159 Lpt CFs setfont ( ) show () CF setfont show Nl
160 Lpt CFs setfont ( 64 2 ) show ( case 0:) CF setfont show Nl
161 Lpt CFs setfont ( 65 2 ) show ( ) CF setfont show (/* Child process */) IF setfont show Nl
165 Cp HF setfont /Ypos Ps 2 div def
167 (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 2 of 3) stringwidth pop sub dup Ypos moveto
169 exch sub 2 div add (test1.c 2) stringwidth pop 2 div sub Ypos moveto
171 /Vpos Tm Bh sub Ps sub def
172 Lpt CFs setfont ( 66 2 ) show ( if \(!\(\(close\(fildes[parent_pipe_end]\) == 0\) &&) CF setfont show Nl
173 Lpt CFs setfont ( 67 2 ) show ( \(close\(child_pipe_end\) == 0\) &&) CF setfont show Nl
174 Lpt CFs setfont ( 68 3 ) show ( \(dup\(fildes[child_pipe_end]\) == child_pipe_end\)\)\) {) CF setfont show Nl
175 Lpt CFs setfont ( 69 3 ) show ( \(void\)fprintf\() CF setfont show Nl
176 Lpt CFs setfont ( ) show ( stderr,"%s: Cannot redirect %s for child, %s\\n", cmd_name, child_pipe_mode, strerror\() CF setfont show Nl
177 Lpt CFs setfont ( ) show ( errno\)\);) CF setfont show Nl
178 Lpt CFs setfont ( 70 3 ) show ( exit\(2\);) CF setfont show Nl
179 Lpt CFs setfont ( 71 2 ) show ( }) CF setfont show Nl
180 Lpt CFs setfont ( ) show () CF setfont show Nl
181 Lpt CFs setfont ( 73 3 ) show ( if \(system\(command\) < 0\) {) CF setfont show Nl
182 Lpt CFs setfont ( 74 3 ) show ( \(void\)fprintf\(stderr,"%s: Cannot start pipe, %s\\n",cmd_name, strerror\(errno\)\);) CF setfont show Nl
183 Lpt CFs setfont ( 75 3 ) show ( exit\(2\);) CF setfont show Nl
184 Lpt CFs setfont ( 76 2 ) show ( } else exit\(0\);) CF setfont show Nl
185 Lpt CFs setfont ( 77 2 ) show ( ) CF setfont show (/*NOTREACHED*/) IF setfont show Nl
186 Lpt CFs setfont ( ) show () CF setfont show Nl
187 Lpt CFs setfont ( 79 2 ) show ( default:) CF setfont show Nl
188 Lpt CFs setfont ( 80 2 ) show ( ) CF setfont show (/* Parent process */) IF setfont show Nl
189 Lpt CFs setfont ( ) show () CF setfont show Nl
190 Lpt CFs setfont ( 82 3 ) show ( if \(close\(fildes[child_pipe_end]\) != 0\) {) CF setfont show Nl
191 Lpt CFs setfont ( 83 3 ) show ( \(void\)fprintf\() CF setfont show Nl
192 Lpt CFs setfont ( ) show ( stderr,"%s: Cannot close %s end of pipe for parent, %s\\n",cmd_name, child_pipe_mode,) CF setfont show Nl
193 Lpt CFs setfont ( ) show ( strerror\(errno\)\);) CF setfont show Nl
194 Lpt CFs setfont ( 84 3 ) show ( exit\(2\);) CF setfont show Nl
195 Lpt CFs setfont ( 85 2 ) show ( }) CF setfont show Nl
196 Lpt CFs setfont ( ) show () CF setfont show Nl
197 Lpt CFs setfont ( 87 2 ) show ( return fildes[parent_pipe_end];) CF setfont show Nl
198 Lpt CFs setfont ( 88 1 ) show ( }) CF setfont show Nl
199 Lpt CFs setfont ( 89 ) show (}) CF setfont show Nl
200 Lpt CFs setfont ( ) show () CF setfont show Nl
201 Lpt CFs setfont ( 91 ) show (FILE *) CF setfont show Nl
202 Lpt CFs setfont ( 92 ) show (fopenpipe) BF setfont show (\(const char *command, char *mode\)) CF setfont show Nl
203 Lpt CFs setfont ( ) show () BF setfont show Nl
204 Lpt CFs setfont ( 94 1 ) show ({) CF setfont show Nl
205 Lpt CFs setfont ( 95 1 ) show ( int handle;) CF setfont show Nl
206 Lpt CFs setfont ( ) show () CF setfont show Nl
207 Lpt CFs setfont ( 97 1 ) show ( handle = openpipe\(command, mode\);) CF setfont show Nl
208 Lpt CFs setfont ( ) show () CF setfont show Nl
209 Lpt CFs setfont ( 99 1 ) show ( return fdopen\(handle, mode\);) CF setfont show Nl
210 Lpt CFs setfont ( 100 ) show (}) CF setfont show Nl
211 Lpt CFs setfont ( ) show () CF setfont show Nl
212 Lpt CFs setfont ( 102 ) show (void) CF setfont show Nl
213 Lpt CFs setfont ( 103 ) show (closepipe) BF setfont show (\(int handle\)) CF setfont show Nl
214 Lpt CFs setfont ( ) show () BF setfont show Nl
215 Lpt CFs setfont ( 105 1 ) show ({) CF setfont show Nl
216 Lpt CFs setfont ( 106 1 ) show ( int statloc;) CF setfont show Nl
217 Lpt CFs setfont ( ) show () CF setfont show Nl
218 Lpt CFs setfont ( 108 1 ) show ( \(void\)close\(handle\);) CF setfont show Nl
219 Lpt CFs setfont ( 109 1 ) show ( \(void\)waitpid\(-1, &statloc, WNOHANG\);) CF setfont show Nl
220 Lpt CFs setfont ( 110 ) show (}) CF setfont show Nl
221 Lpt CFs setfont ( ) show () CF setfont show Nl
222 Lpt CFs setfont ( 112 ) show (void) CF setfont show Nl
223 Lpt CFs setfont ( 113 ) show (fclosepipe) BF setfont show (\(FILE *fp\)) CF setfont show Nl
224 Lpt CFs setfont ( ) show () BF setfont show Nl
225 Lpt CFs setfont ( 115 1 ) show ({) CF setfont show Nl
226 Lpt CFs setfont ( 116 1 ) show ( closepipe\(fileno\(fp\)\);) CF setfont show Nl
227 Lpt CFs setfont ( 117 ) show (}) CF setfont show Nl
231 Cp HF setfont /Ypos Ps 2 div def
233 (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 3 of 3) stringwidth pop sub dup Ypos moveto
235 exch sub 2 div add (test2.c 1) stringwidth pop 2 div sub Ypos moveto
237 /Vpos Tm Bh sub Ps sub def
238 Lpt CFs setfont ( 1 ) show (/* @\(#\)getopt.c */) IF setfont show Nl
239 Lpt CFs setfont ( ) show () IF setfont show Nl
240 Lpt CFs setfont ( 3 ) show (#define _POSIX_SOURCE) CF setfont show Nl
241 Lpt CFs setfont ( ) show () CF setfont show Nl
242 Lpt CFs setfont ( 5 ) show (#include <stdio.h>) CF setfont show Nl
243 Lpt CFs setfont ( 6 ) show (#include <string.h>) CF setfont show Nl
244 Lpt CFs setfont ( ) show () CF setfont show Nl
245 Lpt CFs setfont ( 8 ) show (#include "trueprint.h") CF setfont show Nl
246 Lpt CFs setfont ( 9 ) show (#include "main.h") CF setfont show Nl
247 Lpt CFs setfont ( ) show () CF setfont show Nl
248 Lpt CFs setfont ( 11 ) show (/*) IF setfont show Nl
249 Lpt CFs setfont ( 12 ) show ( * get option letter from argument vector) IF setfont show Nl
250 Lpt CFs setfont ( 13 ) show ( */) IF setfont show Nl
251 Lpt CFs setfont ( 14 ) show (int optind = 1; ) CF setfont show (/* index into parent argv vector */) IF setfont show Nl
252 Lpt CFs setfont ( 15 ) show (char *optarg; ) CF setfont show (/* argument associated with option */) IF setfont show Nl
253 Lpt CFs setfont ( ) show () CF setfont show Nl
254 Lpt CFs setfont ( 17 ) show (static int optopt; ) CF setfont show (/* character checked for validity */) IF setfont show Nl
255 Lpt CFs setfont ( ) show () CF setfont show Nl
256 Lpt CFs setfont ( 19 ) show (int) CF setfont show Nl
257 Lpt CFs setfont ( 20 ) show (getopt) BF setfont show (\(int nargc, char **nargv, char *ostr\)) CF setfont show Nl
258 Lpt CFs setfont ( 21 1 ) show ({) CF setfont show Nl
259 Lpt CFs setfont ( 22 1 ) show ( register char *oli; ) CF setfont show (/* option letter list index */) IF setfont show Nl
260 Lpt CFs setfont ( 23 1 ) show ( static char *place = ""; ) CF setfont show (/* option letter processing */) IF setfont show Nl
261 Lpt CFs setfont ( ) show () CF setfont show Nl
262 Lpt CFs setfont ( 25 2 ) show ( if\(!*place\) { ) CF setfont show (/* update scanning pointer */) IF setfont show Nl
263 Lpt CFs setfont ( 26 3 ) show ( if\(optind >= nargc || *\(place = nargv[optind]\) != '-' || !*++place\) {) CF setfont show Nl
264 Lpt CFs setfont ( 27 3 ) show ( place = "";) CF setfont show Nl
265 Lpt CFs setfont ( 28 3 ) show ( return\(EOF\);) CF setfont show Nl
266 Lpt CFs setfont ( 29 2 ) show ( }) CF setfont show Nl
267 Lpt CFs setfont ( 30 3 ) show ( if \(*place == '-'\) { ) CF setfont show (/* found "--" */) IF setfont show Nl
268 Lpt CFs setfont ( 31 3 ) show ( ++optind;) CF setfont show Nl
269 Lpt CFs setfont ( 32 3 ) show ( place = "";) CF setfont show Nl
270 Lpt CFs setfont ( 33 3 ) show ( return EOF;) CF setfont show Nl
271 Lpt CFs setfont ( 34 2 ) show ( }) CF setfont show Nl
272 Lpt CFs setfont ( 35 1 ) show ( } ) CF setfont show (/* option letter okay? */) IF setfont show Nl
273 Lpt CFs setfont ( 36 2 ) show ( if \(\(optopt = \(int\)*place++\) == \(int\)':' || !\(oli = strchr\(ostr,optopt\)\)\) {) CF setfont show Nl
274 Lpt CFs setfont ( 37 2 ) show ( if\(!*place\) ++optind;) CF setfont show Nl
275 Lpt CFs setfont ( 38 2 ) show ( \(void\)fprintf\(stderr, "%s: illegal option -- %c\\n", cmd_name, optopt\);) CF setfont show Nl
276 Lpt CFs setfont ( 39 2 ) show ( return '?';) CF setfont show Nl
277 Lpt CFs setfont ( 40 1 ) show ( }) CF setfont show Nl
278 Lpt CFs setfont ( 41 2 ) show ( if \(*++oli != ':'\) { ) CF setfont show (/* don't need argument */) IF setfont show Nl
279 Lpt CFs setfont ( 42 2 ) show ( optarg = NULL;) CF setfont show Nl
280 Lpt CFs setfont ( 43 2 ) show ( if \(!*place\) ++optind;) CF setfont show Nl
281 Lpt CFs setfont ( 44 2 ) show ( } else { ) CF setfont show (/* need an argument */) IF setfont show Nl
282 Lpt CFs setfont ( 45 3 ) show ( if \(*place\) { ) CF setfont show (/* no white space */) IF setfont show Nl
283 Lpt CFs setfont ( 46 3 ) show ( optarg = place;) CF setfont show Nl
284 Lpt CFs setfont ( 47 3 ) show ( } else if \(nargc <= ++optind\) { ) CF setfont show (/* no arg */) IF setfont show Nl
285 Lpt CFs setfont ( 48 3 ) show ( place = "";) CF setfont show Nl
286 Lpt CFs setfont ( 49 3 ) show ( \(void\)fprintf\() CF setfont show Nl
287 Lpt CFs setfont ( ) show ( stderr, "%s: option requires an argument -- %c\\n", cmd_name, optopt\);) CF setfont show Nl
288 Lpt CFs setfont ( 50 3 ) show ( optopt = '?';) CF setfont show Nl
289 Lpt CFs setfont ( 51 3 ) show ( } else {) CF setfont show Nl
290 Lpt CFs setfont ( 52 3 ) show ( optarg = nargv[optind]; ) CF setfont show (/* white space */) IF setfont show Nl
291 Lpt CFs setfont ( 53 2 ) show ( }) CF setfont show Nl
292 Lpt CFs setfont ( 54 2 ) show ( place = "";) CF setfont show Nl
293 Lpt CFs setfont ( 55 2 ) show ( ++optind;) CF setfont show Nl
294 Lpt CFs setfont ( 56 1 ) show ( }) CF setfont show Nl
295 Lpt CFs setfont ( 57 1 ) show ( return optopt; ) CF setfont show (/* dump back option letter */) IF setfont show Nl
296 Lpt CFs setfont ( 58 ) show (}) CF setfont show Nl