--- ray/src/meta/dgraph.c 2003/02/22 02:07:26 1.1 +++ ray/src/meta/dgraph.c 2003/11/15 02:13:36 1.3 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: dgraph.c,v 1.1 2003/02/22 02:07:26 greg Exp $"; +static const char RCSid[] = "$Id: dgraph.c,v 1.3 2003/11/15 02:13:36 schorsch Exp $"; #endif /* * dgraph.c - program to send plots to dumb terminal. @@ -9,8 +9,12 @@ static const char RCSid[] = "$Id: dgraph.c,v 1.1 2003/ * Greg Ward Larson */ +#include #include +#include "rterror.h" +#include "mgvars.h" +#include "meta.h" #define isopt(s) (s[0] == '+' || s[0] == '-') @@ -18,39 +22,24 @@ char *progname; char *libpath[4]; +static void dofile(int optc, char *optv[], char *file); -main(argc, argv) -int argc; -char *argv[]; + +int +main( + int argc, + char *argv[] +) { -#if UNIX || MAC char *getenv(); -#endif int i, file0; -#ifdef CPM - fixargs("dgraph", &argc, &argv); progname = argv[0]; - libpath[0] = ""; - libpath[1] = "0/"; - libpath[2] = NULL; -#endif -#ifdef MAC - progname = argv[0]; libpath[0] = "./"; if ((libpath[i=1] = getenv("MDIR")) != NULL) i++; - libpath[i++] = "/meta/"; - libpath[i] = NULL; -#endif -#ifdef UNIX - progname = argv[0]; - libpath[0] = "./"; - if ((libpath[i=1] = getenv("MDIR")) != NULL) - i++; libpath[i++] = "/usr/local/lib/meta/"; libpath[i] = NULL; -#endif for (file0 = 1; file0 < argc-1; file0 += 2) if (!isopt(argv[file0])) @@ -63,13 +52,16 @@ char *argv[]; dofile(file0-1, argv+1, argv[i]); quit(0); + return 0; /* pro forma return */ } -dofile(optc, optv, file) /* plot a file */ -int optc; -char *optv[]; -char *file; +void +dofile( /* plot a file */ + int optc, + char *optv[], + char *file +) { int width = 79; int length = 21; @@ -103,15 +95,19 @@ char *file; } -eputs(msg) /* print error message */ -char *msg; +void +eputs( /* print error message */ + char *msg +) { fputs(msg, stderr); } -quit(code) /* quit program */ -int code; +void +quit( /* quit program */ + int code +) { exit(code); }