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

Comparing ray/src/cv/mgflib/lookup.h (file contents):
Revision 1.4 by greg, Sat Jun 25 16:34:50 1994 UTC vs.
Revision 1.9 by gwlarson, Fri Sep 4 09:05:09 1998 UTC

# Line 12 | Line 12 | typedef struct {
12          char    *data;          /* pointer to client data */
13   } LUENT;
14  
15 + #ifdef NOPROTO
16   typedef struct {
17 <        long    (*hashf)();     /* key hash function */
17 >        unsigned long   (*hashf)();     /* key hash function */
18          int     (*keycmp)();    /* key comparison function */
19          void    (*freek)();     /* free a key */
20          void    (*freed)();     /* free the data */
# Line 21 | Line 22 | typedef struct {
22          LUENT   *tabl;          /* table, if allocated */
23          int     ndel;           /* number of deleted entries */
24   } LUTAB;
25 + #else
26 + typedef struct {
27 +        unsigned long   (*hashf)(char *);       /* key hash function */
28 +        int     (*keycmp)(const char *, const char *);  /* key comparison function */
29 +        void    (*freek)(char *);       /* free a key */
30 +        void    (*freed)(char *);       /* free the data */
31 +        int     tsiz;           /* current table size */
32 +        LUENT   *tabl;          /* table, if allocated */
33 +        int     ndel;           /* number of deleted entries */
34 + } LUTAB;
35 + #endif
36  
37   #define LU_SINIT(fk,fd)         {lu_shash,strcmp,(void (*)())(fk),\
38                                  (void (*)())(fd),0,NULL,0}
# Line 56 | Line 68 | typedef struct {
68   * The lu_delete routine frees an entry's data (if any) by calling
69   * the freed member function, but does not free the key field.  This
70   * will be freed later during (or instead of) table reallocation.
71 + * It is therefore an error to reuse or do anything with the key
72 + * field after calling lu_delete.
73   *
74   * The lu_done routine calls the given free function once for each
75   * assigned table entry (i.e. each entry with an assigned key value).
# Line 69 | Line 83 | extern int     lu_init();
83   extern LUENT    *lu_find();
84   extern void     lu_delete();
85   extern void     lu_done();
86 < extern long     lu_shash();
86 > extern unsigned long    lu_shash();
87   #else
88   extern int      lu_init(LUTAB *, int);
89   extern LUENT    *lu_find(LUTAB *, char *);
90   extern void     lu_delete(LUTAB *, char *);
91   extern void     lu_done(LUTAB *);
92 < extern long     lu_shash(char *);
92 > extern unsigned long    lu_shash(char *);
93   #endif
80
81 extern int      strcmp();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines