OpenSWMM Engine  6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
hash.h
Go to the documentation of this file.
1//-----------------------------------------------------------------------------
2// hash.h
3//
4// Header file for Hash Table module hash.c.
5//-----------------------------------------------------------------------------
6
16
17#ifndef HASH_H
18#define HASH_H
19
20#define HTMAXSIZE 1999
21#define NOTFOUND -1
22
23struct HTentry {
24 char* key;
25 int data;
26 struct HTentry* next;
27};
28
29typedef struct HTentry* HTtable;
30
31HTtable* HTcreate(void);
32int HTinsert(HTtable*, char*, int);
33int HTfind(HTtable*, const char*);
34char* HTfindKey(HTtable*, const char*);
35void HTfree(HTtable*);
36
37#endif //HASH_H
int HTfind(HTtable *, const char *)
Look up the most recently inserted case-insensitive key match.
Definition hash.c:120
char * HTfindKey(HTtable *, const char *)
Retrieve the original stored spelling of a case-insensitive key.
Definition hash.c:142
struct HTentry * HTtable
Definition hash.h:29
HTtable * HTcreate(void)
Allocate an empty case-insensitive identifier table.
Definition hash.c:78
int HTinsert(HTtable *, char *, int)
Prepend a key/data entry to a hash table without copying its key.
Definition hash.c:97
void HTfree(HTtable *)
Free all hash entries and the table bucket array.
Definition hash.c:162
Definition hash.h:23
char * key
Definition hash.h:24
int data
Definition hash.h:25
struct HTentry * next
Definition hash.h:26