hash.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef _GOCR_HASH_H
00022 #define _GOCR_HASH_H
00023
00024 struct hashitem {
00025 char *key;
00026 void *data;
00027 #ifdef CHAIN
00028 struct hashitem *next;
00029 #endif
00030 };
00031 typedef struct hashitem hashItem;
00032
00033 struct hashtable {
00034 int size;
00035 hashItem **item;
00036 int (* hash_func)(char *);
00037 };
00038 typedef struct hashtable HashTable;
00039
00040 extern void *hash_data ( HashTable *t, char *key );
00041 extern void *hash_del ( HashTable *t, char *key );
00042 extern int hash_free ( HashTable *t, void (*free_func)(void *) );
00043 extern int hash_init ( HashTable *t, int size, int (*hash_func)(char *) );
00044 extern int hash_insert ( HashTable *t, char *key, void *data );
00045 extern char *hash_key ( HashTable *t, void *data );
00046
00047 #endif
Generated on Thu Jul 29 16:43:27 2004 for GOCR API by
1.3.7