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.11 by schorsch, Sat Jun 7 01:11:17 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 _MGF_LOOKUP_H_
6 + #define _MGF_LOOKUP_H_
7 + #ifdef __cplusplus
8 + extern "C" {
9 + #endif
10  
11 +
12   typedef struct {
13          char    *key;           /* key name */
14          long    hval;           /* key hash value (for efficiency) */
# Line 13 | Line 16 | typedef struct {
16   } LUENT;
17  
18   typedef struct {
19 <        long    (*hashf)();     /* key hash function */
20 <        int     (*keycmp)();    /* key comparison function */
21 <        void    (*freek)();     /* free a key */
22 <        void    (*freed)();     /* free the data */
19 >        unsigned long   (*hashf)(char *);       /* key hash function */
20 >        int     (*keycmp)(const char *, const char *);  /* key comparison function */
21 >        void    (*freek)(char *);       /* free a key */
22 >        void    (*freed)(char *);       /* free the data */
23          int     tsiz;           /* current table size */
24          LUENT   *tabl;          /* table, if allocated */
25          int     ndel;           /* number of deleted entries */
# Line 56 | Line 59 | typedef struct {
59   * The lu_delete routine frees an entry's data (if any) by calling
60   * the freed member function, but does not free the key field.  This
61   * will be freed later during (or instead of) table reallocation.
62 + * It is therefore an error to reuse or do anything with the key
63 + * field after calling lu_delete.
64   *
65   * The lu_done routine calls the given free function once for each
66   * assigned table entry (i.e. each entry with an assigned key value).
# Line 64 | Line 69 | typedef struct {
69   * allocated table itself.
70   */
71  
67 #ifdef NOPROTO
68 extern int      lu_init();
69 extern LUENT    *lu_find();
70 extern void     lu_delete();
71 extern void     lu_done();
72 extern long     lu_shash();
73 #else
72   extern int      lu_init(LUTAB *, int);
73   extern LUENT    *lu_find(LUTAB *, char *);
74   extern void     lu_delete(LUTAB *, char *);
75   extern void     lu_done(LUTAB *);
76 < extern long     lu_shash(char *);
76 > extern unsigned long    lu_shash(char *);
77 >
78 >
79 > #ifdef __cplusplus
80 > }
81   #endif
82 + #endif /* _MGF_LOOKUP_H_ */
83  
81 extern int      strcmp();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines