The LevAWC Project
 All Data Structures Files Functions Variables Typedefs Enumerations Macros Pages
ohashtbl.h
Go to the documentation of this file.
1 /*
2  * _____
3  * ANSI / ___/
4  * / /__
5  * \___/
6  *
7  * Filename: ohashtbl.h
8  * Author : Kyle Loudon/Dan Levin
9  * Date : Mon Apr 08 12:15:18 2013
10  * Version : 0.51
11  * ---
12  * Description: An open-addressed hashtable implemented as a pure, generic ADT - written in ANSI C
13  *
14  * Date Revision message
15  * 150331 This code ready for version 0.51
16  *
17  */
23 #ifndef _OHASHTBL_H_
24 #define _OHASHTBL_H_
25 
26 #include <stdio.h>
27 #include <stdlib.h>
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
38  typedef struct OHtbl_ *OHtbl;
39 
40  /* FUNCTION DECLARATIONS */
41 
68  OHtbl OHTBLinit(int positions, int (*h1)(const void *key), int (*h2)(const void *key),
69  int (*match)(const void *key1, const void *key2), void (*destroy)(void *data));
70 
87  void OHTBLdestroy(OHtbl htbl);
88 
105  int OHTBLinsert(OHtbl htbl, const void *data);
106 
135  int OHTBLremove(OHtbl htbl, void **data);
136 
165  int OHTBLlookup(const OHtbl htbl, void **data);
166 
175  int OHTBLsize(OHtbl htbl);
176 
192  void OHTBLprint(OHtbl htbl, void (*callback)(const void *data));
193 
194 #ifdef __cplusplus
195 }
196 #endif
197 
198 #endif /* _OHASHTBL_H_ */