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.4 by gwlarson, Tue Jun 2 15:01:43 1998 UTC vs.
Revision 2.8 by schorsch, Fri Jun 6 16:38:47 2003 UTC

# Line 1 | Line 1
1 < /* Copyright (c) 1994 Regents of the University of California */
2 <
3 < /* SCCSid "$SunId$ LBL" */
4 <
1 > /* RCSid $Id$ */
2   /*
3   * Header file for general associative table lookup routines
4   */
5 + #ifndef _RAD_LOOKUP_H_
6 + #define _RAD_LOOKUP_H_
7 + #ifdef __cplusplus
8 + extern "C" {
9 + #endif
10  
11 +
12 + #include "copyright.h"
13 +
14   typedef struct {
15 <        char    *key;           /* key name */
16 <        long    hval;           /* key hash value (for efficiency) */
17 <        char    *data;          /* pointer to client data */
15 >        char    *key;                   /* key name */
16 >        unsigned long   hval;           /* key hash value (for efficiency) */
17 >        char    *data;                  /* pointer to client data */
18   } LUENT;
19  
20   typedef struct {
21 <        long    (*hashf)();     /* key hash function */
22 <        int     (*keycmp)();    /* key comparison function */
23 <        void    (*freek)();     /* free a key */
24 <        void    (*freed)();     /* free the data */
25 <        int     tsiz;           /* current table size */
26 <        LUENT   *tabl;          /* table, if allocated */
27 <        int     ndel;           /* number of deleted entries */
21 >        unsigned long   (*hashf)();     /* key hash function */
22 >        int     (*keycmp)();            /* key comparison function */
23 >        void    (*freek)();             /* free a key */
24 >        void    (*freed)();             /* free the data */
25 >        int     tsiz;                   /* current table size */
26 >        LUENT   *tabl;                  /* table, if allocated */
27 >        int     ndel;                   /* number of deleted entries */
28   } LUTAB;
29  
30   #undef strcmp
# Line 73 | Line 78 | typedef struct {
78   * allocated table itself.
79   */
80  
81 < extern int      lu_init();
77 < extern LUENT    *lu_find();
78 < extern void     lu_delete();
79 < extern int      lu_doall();
80 < extern void     lu_done();
81 < extern long     lu_shash();
81 > #include <string.h> /* strcmp() */
82  
83 < extern int      strcmp();
83 > 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)());
88 > extern void     lu_done(LUTAB *tbl);
89 >
90 >
91 > #ifdef __cplusplus
92 > }
93 > #endif
94 > #endif /* _RAD_LOOKUP_H_ */
95 >

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines