ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/gen/genworm.c
(Generate patch)

Comparing ray/src/gen/genworm.c (file contents):
Revision 2.5 by schorsch, Mon Jul 21 22:30:18 2003 UTC vs.
Revision 2.8 by greg, Sat Aug 21 11:54:06 2004 UTC

# Line 11 | Line 11 | static const char      RCSid[] = "$Id$";
11   *      9/24/87
12   */
13  
14 + #include  <stdlib.h>
15   #include  <stdio.h>
16   #include  <math.h>
17 + #include  <string.h>
18 +
19 + #include  "calcomp.h"
20 + #include  "resolu.h"
21 + #include  "rterror.h"
22   #include  "fvect.h"
23  
24   #define  XNAME          "X`SYS`"                /* x function name */
# Line 25 | Line 31 | static const char      RCSid[] = "$Id$";
31   #define  max(a,b)       ((a) > (b) ? (a) : (b))
32  
33  
34 < double  funvalue(), l_hermite(), l_bezier(), l_bspline(), argument();
35 < void  quit();
34 > /* XXX redundant, move to library */
35 > double  l_hermite(char *), l_bezier(char *), l_bspline(char *);
36  
37  
38 + int
39   main(argc, argv)
40   int  argc;
41   char  *argv[];
42   {
36        extern long     eclock;
43          char  stmp[256];
44 <        double  t, f, lastr, r;
44 >        double  t, f, lastr = 0, r;
45          FVECT  lastp, p;
46          int  i, nseg;
47  
# Line 67 | Line 73 | char  *argv[];
73          if (nseg <= 0)
74                  goto userror;
75  
76 <        printhead(argc, argv);
76 >        fputs("# ", stdout);
77 >        printargs(argc, argv, stdout);
78          eclock = 0;
79  
80          for (i = 0; i <= nseg; i++) {
# Line 110 | Line 117 | char  *argv[];
117                  VCOPY(lastp, p);
118                  lastr = r;
119          }
120 <        quit(0);
120 >        return 0;
121  
122   userror:
123          fprintf(stderr,
124   "Usage: %s material name x(t) y(t) z(t) r(t) nseg [-e expr] [-f file]\n",
125                          argv[0]);
126 <        quit(1);
126 >        return 1;
127   }
128  
129  
123 void
124 eputs(msg)
125 char  *msg;
126 {
127        fputs(msg, stderr);
128 }
129
130
131 void
132 wputs(msg)
133 char  *msg;
134 {
135        eputs(msg);
136 }
137
138
139 void
140 quit(code)
141 int  code;
142 {
143        exit(code);
144 }
145
146
147 printhead(ac, av)               /* print command header */
148 register int  ac;
149 register char  **av;
150 {
151        putchar('#');
152        while (ac--) {
153                putchar(' ');
154                fputs(*av++, stdout);
155        }
156        putchar('\n');
157 }
158
159
130   double
131 < l_hermite()                    
131 > l_hermite(char *nm)
132   {
133          double  t;
134          
# Line 171 | Line 141 | l_hermite()                    
141  
142  
143   double
144 < l_bezier()
144 > l_bezier(char *nm)
145   {
146          double  t;
147  
# Line 184 | Line 154 | l_bezier()
154  
155  
156   double
157 < l_bspline()
157 > l_bspline(char *nm)
158   {
159          double  t;
160  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines