diff options
author | sinanmohd <sinan@sinanmohd.com> | 2024-06-22 23:48:45 +0530 |
---|---|---|
committer | sinanmohd <sinan@sinanmohd.com> | 2024-06-23 01:59:49 +0530 |
commit | 4740b89e88dff04361da7f7f3bd9e823fd75d5b2 (patch) | |
tree | b5cf30095adc7dcd12ed9a0d9d83671f04efaf43 /include/htab.h | |
parent | 49b1faa9c128b9beb8f517bed5cccfc5cb3b0ef0 (diff) |
htab: init
Diffstat (limited to 'include/htab.h')
-rw-r--r-- | include/htab.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/include/htab.h b/include/htab.h new file mode 100644 index 0000000..70a0893 --- /dev/null +++ b/include/htab.h @@ -0,0 +1,18 @@ +#include <search.h> + +#ifndef HTAB_H + +struct htab { + struct hsearch_data *table; + char **keys; + size_t keys_size, key_filled; +}; + +void htab_free(struct htab *htab); +int htab_init(struct htab **htab); +int htab_delete(struct htab *htab, const char *key); +int htab_enter(struct htab *htab, const char *key, void *data); +int htab_search(struct htab *htab, char *key, ENTRY **ep); + +#define HTAB_H +#endif |