00001
00002
00003
00004
00005 #ifndef _HASH_H_
00006 #define _HASH_H_
00007
00008 #include <stdio.h>
00009
00010 typedef void *HASH;
00011
00012 #ifdef __cplusplus
00013 extern "C" {
00014 #endif
00015
00016 HASH HashCreate (
00017 #ifdef PROTOTYPE
00018 int size,
00019 int (*compare) (void *entry1, void *entry2),
00020 unsigned (*hashfunc) (void *entry)
00021 #endif
00022 );
00023
00024 void HashDestroy (
00025 #ifdef PROTOTYPE
00026 HASH hash,
00027 void (*freeentry) (void *entry)
00028 #endif
00029 );
00030
00031 void *HashFind (
00032 #ifdef PROTOTYPE
00033 HASH hash,
00034 void *entry
00035 #endif
00036 );
00037
00038 void *HashAdd (
00039 #ifdef PROTOTYPE
00040 HASH hash,
00041 void *entry
00042 #endif
00043 );
00044
00045 void *HashDelete (
00046 #ifdef PROTOTYPE
00047 HASH hash,
00048 void *entry
00049 #endif
00050 );
00051
00052 #define HashSize(H) HashList(H,NULL,NULL)
00053
00054 int HashList (
00055 #ifdef PROTOTYPE
00056 HASH hash,
00057 int (*listentry)(
00058 void *entry,
00059 void *userdata
00060 ),
00061 void *userdata
00062 #endif
00063 );
00064
00065 void HashStats (
00066 #ifdef PROTOTYPE
00067 HASH hash
00068 #endif
00069 );
00070
00071 #ifdef __cplusplus
00072 }
00073 #endif
00074
00075 #endif
00076