Files
EPANET/src/hash.h
Lew Rossman 60a79de4a9 Fixed bug in hash.c
A bug in the delete function in hash.c was preventing the unit test of the new set ID API functions from running properly. In fixing this bug the entire hash table code was refactored to make it look more like the mempool service routines. Also the need to copy the string passed into the table's insert function was eliminated.
2018-10-18 10:03:09 -04:00

23 lines
538 B
C
Executable File

/* HASH.H
**
** Header file for Hash Table module HASH.C
**
*/
#ifndef HASH_H
#define HASH_H
#define NOTFOUND 0
typedef struct DataEntryStruct *HashTable;
HashTable *hashtable_create(void);
int hashtable_insert(HashTable *, char *, int);
int hashtable_find(HashTable *, char *);
char *hashtable_findkey(HashTable *, char *);
void hashtable_free(HashTable *);
int hashtable_update(HashTable *ht, char *key, int new_data);
int hashtable_delete(HashTable *ht, char *key);
#endif