aboutsummaryrefslogtreecommitdiff
path: root/trie.inc.h
diff options
context:
space:
mode:
Diffstat (limited to 'trie.inc.h')
-rw-r--r--trie.inc.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/trie.inc.h b/trie.inc.h
index 5fa047db..3bc19895 100644
--- a/trie.inc.h
+++ b/trie.inc.h
@@ -113,11 +113,16 @@ FREE_F(TRIE(TYPE)) {
return FREE(TRIE_NODE(TYPE))(this->root);
}
+int EMPTY(TRIE(TYPE))(TRIE(TYPE)* this) {
+ return this->root->child == NULL;
+}
+
int TRIE_DOT(TYPE) ( TRIE(TYPE)* trie, FILE* f ) {
TRIE_NODE(TYPE)* n = trie->root->child;
- fputs("root [fontcolor=gray, color=gray];", f);
+ fprintf(f, "\"%p\" [label=root fontcolor=gray, color=gray];", trie);
while (n != NULL) {
- fprintf(f, "root -> \"%p\" [color=gray]\n",
+ fprintf(f, "\"%p\" -> \"%p\" [color=gray]\n",
+ (void*) trie,
(void*) n);
fprintf(f, "subgraph \"cluster_%c\" {\n",
n->c);