Tizen 2.1 base
[external/enchant.git] / src / pwl.h
1 /* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /* enchant
3  * Copyright (C) 2003 Dom Lachowicz
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the
17  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18  * Boston, MA 02110-1301, USA.
19  *
20  * In addition, as a special exception, Dom Lachowicz
21  * gives permission to link the code of this program with
22  * non-LGPL Spelling Provider libraries (eg: a MSFT Office
23  * spell checker backend) and distribute linked combinations including
24  * the two.  You must obey the GNU Lesser General Public License in all
25  * respects for all of the code used other than said providers.  If you modify
26  * this file, you may extend this exception to your version of the
27  * file, but you are not obligated to do so.  If you do not wish to
28  * do so, delete this exception statement from your version.
29  */
30
31 #ifndef PWL_H
32 #define PWL_H
33
34 #include "enchant.h"
35
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39
40 typedef struct str_enchant_pwl EnchantPWL;
41
42 /* Create and initialise a new, empty PWL */
43 EnchantPWL* enchant_pwl_init(void);
44 EnchantPWL* enchant_pwl_init_with_file(const char * file);
45
46 void enchant_pwl_add(EnchantPWL * me, const char *const word, size_t len);
47 void enchant_pwl_remove(EnchantPWL * me, const char *const word, size_t len);
48 int enchant_pwl_check(EnchantPWL * me,const char *const word, size_t len);
49 /*gives the best set of suggestions from pwl that are at least as good as the given suggs*/
50 char** enchant_pwl_suggest(EnchantPWL *me,const char *const word,
51                            size_t len, const char*const*const suggs, size_t* out_n_suggs);
52 void enchant_pwl_free(EnchantPWL* me);
53 void enchant_pwl_free_string_list(EnchantPWL* me, char** string_list);
54
55 #ifdef __cplusplus
56 }
57 #endif
58
59 #endif /* PWL_H */