/[LeafOK_CVS]/lbbs/include/trie_dict.h
ViewVC logotype

Annotation of /lbbs/include/trie_dict.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.12 - (hide annotations)
Sat Nov 22 01:56:59 2025 UTC (3 months, 3 weeks ago) by sysadm
Branch: MAIN
Changes since 1.11: +0 -1 lines
Content type: text/x-chdr
Remove unused function

1 sysadm 1.7 /* SPDX-License-Identifier: GPL-3.0-or-later */
2     /*
3     * trie_dict
4     * - trie-tree based dict feature
5     *
6 sysadm 1.8 * Copyright (C) 2004-2025 Leaflet <leaflet@leafok.com>
7 sysadm 1.7 */
8 sysadm 1.1
9     #ifndef _TRIE_DICT_H_
10     #define _TRIE_DICT_H_
11    
12     #include <stdint.h>
13    
14 sysadm 1.9 enum trie_dict_constant_t
15     {
16     TRIE_CHILDREN = 256,
17     TRIE_MAX_KEY_LEN = 1023,
18     TRIE_NODE_PER_POOL = 5000,
19     };
20 sysadm 1.1
21     struct trie_node_t
22     {
23     int64_t values[TRIE_CHILDREN];
24     int8_t flags[TRIE_CHILDREN];
25     struct trie_node_t *p_nodes[TRIE_CHILDREN];
26     };
27     typedef struct trie_node_t TRIE_NODE;
28    
29 sysadm 1.2 typedef void (*trie_dict_traverse_cb)(const char *, int64_t);
30    
31 sysadm 1.5 extern int trie_dict_init(const char *filename, int node_count_limit);
32 sysadm 1.11 extern void trie_dict_cleanup(void);
33 sysadm 1.4
34     extern int set_trie_dict_shm_readonly(void);
35     extern int detach_trie_dict_shm(void);
36    
37 sysadm 1.1 extern TRIE_NODE *trie_dict_create(void);
38     extern void trie_dict_destroy(TRIE_NODE *p_dict);
39    
40     extern int trie_dict_set(TRIE_NODE *p_dict, const char *key, int64_t value);
41     extern int trie_dict_get(TRIE_NODE *p_dict, const char *key, int64_t *p_value);
42     extern int trie_dict_del(TRIE_NODE *p_dict, const char *key);
43    
44 sysadm 1.2 extern void trie_dict_traverse(TRIE_NODE *p_dict, trie_dict_traverse_cb cb);
45    
46 sysadm 1.5 extern int trie_dict_used_nodes(void);
47    
48 sysadm 1.1 #endif //_TRIE_DICT_H_

webmaster@leafok.com
ViewVC Help
Powered by ViewVC 1.3.0-beta1