/*
 * hash.h: hash storage for C..
 *  an hash is a hash table of (key, value) trees..
 *
 * (C) Duncan C. White, 1996-2008 although it seems longer:-)
 */


typedef struct hash_s *hash;
typedef void *value;
typedef char *key;

typedef void (*printfunc)( FILE *, key, value );
typedef void (*foreachcbfunc)( key, value, void * );
typedef void (*freefunc)( value );
typedef value (*copyfunc)( value );

extern hash hashCreate( printfunc, freefunc, copyfunc );
extern void hashEmpty( hash );
extern void hashFree( hash );
extern void hashSet( hash, key, value );
extern value hashFind( hash, key );
extern hash hashCopy( hash );
extern void hashForeach( hash, foreachcbfunc, void * );
extern void hashDump( FILE *, hash );
extern void hashMetrics( hash, int *, int *, double * );
