Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-04-01 08:52:28

0001 /*
0002  * $Id$
0003  *
0004  * $Log$
0005  * Revision 1.1  1996/03/08 15:32:59  mclareni
0006  * Initial revision
0007  *
0008  */
0009 /* khash.h: hash table management */
0010 
0011 typedef struct _HashArray {
0012   char       *name;             /* symbol name */
0013   void       *value;            /* symbol value */
0014   int         tag;
0015 } HashArray;
0016 
0017 typedef struct _HashEntry {
0018   struct _HashEntry *next;      /* link to next entry */
0019   char       *name;             /* symbol name */
0020   void       *value;            /* symbol value */
0021   int         tag;
0022 } HashEntry;
0023 
0024 typedef struct {
0025   int         size;             /* table size should be a prime number */
0026   HashEntry **entries;          /* pointer to array of size entries */
0027   int        nentries;          /* number of entries */
0028   int         is_string;        /* flag if strdup/free(value) should be used */
0029   int         tag_only;         /* flag if only tag field is used */
0030   int         case_convert;
0031   int       (*strcmp)();        /* strcmp/strcasecmp */
0032   int       (*hash_cmp)();      /* hash_cmp/hash_casecmp */
0033 } HashTable;
0034 
0035 extern HashArray* hash_array(   HashTable* );
0036 extern void       hash_clear(   HashTable* );
0037 extern void       hash_config(  HashTable*, const char* );
0038 extern HashTable* hash_create(  int );
0039 extern void       hash_destroy( HashTable* );
0040 extern int        hash_entries( HashTable* );
0041 extern void       hash_insert(  HashTable*, const char*, const void*, int );
0042 extern void*      hash_lookup(  HashTable*, const char*, int* );
0043 extern void*      hash_remove(  HashTable*, const char* );
0044 
0045