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

Comparing ray/src/meta/segment.c (file contents):
Revision 1.1 by greg, Sat Feb 22 02:07:26 2003 UTC vs.
Revision 1.2 by schorsch, Sat Nov 15 02:13:37 2003 UTC

# Line 7 | Line 7 | static const char      RCSid[] = "$Id$";
7   *   12/18/84
8   */
9  
10 + #include <string.h>
11  
12 + #include  "rtio.h"
13   #include  "meta.h"
14  
15  
# Line 32 | Line 34 | static int     dectop = 0;             /* top of declaration table */
34   static int      curdec = NODEC;         /* current declaration */
35  
36  
37 + static int hash(register char   *s);
38 + static int lookup(register char *name);
39  
40  
41  
42   static int
43 < hash(s)                 /* hash a string */
43 > hash(                   /* hash a string */
44 >        register char   *s
45 > )
46  
41 register char   *s;
42
47   {
48      register int        hval = 0;
49  
# Line 54 | Line 58 | register char  *s;
58  
59  
60   static int
61 < lookup(name)            /* find name in declaration table */
61 > lookup(         /* find name in declaration table */
62 >        register char   *name
63 > )
64  
59 register char   *name;
60
65   {
66      register int        curd;
67  
# Line 73 | Line 77 | register char  *name;
77  
78  
79  
80 + int
81 + inseg(void)                     /* return TRUE if currently in a segment */
82  
77 inseg()                 /* return TRUE if currently in a segment */
78
83   {
84  
85      return(curdec != NODEC);
# Line 83 | Line 87 | inseg()                        /* return TRUE if currently in a segment */
87  
88  
89  
90 + void
91 + openseg(                        /* open a new segment */
92 +        char    *name
93 + )
94  
87 openseg(name)                   /* open a new segment */
88
89 char    *name;
90
95   {
96      register int  olddec;
97  
# Line 108 | Line 112 | char   *name;
112  
113  
114  
115 + void
116 + segprim(                /* store primitive in current segment */
117 +        register PRIMITIVE  *p
118 + )
119  
112 segprim(p)              /* store primitive in current segment */
113
114 register PRIMITIVE  *p;
115
120   {
121      register PRIMITIVE  *newp;
122  
# Line 145 | Line 149 | register PRIMITIVE  *p;
149   }
150  
151  
152 + void
153 + closeseg(void)          /* close the current segment */
154  
149 closeseg()              /* close the current segment */
150
155   {
156      register int  i;
157      
# Line 167 | Line 171 | closeseg()             /* close the current segment */
171      hashtabl[i] = curdec;
172                                  /* return context */
173      curdec = dectabl[curdec].context;
170
174   }
175  
176  
177  
178 + void
179 + segment(                        /* expand segment p */
180 +        PRIMITIVE       *p,
181 +        void    (*funcp)(PRIMITIVE *p)
182 + )
183  
176 segment(p, funcp)                       /* expand segment p */
177 PRIMITIVE       *p;
178 int             (*funcp)();
179
184   {
185      int         decln;
186      PRIMITIVE   curp;
# Line 242 | Line 246 | int            (*funcp)();
246  
247  
248   int
249 < xlate(extrema, p, px)           /* return extrema from p through px */
250 <
251 < short                   extrema;
252 < PRIMITIVE               *p;
253 < register PRIMITIVE      *px;
249 > xlate(          /* return extrema from p through px */
250 >        short                   extrema,
251 >        PRIMITIVE               *p,
252 >        register PRIMITIVE      *px
253 > )
254  
255   {
256      short       oldex;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines