squareball 0.2.0.28-7bb8 A general-purpose library for C99

- Main Page
- Data Structures
- Files
- Examples

- File List
- Globals

All Data Structures Files Functions Variables Typedefs
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
35 typedef void (*sb_trie_foreach_func_t)(const char *key, void *data,
36 void *user_data);
37
47 sb_trie_t* sb_trie_new(sb_free_func_t free_func);
48
55 void sb_trie_free(sb_trie_t *trie);
56
68 void sb_trie_insert(sb_trie_t *trie, const char *key, void *data);
69
77 void* sb_trie_lookup(sb_trie_t *trie, const char *key);
78
85 size_t sb_trie_size(sb_trie_t *trie);
86
94 void sb_trie_foreach(sb_trie_t *trie, sb_trie_foreach_func_t func,
95 void *user_data);
96
99 #endif /* _SQUAREBALL_TRIE_H */
sb_trie_t
struct _sb_trie_t sb_trie_t
Definition: sb-trie.h:30
sb_trie_lookup
void * sb_trie_lookup(sb_trie_t *trie, const char *key)
sb_trie_foreach_func_t
void(* sb_trie_foreach_func_t)(const char *key, void *data, void *user_data)
Definition: sb-trie.h:35
sb_trie_size
size_t sb_trie_size(sb_trie_t *trie)
sb_trie_free
void sb_trie_free(sb_trie_t *trie)
sb_trie_new
sb_trie_t * sb_trie_new(sb_free_func_t free_func)
sb-mem.h
Memory allocation related helpers.
sb_free_func_t
void(* sb_free_func_t)(void *ptr)
Definition: sb-mem.h:29
sb_trie_insert
void sb_trie_insert(sb_trie_t *trie, const char *key, void *data)
sb_trie_foreach
void sb_trie_foreach(sb_trie_t *trie, sb_trie_foreach_func_t func, void *user_data)