12 |
|
|
13 |
|
#include "rtprocess.h" /* getpid() */ |
14 |
|
#include "tgraph.h" |
15 |
+ |
#include "plot.h" |
16 |
|
|
17 |
|
|
18 |
|
#define XLEGEND (XBEG+XSIZ+4*TSIZ) /* x start of legend */ |
48 |
|
|
49 |
|
char *progname; |
50 |
|
|
51 |
+ |
static void barout(int cn, double x, double y); |
52 |
+ |
static void boxout(int a0, int xmn, int ymn, int xmx, int ymx); |
53 |
|
|
54 |
|
|
55 |
< |
|
56 |
< |
|
57 |
< |
main(argc, argv) |
58 |
< |
|
59 |
< |
int argc; |
57 |
< |
char **argv; |
58 |
< |
|
55 |
> |
int |
56 |
> |
main( |
57 |
> |
int argc, |
58 |
> |
char **argv |
59 |
> |
) |
60 |
|
/* |
61 |
|
* Take Tel-A-Graf runnable files and convert them to |
62 |
|
* metafile primitives to send to standard output |
63 |
|
*/ |
63 |
– |
|
64 |
|
{ |
65 |
|
char tfname[MAXFNAME]; |
66 |
|
FILE *fp; |
67 |
|
int axflag; |
68 |
|
|
69 |
– |
#ifdef CPM |
70 |
– |
fixargs("tbar", &argc, &argv); |
71 |
– |
#endif |
72 |
– |
|
69 |
|
progname = *argv++; |
70 |
|
argc--; |
71 |
|
|
120 |
|
|
121 |
|
|
122 |
|
|
123 |
< |
|
124 |
< |
|
125 |
< |
plot(fp) /* read file and generate plot */ |
126 |
< |
|
131 |
< |
FILE *fp; |
132 |
< |
|
123 |
> |
void |
124 |
> |
plot( /* read file and generate plot */ |
125 |
> |
FILE *fp |
126 |
> |
) |
127 |
|
{ |
128 |
|
int ncur = 0; /* curves seen so far */ |
129 |
|
char line[255], *s; |
186 |
|
} |
187 |
|
|
188 |
|
|
189 |
< |
|
190 |
< |
barout(cn, x, y) /* output bar for curve cn, value (x,y) */ |
191 |
< |
|
192 |
< |
int cn; |
193 |
< |
double x, y; |
194 |
< |
|
189 |
> |
void |
190 |
> |
barout( /* output bar for curve cn, value (x,y) */ |
191 |
> |
int cn, |
192 |
> |
double x, |
193 |
> |
double y |
194 |
> |
) |
195 |
|
{ |
196 |
|
int barleft, barwidth; |
197 |
|
int barlower, barheight; |
211 |
|
} |
212 |
|
boxout(curtype[cn], barleft, barlower, |
213 |
|
barleft+barwidth, barlower+barheight); |
220 |
– |
|
214 |
|
} |
215 |
|
|
216 |
|
|
217 |
< |
|
218 |
< |
boxout(a0, xmn, ymn, xmx, ymx) /* output a box */ |
219 |
< |
|
220 |
< |
int a0; |
221 |
< |
int xmn, ymn, xmx, ymx; |
222 |
< |
|
217 |
> |
void |
218 |
> |
boxout( /* output a box */ |
219 |
> |
int a0, |
220 |
> |
int xmn, |
221 |
> |
int ymn, |
222 |
> |
int xmx, |
223 |
> |
int ymx |
224 |
> |
) |
225 |
|
{ |
231 |
– |
|
226 |
|
pprim(PRFILL, a0, xmn, ymn, xmx, ymx, NULL); |
227 |
|
plseg(0, xmn, ymn, xmx, ymn); |
228 |
|
plseg(0, xmn, ymn, xmn, ymx); |
229 |
|
plseg(0, xmn, ymx, xmx, ymx); |
230 |
|
plseg(0, xmx, ymn, xmx, ymx); |
237 |
– |
|
231 |
|
} |
232 |
+ |
|