--- ray/src/gen/genrev.c 2003/08/04 22:37:53 2.6 +++ ray/src/gen/genrev.c 2004/08/21 11:54:06 2.8 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: genrev.c,v 2.6 2003/08/04 22:37:53 greg Exp $"; +static const char RCSid[] = "$Id: genrev.c,v 2.8 2004/08/21 11:54:06 greg Exp $"; #endif /* * genrev.c - program to generate functions of rotation about z @@ -15,6 +15,10 @@ static const char RCSid[] = "$Id: genrev.c,v 2.6 2003/ #include #include #include + +#include "rterror.h" +#include "resolu.h" +#include "rterror.h" #include "calcomp.h" #define ZNAME "Z`SYS`" /* z function name */ @@ -29,9 +33,8 @@ static const char RCSid[] = "$Id: genrev.c,v 2.6 2003/ #define UP 04 #define DOWN 010 -void quit(), eputs(), wputs(); - +void computen(nzp, nrp, z0, r0, z1, r1) /* compute normal */ double *nzp, *nrp, z0, r0, z1, r1; { @@ -45,43 +48,6 @@ double *nzp, *nrp, z0, r0, z1, r1; } -void -eputs(msg) -char *msg; -{ - fputs(msg, stderr); -} - - -void -wputs(msg) -char *msg; -{ - eputs(msg); -} - - -void -quit(code) -int code; -{ - exit(code); -} - - -printhead(ac, av) /* print command header */ -register int ac; -register char **av; -{ - putchar('#'); - while (ac--) { - putchar(' '); - fputs(*av++, stdout); - } - putchar('\n'); -} - - double l_hermite(char *nm) { @@ -121,6 +87,7 @@ l_bspline(char *nm) } +int main(argc, argv) int argc; char *argv[]; @@ -160,7 +127,8 @@ char *argv[]; goto userror; modname = smooth ? "Phong" : argv[1]; - printhead(argc, argv); + fputs("# ", stdout); + printargs(argc, argv, stdout); eclock = 0; lastnz = lastnr = 0.0; @@ -236,13 +204,13 @@ char *argv[]; lastnz = nz; lastnr = nr; nz = nextnz; nr = nextnr; } - quit(0); + return 0; userror: fprintf(stderr, "Usage: %s material name z(t) r(t) nseg [-e expr] [-f file] [-s]\n", argv[0]); - quit(1); + return 1; }