pdirt/data/
pdirt/data/HELP/
pdirt/data/HELP/0/
pdirt/data/HELP/F/
pdirt/data/HELP/G/
pdirt/data/HELP/H/
pdirt/data/HELP/J/
pdirt/data/HELP/K/
pdirt/data/HELP/O/
pdirt/data/HELP/Q/
pdirt/data/HELP/R/
pdirt/data/HELP/U/
pdirt/data/HELP/V/
pdirt/data/HELP/Y/
pdirt/data/HELP/Z/
pdirt/data/MESSAGES/
pdirt/data/POWERINFO/
pdirt/data/WIZ_ZONES/
pdirt/drv/
pdirt/drv/bin/
pdirt/drv/compiler/converter/
pdirt/drv/compiler/libs/
pdirt/drv/compiler/scripts/
pdirt/drv/include/AberChat/
pdirt/drv/include/InterMud/
pdirt/drv/include/machine/
pdirt/drv/src/InterMud/
pdirt/drv/src/Players/
pdirt/drv/utils/UAFPort/
pdirt/drv/utils/dnsresolv/
pdirt/drv/utils/gdbm/
#ifndef HASH_H_
#define HASH_H_

/* Nice macro to produce some usefull debugging info if memory allocation
 * failed.
 */
#define memAlloc(T,M,N)		ymalloc(sizeof(T),M,N,__FILE__,__LINE__)

/* To calculate the key of the hashtable
 */
typedef long hashKey;

/* First we need a overall record type to store data in and which we can 
 * place in the hashtable.
 */
typedef struct _hashRecord {
     char        *id;			/* Dynamically allocated id string */
     long	 idnumber;		/* Number related to this id */
     struct      _hashRecord *next;
} hashRecord;

typedef struct _hashTable {
     hashRecord   **hashtable;		/* The actual table */
     size_t       size;			/* The size of the table */

     size_t	  elems_stored;		/* Debugging info */
     size_t	  insertcollisions;	/* Also */
     size_t	  findcollisions;	/* ditto */
} hashTable;

/***************************************************************************
 ** PROTOTYPES
 ****************************************************************************/
void        freeHashRecord(hashRecord *ptr);
hashTable  *createHashTable(size_t size);
hashKey     calcHashKey(char *id, size_t tablesize);
int         addHashRecord(hashRecord *newptr, hashTable *to);
hashRecord *findHashRecord(char *id, hashTable *table);
hashRecord *createHashRecord(char *id,long idnum);
int        deleteHashRecord(char *id, hashTable *from);
int        deleteHashTable(hashTable *thistable);
void       printHashTableStatistics(hashTable *h);

void      *ymalloc(size_t size, size_t nmembers,int typenr, char *file, int line);

#endif