--- ray/src/meta/tcurve.c 2003/02/22 02:07:26 1.1 +++ ray/src/meta/tcurve.c 2003/11/15 02:13:37 1.5 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: tcurve.c,v 1.1 2003/02/22 02:07:26 greg Exp $"; +static const char RCSid[] = "$Id: tcurve.c,v 1.5 2003/11/15 02:13:37 schorsch Exp $"; #endif /* * PROGRAM TO PLOT TEL-A-GRAF CURVES TO METAFILE @@ -10,7 +10,9 @@ static const char RCSid[] = "$Id: tcurve.c,v 1.1 2003/ * cc -o ../tcurve tcurve.c tgraph.o primout.o mfio.o syscalls.o misc.o -lm */ +#include "rtprocess.h" /* getpid() */ #include "tgraph.h" +#include "plot.h" #define XLEGEND (XBEG+XSIZ+4*TSIZ) /* x start of legend */ @@ -49,14 +51,14 @@ int symrad = SYMRAD; /* symbol radius */ char *progname; +static void limline(int a0, double x,double y,double xout,double yout, char *s); - -main(argc, argv) - -int argc; -char **argv; - +int +main( + int argc, + char **argv +) /* * Take Tel-A-Graf runnable files and convert them to * metafile primitives to send to standard output @@ -67,10 +69,6 @@ char **argv; FILE *fp; int axflag; -#ifdef CPM - fixargs("tcurve", &argc, &argv); -#endif - progname = *argv++; argc--; @@ -123,18 +121,16 @@ char **argv; - - -plot(fp) /* read file and generate plot */ - -FILE *fp; - +void +plot( /* read file and generate plot */ + FILE *fp +) { int ncur = 0; /* curves seen so far */ int cur = 0; /* current curve pattern */ char line[255], *s; double x, y; - double lastx, lasty; + double lastx = 0, lasty = 0; short oobounds = FALSE, firstpoint = TRUE; xlegend = XLEGEND; @@ -215,14 +211,15 @@ FILE *fp; - - -limline(a0, x, y, xout, yout, s) /* print line from/to out of bounds */ - -int a0; -double x, y, xout, yout; -char *s; - +void +limline( /* print line from/to out of bounds */ + int a0, + double x, + double y, + double xout, + double yout, + char *s +) { for ( ; ; )