37 |
|
#define XCOM "pexpand +vOCIsp %s | psort -Y +x" |
38 |
|
|
39 |
|
|
40 |
< |
|
41 |
< |
|
40 |
> |
#include "rtprocess.h" |
41 |
|
#include "meta.h" |
43 |
– |
|
42 |
|
#include "plot.h" |
45 |
– |
|
43 |
|
#include "span.h" |
44 |
|
|
45 |
|
|
49 |
– |
|
50 |
– |
|
46 |
|
char *progname; |
47 |
|
|
48 |
|
struct span outspan; |
82 |
|
conditioned = FALSE; |
83 |
|
|
84 |
|
|
85 |
< |
main(argc, argv) |
86 |
< |
|
87 |
< |
int argc; |
88 |
< |
char **argv; |
89 |
< |
|
85 |
> |
int |
86 |
> |
main( |
87 |
> |
int argc, |
88 |
> |
char **argv |
89 |
> |
) |
90 |
|
{ |
91 |
|
FILE *fp; |
97 |
– |
#ifdef UNIX |
98 |
– |
FILE *popen(); |
99 |
– |
#endif |
92 |
|
char comargs[200], command[300]; |
93 |
|
|
102 |
– |
#ifdef CPM |
103 |
– |
fixargs("okimate", &argc, &argv); |
104 |
– |
#endif |
105 |
– |
|
94 |
|
progname = *argv++; |
95 |
|
argc--; |
96 |
|
|
97 |
|
condonly = FALSE; |
110 |
– |
#ifdef CPM |
111 |
– |
conditioned = TRUE; |
112 |
– |
#else |
98 |
|
conditioned = FALSE; |
114 |
– |
#endif |
99 |
|
|
100 |
|
minwidth = 1; /* so lines aren't invisible */ |
101 |
|
|
102 |
|
while (argc && **argv == '-') { |
103 |
|
switch (*(*argv+1)) { |
120 |
– |
#ifdef UNIX |
104 |
|
case 'c': |
105 |
|
condonly = TRUE; |
106 |
|
break; |
107 |
|
case 'r': |
108 |
|
conditioned = TRUE; |
109 |
|
break; |
127 |
– |
#endif |
110 |
|
default: |
111 |
|
error(WARNING, "unknown option"); |
112 |
|
break; |
139 |
|
argc--; |
140 |
|
} |
141 |
|
sprintf(command, XCOM, comargs); |
160 |
– |
#ifdef UNIX |
142 |
|
if (condonly) |
143 |
|
return(system(command)); |
144 |
|
else { |
151 |
|
nextpage(); |
152 |
|
fputs(PUNINIT, stdout); |
153 |
|
} |
173 |
– |
#endif |
154 |
|
} |
155 |
|
|
156 |
|
return(0); |
157 |
|
} |
158 |
|
|
159 |
|
|
160 |
< |
|
161 |
< |
|
182 |
< |
|
183 |
< |
|
184 |
< |
|
185 |
< |
thispage() /* rewind and initialize current page */ |
186 |
< |
|
160 |
> |
void |
161 |
> |
thispage(void) /* rewind and initialize current page */ |
162 |
|
{ |
188 |
– |
|
163 |
|
if (lineno) |
164 |
|
error(USER, "cannot restart page in thispage"); |
191 |
– |
|
165 |
|
} |
166 |
|
|
167 |
|
|
168 |
< |
|
169 |
< |
|
197 |
< |
nextpage() /* advance to next page */ |
198 |
< |
|
168 |
> |
void |
169 |
> |
nextpage(void) /* advance to next page */ |
170 |
|
{ |
200 |
– |
|
171 |
|
fputs("\r\f", stdout); |
172 |
|
|
173 |
|
lineno = 0; |
204 |
– |
|
174 |
|
} |
175 |
|
|
176 |
|
|
177 |
< |
|
178 |
< |
|
210 |
< |
contpage() /* continue new plot on current page */ |
211 |
< |
|
177 |
> |
void |
178 |
> |
contpage(void) /* continue new plot on current page */ |
179 |
|
{ |
213 |
– |
|
180 |
|
while (lineno++ < NLINES) |
181 |
|
putc('\n', stdout); |
182 |
|
|
183 |
|
lineno = 0; |
218 |
– |
|
184 |
|
} |
185 |
|
|
186 |
|
|
187 |
< |
|
188 |
< |
printspan() /* output span to printer */ |
224 |
< |
|
187 |
> |
void |
188 |
> |
printspan(void) /* output span to printer */ |
189 |
|
{ |
190 |
|
register int i,j; |
191 |
|
|
209 |
|
} |
210 |
|
fputs("\r\n", stdout); |
211 |
|
lineno++; |
248 |
– |
|
212 |
|
} |
213 |
|
|
214 |
|
|
215 |
< |
|
216 |
< |
|
217 |
< |
|
218 |
< |
printstr(p) /* output a string to the printer */ |
256 |
< |
|
257 |
< |
PRIMITIVE *p; |
258 |
< |
|
215 |
> |
void |
216 |
> |
printstr( /* output a string to the printer */ |
217 |
> |
PRIMITIVE *p |
218 |
> |
) |
219 |
|
{ |
220 |
|
int i; |
221 |
|
|