Main Page   Alphabetical List   Data Structures   File List   Data Fields   Globals  

hashtable.h

Go to the documentation of this file.
00001 
00023 #ifndef _LIBPACKMAN_HASHTABLE_H_
00024 #define _LIBPACKMAN_HASHTABLE_H_
00025 
00026 typedef struct _PmHashTable PmHashTable; 
00027 typedef struct _PmBucket    PmBucket;    
00032 struct _PmHashTable
00033 {
00034     unsigned char  bucketCount; 
00035     unsigned short itemCount;   
00037     PmBucket     **buckets;     
00038     unsigned char *counts;      
00050     int (*compare)(const void *key1, const void *key2);
00051 
00060     unsigned short (*hashkey)(PmHashTable *table, const void *key);
00061 
00067     void (*freeData)(void *data);
00068 };
00069 
00075 struct _PmBucket
00076 {
00077     void *key;          
00078     void *data;         
00080     PmBucket *next;     
00081 };
00082 
00095 PmHashTable *pmNewHashTable(
00096     int (*compare)(const void *key1, const void *key2),
00097     unsigned short (*hashkey)(PmHashTable *table, const void *key),
00098     void (*freeData)(void *data));
00099 
00107 void pmDestroyHashTable(PmHashTable *table);
00108 
00121 char pmHashTableAdd(PmHashTable *table, void *key, void *data);
00122 
00134 char pmHashTableRemove(PmHashTable *table, void *key);
00135 
00147 void *pmHashTableGet(PmHashTable *table, void *key);
00148 
00149 #endif /* _LIBPACKMAN_HASHTABLE_H_ */
00150 

Generated on Tue Jul 2 03:15:23 2002 for libpackman by doxygen1.2.15-20020430