--- ray/src/meta/gcomp.c 2003/02/22 02:07:26 1.1 +++ ray/src/meta/gcomp.c 2003/11/15 02:13:37 1.3 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: gcomp.c,v 1.1 2003/02/22 02:07:26 greg Exp $"; +static const char RCSid[] = "$Id: gcomp.c,v 1.3 2003/11/15 02:13:37 schorsch Exp $"; #endif /* * gcomp.c - program to calculate things from graph files. @@ -9,8 +9,13 @@ static const char RCSid[] = "$Id: gcomp.c,v 1.1 2003/0 * Greg Ward Larson */ +#include #include +#include "rterror.h" +#include "meta.h" +#include "mgvars.h" + #define istyp(s) (s[0] == '-') #define isvar(s) (s[0] == '+') @@ -19,39 +24,23 @@ 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("gcomp", &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++] = MDIR; libpath[i] = NULL; -#endif for (file0 = 1; file0 < argc; ) if (istyp(argv[file0])) @@ -68,13 +57,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 +) { char types[16], stmp[256], *strcat(); int i; @@ -97,15 +89,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); }