view src/ctrie.h @ 15:d11dfc49b559

Seems to be working, but I need to prove the algorithms and also make ctrie_remove compress down, too. See the final output where the standalone 'n' node could be pushed into it's children
author Eris Caffee <discordia@eldalin.com>
date Wed, 03 Oct 2012 01:07:04 -0500
parents 7886d2da8cc4
children
line source
1 #ifndef CTRIE_H_
2 #define CTRIE_H_
4 // Compact trie - internal nodes are collapsed together if they have no siblings.F
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