1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
|
/*
* hash.h - include file for hash routines
*/
#ifndef _HASH_H_
#define _HASH_H_
#include <stdio.h> /* for NULL */
typedef void *HASH;
#ifdef __cplusplus
extern "C" {
#endif
HASH HashCreate (
#ifdef PROTOTYPE
int size,
int (*compare) (void *entry1, void *entry2),
unsigned (*hashfunc) (void *entry)
#endif
);
void HashDestroy (
#ifdef PROTOTYPE
HASH hash,
void (*freeentry) (void *entry)
#endif
);
void *HashFind (
#ifdef PROTOTYPE
HASH hash,
void *entry
#endif
);
void *HashAdd (
#ifdef PROTOTYPE
HASH hash,
void *entry
#endif
);
void *HashDelete (
#ifdef PROTOTYPE
HASH hash,
void *entry
#endif
);
#define HashSize(H) HashList(H,NULL,NULL)
int HashList (
#ifdef PROTOTYPE
HASH hash,
int (*listentry)(
void *entry,
void *userdata
),
void *userdata
#endif
);
void HashStats (
#ifdef PROTOTYPE
HASH hash
#endif
);
#ifdef __cplusplus
}
#endif
#endif /* _HASH_H_ */
|