squareball  0.2.0.50-8649
A general-purpose library for C99
sb-trie.h
Go to the documentation of this file.
1 /*
2  * squareball: A general-purpose library for C99.
3  * Copyright (C) 2014-2018 Rafael G. Martins <rafael@rafaelmartins.eng.br>
4  *
5  * This program can be distributed under the terms of the BSD License.
6  * See the file LICENSE.
7  */
8 
9 #ifndef _SQUAREBALL_TRIE_H
10 #define _SQUAREBALL_TRIE_H
11 
12 #include <stdbool.h>
13 #include <stdlib.h>
14 #include <stdarg.h>
15 #include "sb-mem.h"
16 
30 typedef struct _sb_trie_t sb_trie_t;
31 
40 typedef void (*sb_trie_foreach_func_t)(const char *key, void *data,
41  void *user_data);
42 
53 
60 void sb_trie_free(sb_trie_t *trie);
61 
73 void sb_trie_insert(sb_trie_t *trie, const char *key, void *data);
74 
82 void* sb_trie_lookup(sb_trie_t *trie, const char *key);
83 
90 size_t sb_trie_size(sb_trie_t *trie);
91 
100  void *user_data);
101 
104 #endif /* _SQUAREBALL_TRIE_H */
struct _sb_trie_t sb_trie_t
Definition: sb-trie.h:30
void * sb_trie_lookup(sb_trie_t *trie, const char *key)
void(* sb_free_func_t)(void *ptr)
Definition: sb-mem.h:31
void(* sb_trie_foreach_func_t)(const char *key, void *data, void *user_data)
Definition: sb-trie.h:40
size_t sb_trie_size(sb_trie_t *trie)
void sb_trie_free(sb_trie_t *trie)
sb_trie_t * sb_trie_new(sb_free_func_t free_func)
Memory allocation related helpers.
void sb_trie_insert(sb_trie_t *trie, const char *key, void *data)
void sb_trie_foreach(sb_trie_t *trie, sb_trie_foreach_func_t func, void *user_data)