~aleteoryx/sexchat

ref: 42778e105caee9ee8a287b34b7d87d81331455dc sexchat/src/fe-gtk/enchant.h -rw-r--r-- 2.6 KiB
42778e10Aleteoryx restrict self-sent CTCP handling 4 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/*
 * common/enchant.h - Enchant Library Runtime Loading
 *
 * Copyright (C) 2004-2006 Christian Hammond.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the
 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
 */

struct EnchantDict;
struct EnchantBroker;

typedef void (*EnchantDictDescribeFn) (const char * const lang_tag,
                                       const char * const provider_name,
                                       const char * const provider_desc,
                                       const char * const provider_file,
                                       void * user_data);
                                       

extern struct EnchantBroker * (*enchant_broker_init) (void);
extern void (*enchant_broker_free) (struct EnchantBroker * broker);
extern void (*enchant_broker_free_dict) (struct EnchantBroker * broker, struct EnchantDict * dict);
extern void (*enchant_broker_list_dicts) (struct EnchantBroker * broker, EnchantDictDescribeFn fn, void * user_data);
extern struct EnchantDict * (*enchant_broker_request_dict) (struct EnchantBroker * broker, const char *const tag);

extern void (*enchant_dict_add_to_personal) (struct EnchantDict * dict, const char *const word, ssize_t len);
extern void (*enchant_dict_add_to_session) (struct EnchantDict * dict, const char *const word, ssize_t len);
extern int (*enchant_dict_check) (struct EnchantDict * dict, const char *const word, ssize_t len);
extern void (*enchant_dict_describe) (struct EnchantDict * dict, EnchantDictDescribeFn fn, void * user_data);
extern void (*enchant_dict_free_suggestions) (struct EnchantDict * dict, char **suggestions);
extern void (*enchant_dict_store_replacement) (struct EnchantDict * dict, const char *const mis, ssize_t mis_len, const char *const cor, ssize_t cor_len);
extern char ** (*enchant_dict_suggest) (struct EnchantDict * dict, const char *const word, ssize_t len, size_t * out_n_suggs);

gboolean have_enchant (void);
void initialize_enchant (void);
gchar *enchant_get_lang_from_dict (struct EnchantDict *dict);