Debian Codegraph @

datrie/triedefs.h

raw
1 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * libdatrie - Double-Array Trie Library
4 * Copyright (C) 2006 Theppitak Karoonboonyanan <[email protected]>
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21 /*
22 * triedefs.h - General typedefs for trie
23 * Created: 2006-08-11
24 * Author: Theppitak Karoonboonyanan <[email protected]>
25 */
26
27 #ifndef __TRIEDEFS_H
28 #define __TRIEDEFS_H
29
30 #include <datrie/typedefs.h>
31
32 /**
33 * @file triedefs.h
34 * @brief General typedefs for trie
35 */
36
37 /**
38 * @brief Alphabet character type for use as input/output strings of trie keys
39 */
40 typedef uint32 AlphaChar;
41
42 /**
43 * @brief Error value for alphabet character
44 */
45 #define ALPHA_CHAR_ERROR (~(AlphaChar)0)
46
47 /**
48 * @brief Raw character type mapped into packed set from AlphaChar,
49 * for use in actual trie transition calculations
50 */
51 typedef unsigned char TrieChar;
52 /**
53 * @brief Trie terminator character
54 */
55 #define TRIE_CHAR_TERM '\0'
56 #define TRIE_CHAR_MAX 255
57
58 /**
59 * @brief Type of index into Trie double-array and tail structures
60 */
61 typedef int32 TrieIndex;
62 /**
63 * @brief Trie error index
64 */
65 #define TRIE_INDEX_ERROR 0
66 /**
67 * @brief Maximum trie index value
68 */
69 #define TRIE_INDEX_MAX 0x7fffffff
70
71 /**
72 * @brief Type of value associated to trie entries
73 */
74 typedef int32 TrieData;
75 /**
76 * @brief Trie error data
77 */
78 #define TRIE_DATA_ERROR -1
79
80 #endif /* __TRIEDEFS_H */
81
82 /*
83 vi:ts=4:ai:expandtab
84 */