clibs
Tiny but handy utility libraries for C
Loading...
Searching...
No Matches
hash_table.h
Go to the documentation of this file.
1
13#ifndef HASH_TABLE_H
14#define HASH_TABLE_H
15
16/* Custom boolean type. */
17#ifndef _WINDOWS_
18#ifdef __cplusplus
19 #ifndef _BOOL_IS_DEFINED
20 typedef bool BOOL;
21 #define FALSE false
22 #define TRUE true
23 #define _BOOL_IS_DEFINED
24 #endif
25#else
26 #if __STDC_VERSION__ < 199901L
27 #ifndef _BOOL_IS_DEFINED
28 typedef char BOOL;
29 #define FALSE 0
30 #define TRUE 1
31 #define _BOOL_IS_DEFINED
32 #endif
33 #else
34 #ifndef _BOOL_IS_DEFINED
35 #include <stdbool.h>
36 typedef bool BOOL;
37 #define FALSE false
38 #define TRUE true
39 #define _BOOL_IS_DEFINED
40 #endif
41 #endif
42#endif
43#endif
44
45#ifdef __cplusplus
46extern "C" {
47#endif
48
49typedef struct hash_table_t hash_table_t;
50
51hash_table_t * hash_table_new(void);
52BOOL hash_table_add(hash_table_t *self, const char *key, const char *value);
53const char * hash_table_get(hash_table_t *self, const char *key);
54BOOL hash_table_remove(hash_table_t *self, const char *key);
55void hash_table_delete(hash_table_t *self);
56
57#ifdef __cplusplus
58}
59#endif
60
61#endif /* HASH_TABLE_H */
Definition hash_table.c:8