--- ray/src/gen/genworm.c 2003/07/21 22:30:18 2.5 +++ ray/src/gen/genworm.c 2003/11/16 10:29:38 2.7 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: genworm.c,v 2.5 2003/07/21 22:30:18 schorsch Exp $"; +static const char RCSid[] = "$Id: genworm.c,v 2.7 2003/11/16 10:29:38 schorsch Exp $"; #endif /* * genworm.c - program to generate worms (strings with varying thickness). @@ -11,8 +11,12 @@ static const char RCSid[] = "$Id: genworm.c,v 2.5 2003 * 9/24/87 */ +#include #include #include +#include + +#include "calcomp.h" #include "fvect.h" #define XNAME "X`SYS`" /* x function name */ @@ -25,17 +29,20 @@ static const char RCSid[] = "$Id: genworm.c,v 2.5 2003 #define max(a,b) ((a) > (b) ? (a) : (b)) -double funvalue(), l_hermite(), l_bezier(), l_bspline(), argument(); -void quit(); +/* XXX redundant, move to library */ +double l_hermite(char *), l_bezier(char *), l_bspline(char *); +static void printhead(int ac, char **av); + + +int main(argc, argv) int argc; char *argv[]; { - extern long eclock; char stmp[256]; - double t, f, lastr, r; + double t, f, lastr = 0, r; FVECT lastp, p; int i, nseg; @@ -110,13 +117,13 @@ char *argv[]; VCOPY(lastp, p); lastr = r; } - quit(0); + return 0; userror: fprintf(stderr, "Usage: %s material name x(t) y(t) z(t) r(t) nseg [-e expr] [-f file]\n", argv[0]); - quit(1); + return 1; } @@ -144,9 +151,11 @@ int code; } -printhead(ac, av) /* print command header */ -register int ac; -register char **av; +void +printhead( /* print command header */ + register int ac, + register char **av +) { putchar('#'); while (ac--) { @@ -158,7 +167,7 @@ register char **av; double -l_hermite() +l_hermite(char *nm) { double t; @@ -171,7 +180,7 @@ l_hermite() double -l_bezier() +l_bezier(char *nm) { double t; @@ -184,7 +193,7 @@ l_bezier() double -l_bspline() +l_bspline(char *nm) { double t;