~ubuntu-branches/ubuntu/precise/libdatrie/precise

« back to all changes in this revision

Viewing changes to datrie/alpha-map.h

  • Committer: Bazaar Package Importer
  • Author(s): Theppitak Karoonboonyanan
  • Date: 2010-02-27 21:09:46 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20100227210946-dayt6gm3m20meucz
* New upstream release.
* Bump Standards-Version to 3.8.4 (no changes needed)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
2
/*
 
3
 * libdatrie - Double-Array Trie Library
 
4
 * Copyright (C) 2006  Theppitak Karoonboonyanan <thep@linux.thai.net>
 
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
/*
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>
23
42
 */
24
43
typedef struct _AlphaMap    AlphaMap;
25
44
 
26
 
/**
27
 
 * @brief Create new alphabet map
28
 
 *
29
 
 * @return a pointer to the newly created alphabet map, NULL on failure
30
 
 *
31
 
 * Create a new empty alphabet map. The map contents can then be added with
32
 
 * alpha_map_add_range().
33
 
 *
34
 
 *  The created object must be freed with alpha_map_free().
35
 
 */
36
45
AlphaMap *  alpha_map_new ();
37
46
 
38
 
/**
39
 
 * @brief Create a clone of alphabet map
40
 
 *
41
 
 * @param a_map : the source alphabet map to clone
42
 
 *
43
 
 * @return a pointer to the alphabet map clone, NULL on failure
44
 
 *
45
 
 *  The created object must be freed with alpha_map_free().
46
 
 */
47
47
AlphaMap *  alpha_map_clone (const AlphaMap *a_map);
48
48
 
49
 
/**
50
 
 * @brief Free an alphabet map object
51
 
 *
52
 
 * @param alpha_map : the alphabet map object to free
53
 
 *
54
 
 * Destruct the @a alpha_map and free its allocated memory.
55
 
 */
56
49
void        alpha_map_free (AlphaMap *alpha_map);
57
50
 
58
 
/**
59
 
 * @brief Add a range to alphabet map
60
 
 *
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
64
 
 *
65
 
 * Add a range of character codes from @a begin to @a end to the
66
 
 * alphabet set.
67
 
 */
68
51
int         alpha_map_add_range (AlphaMap  *alpha_map,
69
52
                                 AlphaChar  begin,
70
53
                                 AlphaChar  end);
71
54
 
72
 
/**
73
 
 * @brief Alphabet string length
74
 
 *
75
 
 * @param str   : the array of null-terminated AlphaChar string to measure
76
 
 *
77
 
 * @return the total characters in @a str.
78
 
 */
79
55
int         alpha_char_strlen (const AlphaChar *str);
80
56
 
81
57
#endif /* __ALPHA_MAP_H */