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

Comparing ray/src/common/lookup.c (file contents):
Revision 2.12 by greg, Fri Nov 21 07:15:29 2003 UTC vs.
Revision 2.13 by schorsch, Sun Mar 28 20:33:12 2004 UTC

# Line 10 | Line 10 | static const char      RCSid[] = "$Id$";
10  
11   #include "lookup.h"
12  
13 + extern int
14 + lu_strcmp(
15 +        const void *s1,
16 +        const void *s2
17 + )
18 + {
19 +        return strcmp((const char*)s1,(const char*)s2);
20 + }
21  
22 < int
23 < lu_init(tbl, nel)               /* initialize tbl for at least nel elements */
24 < register LUTAB  *tbl;
25 < int     nel;
22 > extern int
23 > lu_init(                /* initialize tbl for at least nel elements */
24 >        register LUTAB  *tbl,
25 >        int     nel
26 > )
27   {
28          static int  hsiztab[] = {
29                  31, 61, 127, 251, 509, 1021, 2039, 4093, 8191, 16381,
# Line 37 | Line 46 | int    nel;
46   }
47  
48  
49 < unsigned long
50 < lu_shash(s)                     /* hash a nul-terminated string */
51 < char    *s;
49 > extern unsigned long
50 > lu_shash(                       /* hash a nul-terminated string */
51 >        void    *s
52 > )
53   {
54          static unsigned char shuffle[256] = {
55                  0, 157, 58, 215, 116, 17, 174, 75, 232, 133, 34,
# Line 78 | Line 88 | char   *s;
88   }
89  
90  
91 < LUENT *
92 < lu_find(tbl, key)               /* find a table entry */
93 < register LUTAB  *tbl;
94 < char    *key;
91 > extern LUENT *
92 > lu_find(                /* find a table entry */
93 >        register LUTAB  *tbl,
94 >        char    *key
95 > )
96   {
97          unsigned long   hval;
98          int     i, n;
# Line 133 | Line 144 | tryagain:
144   }
145  
146  
147 < void
148 < lu_delete(tbl, key)             /* delete a table entry */
149 < register LUTAB  *tbl;
150 < char    *key;
147 > extern void
148 > lu_delete(              /* delete a table entry */
149 >        register LUTAB  *tbl,
150 >        char    *key
151 > )
152   {
153          register LUENT  *le;
154  
# Line 151 | Line 163 | char   *key;
163   }
164  
165  
166 < int
167 < lu_doall(tbl, f)                /* loop through all valid table entries */
168 < register LUTAB  *tbl;
169 < int     (*f)(LUENT *);
166 > extern int
167 > lu_doall(               /* loop through all valid table entries */
168 >        register LUTAB  *tbl,
169 >        //int   (*f)(LUENT *)
170 >        lut_doallf_t *f
171 > )
172   {
173          int     rval = 0;
174          register LUENT  *tp;
# Line 170 | Line 184 | int    (*f)(LUENT *);
184   }
185  
186  
187 < void
188 < lu_done(tbl)                    /* free table and contents */
189 < register LUTAB  *tbl;
187 > extern void
188 > lu_done(                        /* free table and contents */
189 >        register LUTAB  *tbl
190 > )
191   {
192          register LUENT  *tp;
193  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines