view src/ctrie.h @ 13:7886d2da8cc4

Trie working OK. Started on compact trie, ctrie.
author Eris Caffee <discordia@eldalin.com>
date Tue, 02 Oct 2012 10:13:07 -0500
parents
children d11dfc49b559
line source
1 #ifndef CTRIE_H_
2 #define CTRIE_H_
4 // Compact trie - internal nodes are collapsed together if they have no siblings.
6 struct ctrie;
8 struct ctrie * ctrie_new();
9 void ctrie_delete(struct ctrie * ctrie);
11 size_t ctrie_size(struct ctrie * ctrie);
12 size_t ctrie_count(struct ctrie * ctrie);
14 char * ctrie_insert(struct ctrie * ctrie, char * key, void * data);
15 void * ctrie_find(struct ctrie * ctrie, char * key);
16 void * ctrie_remove(struct ctrie * ctrie, char * key);
18 void ctrie_walk_keys(struct ctrie * ctrie, void (*op)(char * k, void * d) );
20 void ctrie_dump(struct ctrie * ctrie);
21 void ctrie_dump_raw(struct ctrie * ctrie);
23 struct list * ctrie_get_subkeys(struct ctrie * ctrie, char * prefix, size_t limit);
24 void ctrie_free_subkey_list(struct list * list);
27 #endif