--- ray/src/gen/genrev.c 1990/03/07 11:14:40 1.5 +++ ray/src/gen/genrev.c 2003/02/22 02:07:23 2.4 @@ -1,9 +1,6 @@ #ifndef lint -static char SCCSid[] = "$SunId$ LBL"; +static const char RCSid[] = "$Id: genrev.c,v 2.4 2003/02/22 02:07:23 greg Exp $"; #endif - -/* Copyright (c) 1989 Regents of the University of California */ - /* * genrev.c - program to generate functions of rotation about z * @@ -15,9 +12,10 @@ static char SCCSid[] = "$SunId$ LBL"; */ #include +#include -#define ZNAME "Z_" /* z function name */ -#define RNAME "R_" /* r function name */ +#define ZNAME "Z`SYS`" /* z function name */ +#define RNAME "R`SYS`" /* r function name */ #define PI 3.14159265358979323846 @@ -30,11 +28,14 @@ static char SCCSid[] = "$SunId$ LBL"; double funvalue(), l_hermite(), l_bezier(), l_bspline(), argument(); +void quit(), eputs(), wputs(); + main(argc, argv) int argc; char *argv[]; { + extern long eclock; char stmp[256]; char *modname; int smooth = 0; @@ -43,17 +44,17 @@ char *argv[]; int i, nseg; int orient; - varset("PI", PI); - funset("hermite", 5, l_hermite); - funset("bezier", 5, l_bezier); - funset("bspline", 5, l_bspline); + varset("PI", ':', PI); + funset("hermite", 5, ':', l_hermite); + funset("bezier", 5, ':', l_bezier); + funset("bspline", 5, ':', l_bspline); if (argc < 6) goto userror; for (i = 6; i < argc; i++) if (!strcmp(argv[i], "-e")) - scompile(NULL, argv[++i]); + scompile(argv[++i], NULL, 0); else if (!strcmp(argv[i], "-f")) fcompile(argv[++i]); else if (!strcmp(argv[i], "-s")) @@ -62,15 +63,16 @@ char *argv[]; goto userror; sprintf(stmp, "%s(t)=%s;", ZNAME, argv[3]); - scompile(NULL, stmp); + scompile(stmp, NULL, 0); sprintf(stmp, "%s(t)=%s;", RNAME, argv[4]); - scompile(NULL, stmp); + scompile(stmp, NULL, 0); nseg = atoi(argv[5]); if (nseg <= 0) goto userror; modname = smooth ? "Phong" : argv[1]; printhead(argc, argv); + eclock = 0; lastnz = lastnr = 0.0; t = 0.0; @@ -158,7 +160,6 @@ userror: computen(nzp, nrp, z0, r0, z1, r1) /* compute normal */ double *nzp, *nrp, z0, r0, z1, r1; { - extern double sqrt(); double dr, dz, len; dz = r0 - r1; /* right angle vector */ @@ -169,6 +170,7 @@ double *nzp, *nrp, z0, r0, z1, r1; } +void eputs(msg) char *msg; { @@ -176,6 +178,7 @@ char *msg; } +void wputs(msg) char *msg; { @@ -183,7 +186,9 @@ char *msg; } +void quit(code) +int code; { exit(code); }