Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00039 #ifndef _DTRIE_H_
00040 #define _DTRIE_H_
00041
00042
00044 struct dtrie_node_t {
00045 struct dtrie_node_t **child;
00046 void *data;
00047 };
00048
00049
00051 typedef void(*dt_delete_func_t)(void *);
00052
00053
00059 struct dtrie_node_t *dtrie_init(const unsigned int branches);
00060
00061
00070 void dtrie_delete(struct dtrie_node_t *root, struct dtrie_node_t *node,
00071 dt_delete_func_t delete_payload, const unsigned int branches);
00072
00073
00080 void dtrie_destroy(struct dtrie_node_t **root, dt_delete_func_t delete_payload,
00081 const unsigned int branches);
00082
00083
00094 void dtrie_clear(struct dtrie_node_t *root, dt_delete_func_t delete_payload,
00095 const unsigned int branches);
00096
00097
00110 int dtrie_insert(struct dtrie_node_t *root, const char *number, const unsigned int numberlen,
00111 void *data, const unsigned int dtrie_size);
00112
00113
00120 unsigned int dtrie_size(const struct dtrie_node_t *root, const unsigned int branches);
00121
00122
00131 unsigned int dtrie_loaded_nodes(const struct dtrie_node_t *root, const unsigned int branches);
00132
00133
00143 unsigned int dtrie_leaves(const struct dtrie_node_t *root, const unsigned int branches);
00144
00145
00158 void **dtrie_longest_match(struct dtrie_node_t *root, const char *number,
00159 const unsigned int numberlen, int *nmatchptr, const unsigned int branches);
00160
00161
00170 void **dtrie_contains(struct dtrie_node_t *root, const char *number,
00171 const unsigned int numberlen, const unsigned int branches);
00172
00173
00174 #endif