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

Comparing ray/src/common/lookup.h (file contents):
Revision 2.10 by schorsch, Mon Jul 14 22:23:59 2003 UTC vs.
Revision 2.11 by schorsch, Wed Jul 30 10:11:06 2003 UTC

# Line 11 | Line 11
11   extern "C" {
12   #endif
13  
14 + typedef void lut_free_t(void*);
15 +
16   typedef struct {
17          char    *key;                   /* key name */
18          unsigned long   hval;           /* key hash value (for efficiency) */
# Line 18 | Line 20 | typedef struct {
20   } LUENT;
21  
22   typedef struct {
23 <        unsigned long   (*hashf)();     /* key hash function */
24 <        int     (*keycmp)();            /* key comparison function */
25 <        void    (*freek)();             /* free a key */
26 <        void    (*freed)();             /* free the data */
23 >        unsigned long (*hashf)(char*);  /* key hash function */
24 >        int (*keycmp)(const char*, const char*);        /* key comparison function */
25 >        lut_free_t *freek;              /* free a key */
26 >        lut_free_t *freed;              /* free the data */
27          int     tsiz;                   /* current table size */
28          LUENT   *tabl;                  /* table, if allocated */
29          int     ndel;                   /* number of deleted entries */
30   } LUTAB;
31  
32   #undef strcmp
33 < #define LU_SINIT(fk,fd)         {lu_shash,strcmp,(void (*)())(fk),\
34 <                                (void (*)())(fd),0,NULL,0}
33 > #define LU_SINIT(fk,fd)         {lu_shash,strcmp,fk,\
34 >                                fd,0,NULL,0}
35  
36   /*
37   * The lu_init routine is called to initialize a table.  The number of
# Line 82 | Line 84 | extern int     lu_init(LUTAB *tbl, int nel);
84   extern unsigned long    lu_shash(char *s);
85   extern LUENT    *lu_find(LUTAB *tbl, char *key);
86   extern void     lu_delete(LUTAB *tbl, char *key);
87 < extern int      lu_doall(LUTAB *tbl, int (*f)());
87 > extern int      lu_doall(LUTAB *tbl, int (*f)(LUENT*));
88   extern void     lu_done(LUTAB *tbl);
89  
90  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines