File: htable.h

package info (click to toggle)
mtools 3.8-1
  • links: PTS
  • area: main
  • in suites: hamm
  • size: 1,116 kB
  • ctags: 1,306
  • sloc: ansic: 11,489; sh: 2,052; makefile: 223; sed: 8
file content (17 lines) | stat: -rw-r--r-- 511 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/*
 * hashtable
 */

typedef struct hashtable T_HashTable;
typedef void *T_HashTableEl;
typedef unsigned int (*T_HashFunc)(void *);
typedef int (*T_ComparFunc)(void *, void *);


int make_ht(T_HashFunc f1, T_HashFunc f2, T_ComparFunc c, int size, T_HashTable **H);
int hash_add(T_HashTable *H, T_HashTableEl *E);
int hash_remove(T_HashTable *H, T_HashTableEl *E, int hint);
int hash_lookup(T_HashTable *H, T_HashTableEl *E, T_HashTableEl **E2,
		int *hint);
int free_ht(T_HashTable *H, T_HashFunc entry_free);