/[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.1 - (hide annotations)
Wed May 14 04:21:41 2025 UTC (10 months ago) by sysadm
Branch: MAIN
Content type: text/x-chdr
Add trie_dict

1 sysadm 1.1 /***************************************************************************
2     trie_dict.h - description
3     -------------------
4     Copyright : (C) 2004-2025 by Leaflet
5     Email : leaflet@leafok.com
6     ***************************************************************************/
7    
8     /***************************************************************************
9     * *
10     * This program is free software; you can redistribute it and/or modify *
11     * it under the terms of the GNU General Public License as published by *
12     * the Free Software Foundation; either version 3 of the License, or *
13     * (at your option) any later version. *
14     * *
15     ***************************************************************************/
16    
17     #ifndef _TRIE_DICT_H_
18     #define _TRIE_DICT_H_
19    
20     #include <stdint.h>
21    
22     #define TRIE_CHILDREN 63 // A-Za-z0-9_
23    
24     struct trie_node_t
25     {
26     int64_t values[TRIE_CHILDREN];
27     int8_t flags[TRIE_CHILDREN];
28     struct trie_node_t *p_nodes[TRIE_CHILDREN];
29     };
30     typedef struct trie_node_t TRIE_NODE;
31    
32     extern TRIE_NODE *trie_dict_create(void);
33     extern void trie_dict_destroy(TRIE_NODE *p_dict);
34    
35     extern int trie_dict_set(TRIE_NODE *p_dict, const char *key, int64_t value);
36     extern int trie_dict_get(TRIE_NODE *p_dict, const char *key, int64_t *p_value);
37     extern int trie_dict_del(TRIE_NODE *p_dict, const char *key);
38    
39     #endif //_TRIE_DICT_H_

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