1 /* ################################################################### */
2 /* Copyright 2015, Pierre Gentile (p.gen.progs@gmail.com) */
4 /* This Source Code Form is subject to the terms of the Mozilla Public */
5 /* License, v. 2.0. If a copy of the MPL was not distributed with this */
6 /* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
7 /* ################################################################### */
12 /* *************************************** */
13 /* Ternary Search Tree specific structures */
14 /* *************************************** */
16 typedef struct tst_node_s tst_node_t
;
17 typedef struct sub_tst_s sub_tst_t
;
19 #if 0 /* here for coherency but not used. */
20 void tst_cleanup(tst_node_t
* p
);
24 tst_insert(tst_node_t
*p
, wchar_t *w
, void *data
);
27 tst_prefix_search(tst_node_t
*root
, wchar_t *w
, int (*callback
)(void *));
30 tst_search(tst_node_t
*root
, wchar_t *w
);
33 tst_traverse(tst_node_t
*p
, int (*callback
)(void *), int first_call
);
36 tst_substring_traverse(tst_node_t
*p
,
37 int (*callback
)(void *),
41 tst_fuzzy_traverse(tst_node_t
*p
,
42 int (*callback
)(void *),
50 insert_sorted_ptr(tst_node_t
***array
,
55 /* Ternary node structure */
56 /* """""""""""""""""""""" */
59 tst_node_t
*lokid
, *eqkid
, *hikid
;
64 /* Structure to contain data and metadata attached to a fuzzy/substring. */
66 /* """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" */