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.6 by greg, Mon Aug 4 22:37:53 2003 UTC vs.
Revision 2.9 by greg, Fri Jan 12 00:50:17 2018 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 26 | Line 31 | static const char      RCSid[] = "$Id$";
31   #define  max(a,b)       ((a) > (b) ? (a) : (b))
32  
33  
34 + /* XXX redundant, move to library */
35   double  l_hermite(char *), l_bezier(char *), l_bspline(char *);
30 void  quit();
36  
37  
38 + int
39   main(argc, argv)
40   int  argc;
41   char  *argv[];
42   {
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  
48 +        esupport |= E_VARIABLE|E_FUNCTION|E_RCONST;
49 +        esupport &= ~(E_OUTCHAN|E_INCHAN);
50          varset("PI", ':', PI);
51          funset("hermite", 5, ':', l_hermite);
52          funset("bezier", 5, ':', l_bezier);
# Line 67 | Line 75 | char  *argv[];
75          if (nseg <= 0)
76                  goto userror;
77  
78 <        printhead(argc, argv);
78 >        fputs("# ", stdout);
79 >        printargs(argc, argv, stdout);
80          eclock = 0;
81  
82          for (i = 0; i <= nseg; i++) {
# Line 110 | Line 119 | char  *argv[];
119                  VCOPY(lastp, p);
120                  lastr = r;
121          }
122 <        quit(0);
122 >        return 0;
123  
124   userror:
125          fprintf(stderr,
126   "Usage: %s material name x(t) y(t) z(t) r(t) nseg [-e expr] [-f file]\n",
127                          argv[0]);
128 <        quit(1);
120 < }
121 <
122 <
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');
128 >        return 1;
129   }
130  
131  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines