~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: 2009-04-29 15:24:31 UTC
  • mfrom: (1.2.1 upstream) (3.1.1 karmic)
  • Revision ID: james.westby@ubuntu.com-20090429152431-8zmxgfvir3mrog08
* Use complete sentences in libdatrie1 long description. (Closes: #525806)
* New upstream release, fixing builds on non-GNU systems.
* Remove duplicated field "section" for libdatrie1 [lintian].

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
#ifndef __ALPHA_MAP_H
9
9
#define __ALPHA_MAP_H
10
10
 
 
11
#include <stdio.h>
 
12
 
11
13
#include "typedefs.h"
12
14
#include "triedefs.h"
13
15
 
14
 
typedef uint16  UniChar;
15
 
 
16
 
#define UNI_CHAR_ERROR   (~(UniChar)0)
17
 
 
 
16
/**
 
17
 * @file alpha-map.h
 
18
 * @brief AlphaMap data type and functions
 
19
 */
 
20
 
 
21
/**
 
22
 * @brief AlphaMap data type
 
23
 */
18
24
typedef struct _AlphaMap    AlphaMap;
19
25
 
20
 
AlphaMap *  alpha_map_open (const char *path,
21
 
                            const char *name,
22
 
                            const char *ext);
23
 
 
 
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
AlphaMap *  alpha_map_new ();
 
37
 
 
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
AlphaMap *  alpha_map_clone (const AlphaMap *a_map);
 
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
 */
24
56
void        alpha_map_free (AlphaMap *alpha_map);
25
57
 
26
 
TrieChar    alpha_map_char_to_alphabet (const AlphaMap *alpha_map, UniChar uc);
27
 
 
28
 
UniChar     alpha_map_alphabet_to_char (const AlphaMap *alpha_map, TrieChar tc);
29
 
 
 
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
int         alpha_map_add_range (AlphaMap  *alpha_map,
 
69
                                 AlphaChar  begin,
 
70
                                 AlphaChar  end);
 
71
 
 
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
int         alpha_char_strlen (const AlphaChar *str);
30
80
 
31
81
#endif /* __ALPHA_MAP_H */
32
82