diff options
author | Hugo Hörnquist <hugo@hornquist.se> | 2019-11-03 14:46:28 +0100 |
---|---|---|
committer | Hugo Hörnquist <hugo@hornquist.se> | 2019-11-03 14:46:28 +0100 |
commit | 0f65e75ec0f56d3067a15e3671d9250fd2c1637a (patch) | |
tree | 40ddc24f08b42c767e02b6482133e9f7efe4b524 /src/trie.h | |
parent | Remove 'none' output. (diff) | |
parent | Add descirption to strbuf. (diff) | |
download | calp-0f65e75ec0f56d3067a15e3671d9250fd2c1637a.tar.gz calp-0f65e75ec0f56d3067a15e3671d9250fd2c1637a.tar.xz |
Merge branch 'restruct'
Diffstat (limited to 'src/trie.h')
-rw-r--r-- | src/trie.h | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/src/trie.h b/src/trie.h deleted file mode 100644 index 9de38be3..00000000 --- a/src/trie.h +++ /dev/null @@ -1,54 +0,0 @@ -#ifndef TRIE_H -#define TRIE_H - -#include <stdio.h> - -#include "macro.h" - -#define TRIE(T) TEMPL(trie, T) -#define TRIE_NODE(T) TEMPL(trie_node, T) - -#endif /* TRIE_H */ -#ifdef TYPE - -#include "linked_list.h" -#include "strbuf.h" - -typedef struct TRIE_NODE(TYPE) { - char c; - TYPE* value; - struct TRIE_NODE(TYPE)* next; - struct TRIE_NODE(TYPE)* child; -} TRIE_NODE(TYPE); - -typedef struct { - TRIE_NODE(TYPE)* root; -} TRIE(TYPE); - - -INIT_F ( TRIE(TYPE) ); - -INIT_F (TRIE_NODE(TYPE), char c); - -INIT_F (TRIE_NODE(TYPE), - char c, TRIE_NODE(TYPE)* next, TRIE_NODE(TYPE)* child ); - -int PUSH(TRIE(TYPE)) ( TRIE(TYPE)* trie, char* key, TYPE* val ); - -TYPE* GET(TRIE(TYPE)) ( TRIE(TYPE)* trie, char* key ); - -FREE_F(TRIE_NODE(TYPE)); - -FREE_F(TRIE(TYPE)); - -int EMPTY(TRIE(TYPE))(TRIE(TYPE)*); - -FMT_F(TRIE_NODE(TYPE)); -FMT_F(TRIE(TYPE)); - -int DEEP_COPY(TRIE_NODE(TYPE)) (TRIE_NODE(TYPE)* dest, TRIE_NODE(TYPE)* src); -int DEEP_COPY(TRIE(TYPE)) (TRIE(TYPE)* dest, TRIE(TYPE)* src); - -LLIST(strbuf)* KEYS(TRIE(TYPE)) (TRIE(TYPE)*); - -#endif /* TYPE */ |