17 |
/* along with this program; if not, write to the Free Software */ |
/* along with this program; if not, write to the Free Software */ |
18 |
/* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ |
/* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ |
19 |
|
|
|
/* $Id$ */ |
|
|
|
|
20 |
/** |
/** |
21 |
* \file dic.h |
* \file dic.h |
22 |
* \brief Dawg dictionary |
* \brief Dawg dictionary |
27 |
#ifndef _DIC_H_ |
#ifndef _DIC_H_ |
28 |
#define _DIC_H_ |
#define _DIC_H_ |
29 |
#if defined(__cplusplus) |
#if defined(__cplusplus) |
30 |
extern "C" |
extern "C" |
31 |
{ |
{ |
32 |
#endif |
#endif |
33 |
|
|
34 |
/** |
/** |
35 |
* different letters in the dictionary |
* different letters in the dictionary |
36 |
*/ |
*/ |
37 |
#define DIC_LETTERS 27 |
#define DIC_LETTERS 27 |
38 |
|
|
39 |
/** |
/** |
40 |
* max length of words (including last \0) |
* max length of words (including last \0) |
41 |
*/ |
*/ |
42 |
#define DIC_WORD_MAX 16 |
#define DIC_WORD_MAX 16 |
43 |
|
|
44 |
typedef struct _Dictionary* Dictionary; |
typedef struct _Dictionary* Dictionary; |
78 |
*/ |
*/ |
79 |
int Dic_word(Dictionary dic, dic_elt_t elt); |
int Dic_word(Dictionary dic, dic_elt_t elt); |
80 |
|
|
81 |
/** |
/** |
82 |
* Returns the root of the dictionary |
* Returns the root of the dictionary |
83 |
* @returns root element |
* @returns root element |
84 |
*/ |
*/ |
106 |
* @params root : starting dictionary node for the search |
* @params root : starting dictionary node for the search |
107 |
* @params pattern : string encoded according to the dictionary codes, |
* @params pattern : string encoded according to the dictionary codes, |
108 |
* the pattern must be null ('\0') terminated |
* the pattern must be null ('\0') terminated |
109 |
* @returns 0 if the string cannot be matched otherwise returns the |
* @returns 0 if the string cannot be matched otherwise returns the |
110 |
* element that results from walking the dictionary according to the |
* element that results from walking the dictionary according to the |
111 |
* pattern |
* pattern |
112 |
*/ |
*/ |
114 |
|
|
115 |
#if defined(__cplusplus) |
#if defined(__cplusplus) |
116 |
} |
} |
117 |
#endif |
#endif |
118 |
#endif /* _DIC_H_ */ |
#endif /* _DIC_H_ */ |