1
1
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3
* libdatrie - Double-Array Trie Library
4
* Copyright (C) 2006 Theppitak Karoonboonyanan <thep@linux.thai.net>
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.
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.
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
3
22
* alpha-map.h - map between character codes and trie alphabet
4
23
* Created: 2006-08-19
5
24
* Author: Theppitak Karoonboonyanan <thep@linux.thai.net>
24
43
typedef struct _AlphaMap AlphaMap;
27
* @brief Create new alphabet map
29
* @return a pointer to the newly created alphabet map, NULL on failure
31
* Create a new empty alphabet map. The map contents can then be added with
32
* alpha_map_add_range().
34
* The created object must be freed with alpha_map_free().
36
45
AlphaMap * alpha_map_new ();
39
* @brief Create a clone of alphabet map
41
* @param a_map : the source alphabet map to clone
43
* @return a pointer to the alphabet map clone, NULL on failure
45
* The created object must be freed with alpha_map_free().
47
47
AlphaMap * alpha_map_clone (const AlphaMap *a_map);
50
* @brief Free an alphabet map object
52
* @param alpha_map : the alphabet map object to free
54
* Destruct the @a alpha_map and free its allocated memory.
56
49
void alpha_map_free (AlphaMap *alpha_map);
59
* @brief Add a range to alphabet map
61
* @param alpha_map : the alphabet map object
62
* @param begin : the first character of the range
63
* @param end : the last character of the range
65
* Add a range of character codes from @a begin to @a end to the
68
51
int alpha_map_add_range (AlphaMap *alpha_map,
73
* @brief Alphabet string length
75
* @param str : the array of null-terminated AlphaChar string to measure
77
* @return the total characters in @a str.
79
55
int alpha_char_strlen (const AlphaChar *str);
81
57
#endif /* __ALPHA_MAP_H */