9 |
|
*/ |
10 |
|
|
11 |
|
|
12 |
+ |
#include "rtprocess.h" |
13 |
|
#include "meta.h" |
13 |
– |
|
14 |
|
#include "imPcodes.h" |
15 |
– |
|
15 |
|
#include "imPfuncs.h" |
16 |
+ |
#include "plot.h" |
17 |
|
|
18 |
|
|
19 |
|
#define XCOM "pexpand +OCIsv -P %s" |
25 |
|
|
26 |
|
static short newpage = TRUE; |
27 |
|
|
28 |
+ |
static void doprim(register PRIMITIVE *p); |
29 |
+ |
static void doglobal(register PRIMITIVE *g); |
30 |
|
|
31 |
|
|
30 |
– |
main(argc, argv) |
32 |
|
|
33 |
< |
int argc; |
34 |
< |
char **argv; |
33 |
> |
int |
34 |
> |
main( |
35 |
> |
int argc, |
36 |
> |
char **argv |
37 |
> |
) |
38 |
|
|
39 |
|
{ |
40 |
|
FILE *fp; |
37 |
– |
#ifdef UNIX |
38 |
– |
FILE *popen(); |
39 |
– |
#endif |
41 |
|
short condonly, conditioned; |
42 |
|
char comargs[200], command[300]; |
43 |
|
|
43 |
– |
#ifdef CPM |
44 |
– |
fixargs("impress", &argc, &argv); |
45 |
– |
#endif |
46 |
– |
|
44 |
|
progname = *argv++; |
45 |
|
argc--; |
46 |
|
|
47 |
|
condonly = FALSE; |
51 |
– |
#ifdef UNIX |
48 |
|
conditioned = FALSE; |
53 |
– |
#else |
54 |
– |
conditioned = TRUE; |
55 |
– |
#endif |
49 |
|
|
50 |
|
while (argc && **argv == '-') { |
51 |
|
switch (*(*argv+1)) { |
59 |
– |
#ifdef UNIX |
52 |
|
case 'c': |
53 |
|
condonly = TRUE; |
54 |
|
break; |
55 |
|
case 'r': |
56 |
|
conditioned = TRUE; |
57 |
|
break; |
66 |
– |
#endif |
58 |
|
default: |
59 |
|
error(WARNING, "unknown option"); |
60 |
|
break; |
85 |
|
argc--; |
86 |
|
} |
87 |
|
sprintf(command, XCOM, comargs); |
97 |
– |
#ifdef UNIX |
88 |
|
if (condonly) |
89 |
|
return(system(command)); |
90 |
|
else { |
93 |
|
plot(fp); |
94 |
|
pclose(fp); |
95 |
|
} |
106 |
– |
#endif |
96 |
|
} |
97 |
|
|
98 |
|
if (!newpage) |
103 |
|
} |
104 |
|
|
105 |
|
|
106 |
+ |
void |
107 |
+ |
plot( /* plot meta-file */ |
108 |
+ |
register FILE *infp |
109 |
+ |
) |
110 |
|
|
118 |
– |
plot(infp) /* plot meta-file */ |
119 |
– |
|
120 |
– |
register FILE *infp; |
121 |
– |
|
111 |
|
{ |
112 |
|
PRIMITIVE nextp; |
113 |
|
|
126 |
|
|
127 |
|
|
128 |
|
|
129 |
+ |
void |
130 |
+ |
doglobal( /* execute a global command */ |
131 |
+ |
register PRIMITIVE *g |
132 |
+ |
) |
133 |
|
|
141 |
– |
|
142 |
– |
|
143 |
– |
doglobal(g) /* execute a global command */ |
144 |
– |
|
145 |
– |
register PRIMITIVE *g; |
146 |
– |
|
134 |
|
{ |
148 |
– |
char c; |
149 |
– |
|
135 |
|
switch (g->com) { |
136 |
|
|
137 |
|
case PEOF: |
169 |
|
|
170 |
|
|
171 |
|
|
172 |
< |
|
173 |
< |
doprim(p) /* plot primitive */ |
174 |
< |
|
175 |
< |
register PRIMITIVE *p; |
172 |
> |
void |
173 |
> |
doprim( /* plot primitive */ |
174 |
> |
register PRIMITIVE *p |
175 |
> |
) |
176 |
|
|
177 |
|
{ |
178 |
|
|