| 12 |
|
|
| 13 |
|
#include "rtprocess.h" /* getpid() */ |
| 14 |
|
#include "tgraph.h" |
| 15 |
+ |
#include "plot.h" |
| 16 |
|
|
| 17 |
|
#define XLEGEND (XBEG+XSIZ+4*TSIZ) /* x start of legend */ |
| 18 |
|
|
| 51 |
|
char *progname; |
| 52 |
|
|
| 53 |
|
|
| 54 |
+ |
static void limline(int a0, double x,double y,double xout,double yout, char *s); |
| 55 |
|
|
| 56 |
|
|
| 57 |
< |
|
| 58 |
< |
main(argc, argv) |
| 59 |
< |
|
| 60 |
< |
int argc; |
| 61 |
< |
char **argv; |
| 60 |
< |
|
| 57 |
> |
int |
| 58 |
> |
main( |
| 59 |
> |
int argc, |
| 60 |
> |
char **argv |
| 61 |
> |
) |
| 62 |
|
/* |
| 63 |
|
* Take Tel-A-Graf runnable files and convert them to |
| 64 |
|
* metafile primitives to send to standard output |
| 121 |
|
|
| 122 |
|
|
| 123 |
|
|
| 124 |
< |
|
| 125 |
< |
|
| 126 |
< |
plot(fp) /* read file and generate plot */ |
| 127 |
< |
|
| 127 |
< |
FILE *fp; |
| 128 |
< |
|
| 124 |
> |
void |
| 125 |
> |
plot( /* read file and generate plot */ |
| 126 |
> |
FILE *fp |
| 127 |
> |
) |
| 128 |
|
{ |
| 129 |
|
int ncur = 0; /* curves seen so far */ |
| 130 |
|
int cur = 0; /* current curve pattern */ |
| 131 |
|
char line[255], *s; |
| 132 |
|
double x, y; |
| 133 |
< |
double lastx, lasty; |
| 133 |
> |
double lastx = 0, lasty = 0; |
| 134 |
|
short oobounds = FALSE, firstpoint = TRUE; |
| 135 |
|
|
| 136 |
|
xlegend = XLEGEND; |
| 211 |
|
|
| 212 |
|
|
| 213 |
|
|
| 214 |
< |
|
| 215 |
< |
|
| 216 |
< |
limline(a0, x, y, xout, yout, s) /* print line from/to out of bounds */ |
| 217 |
< |
|
| 218 |
< |
int a0; |
| 219 |
< |
double x, y, xout, yout; |
| 220 |
< |
char *s; |
| 221 |
< |
|
| 214 |
> |
void |
| 215 |
> |
limline( /* print line from/to out of bounds */ |
| 216 |
> |
int a0, |
| 217 |
> |
double x, |
| 218 |
> |
double y, |
| 219 |
> |
double xout, |
| 220 |
> |
double yout, |
| 221 |
> |
char *s |
| 222 |
> |
) |
| 223 |
|
{ |
| 224 |
|
|
| 225 |
|
for ( ; ; ) |