39 |
|
#define XCOM "pexpand +vOCIsp %s | psort -Y +x" |
40 |
|
|
41 |
|
|
42 |
< |
|
43 |
< |
|
42 |
> |
#include "rtprocess.h" |
43 |
|
#include "meta.h" |
45 |
– |
|
44 |
|
#include "plot.h" |
47 |
– |
|
45 |
|
#include "span.h" |
46 |
|
|
47 |
|
|
51 |
– |
|
52 |
– |
|
48 |
|
char *progname; |
49 |
|
|
50 |
|
struct span outspan; |
84 |
|
conditioned = FALSE; |
85 |
|
|
86 |
|
|
87 |
< |
main(argc, argv) |
88 |
< |
|
89 |
< |
int argc; |
90 |
< |
char **argv; |
91 |
< |
|
87 |
> |
int |
88 |
> |
main( |
89 |
> |
int argc, |
90 |
> |
char **argv |
91 |
> |
) |
92 |
|
{ |
93 |
|
FILE *fp; |
99 |
– |
#ifdef UNIX |
100 |
– |
FILE *popen(); |
101 |
– |
#endif |
94 |
|
char comargs[200], command[300]; |
95 |
|
|
104 |
– |
#ifdef CPM |
105 |
– |
fixargs("mt160", &argc, &argv); |
106 |
– |
#endif |
107 |
– |
|
96 |
|
progname = *argv++; |
97 |
|
argc--; |
98 |
|
|
99 |
|
condonly = FALSE; |
112 |
– |
#ifdef CPM |
113 |
– |
conditioned = TRUE; |
114 |
– |
#else |
100 |
|
conditioned = FALSE; |
116 |
– |
#endif |
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 |
< |
thispage() /* rewind and initialize current page */ |
185 |
< |
|
160 |
> |
void |
161 |
> |
thispage(void) /* rewind and initialize current page */ |
162 |
|
{ |
187 |
– |
|
163 |
|
if (lineno) |
164 |
|
error(USER, "cannot restart page in thispage"); |
190 |
– |
|
165 |
|
} |
166 |
|
|
167 |
|
|
168 |
< |
|
169 |
< |
|
196 |
< |
nextpage() /* advance to next page */ |
197 |
< |
|
168 |
> |
void |
169 |
> |
nextpage(void) /* advance to next page */ |
170 |
|
{ |
199 |
– |
|
171 |
|
fputs("\f\r", stdout); |
172 |
|
|
173 |
|
lineno = 0; |
203 |
– |
|
174 |
|
} |
175 |
|
|
176 |
|
|
177 |
< |
|
178 |
< |
contpage() /* continue new plot on current page */ |
209 |
< |
|
177 |
> |
void |
178 |
> |
contpage(void) /* continue new plot on current page */ |
179 |
|
{ |
211 |
– |
|
180 |
|
while (lineno++ < NLINES) |
181 |
|
putc('\n', stdout); |
182 |
|
|
183 |
|
lineno = 0; |
216 |
– |
|
184 |
|
} |
185 |
|
|
186 |
|
|
187 |
< |
|
188 |
< |
printspan() /* output span to printer */ |
222 |
< |
|
187 |
> |
void |
188 |
> |
printspan(void) /* output span to printer */ |
189 |
|
{ |
190 |
< |
register i; |
190 |
> |
register int i; |
191 |
|
|
192 |
|
if (spanmin <= spanmax) { |
193 |
|
|
210 |
|
|
211 |
|
putc('\n', stdout); |
212 |
|
lineno++; |
247 |
– |
|
213 |
|
} |
214 |
|
|
215 |
|
|
216 |
< |
|
217 |
< |
|
218 |
< |
|
219 |
< |
|
255 |
< |
|
256 |
< |
printstr(p) /* output a string to the printer */ |
257 |
< |
|
258 |
< |
PRIMITIVE *p; |
259 |
< |
|
216 |
> |
void |
217 |
> |
printstr( /* output a string to the printer */ |
218 |
> |
PRIMITIVE *p |
219 |
> |
) |
220 |
|
{ |
221 |
|
int i; |
222 |
|
|