LibRCC
librcc.h
Go to the documentation of this file.
1 /*
2  LibRCC - public interface
3 
4  Copyright (C) 2005-2008 Suren A. Chilingaryan <csa@dside.dyndns.org>
5 
6  This library is free software; you can redistribute it and/or modify it
7  under the terms of the GNU Lesser General Public License version 2.1 or later
8  as published by the Free Software Foundation.
9 
10  This library is distributed in the hope that it will be useful, but WITHOUT
11  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
13  for more details.
14 
15  You should have received a copy of the GNU Lesser General Public License
16  along with this program; if not, write to the Free Software Foundation, Inc.,
17  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 */
19 
20 #ifndef _LIBRCC_H
21 #define _LIBRCC_H
22 
23 #include <stdlib.h>
24 
25 /*******************************************************************************
26 ***************************** Global Defines ***********************************
27 *******************************************************************************/
28 
29 #define RCC_MAX_CHARSETS 16
30 #define RCC_MAX_ENGINES 5
31 #define RCC_MAX_LANGUAGES 64
32 #define RCC_MAX_ALIASES 64
33 #define RCC_MAX_CLASSES 16
34 
35 /* ID's */
43 typedef unsigned char rcc_language_id;
47 typedef unsigned char rcc_alias_id;
51 typedef unsigned char rcc_relation_id;
58 typedef unsigned char rcc_charset_id;
64 typedef unsigned char rcc_autocharset_id;
71 typedef unsigned char rcc_engine_id;
75 typedef int rcc_class_id;
76 
77 /* Opaque Pointer's */
78 typedef struct rcc_context_t *rcc_context;
86 typedef struct rcc_engine_context_t *rcc_engine_context;
92 typedef struct rcc_language_config_t *rcc_language_config;
93 typedef const struct rcc_class_t *rcc_class_ptr;
94 
95 #ifdef __cplusplus
96 extern "C" {
97 #endif
98 
103 int rccInit();
104 
108 void rccFree();
109 
110 /*******************************************************************************
111 **************************** Initialization ************************************
112 *******************************************************************************/
116 typedef unsigned int rcc_init_flags;
117 
121 #define RCC_FLAG_NO_DEFAULT_CONFIGURATION 1
122 
134 rcc_context rccCreateContext(const char *locale_variable, unsigned int max_languages, unsigned int max_classes, rcc_class_ptr defclasses, rcc_init_flags flags);
147 int rccInitDefaultContext(const char *locale_variable, unsigned int max_languages, unsigned int max_classes, rcc_class_ptr defclasses, rcc_init_flags flags);
148 
155 
156 
160 typedef unsigned int rcc_db4_flags;
161 
171 
172 int rccLockConfiguration(rcc_context ctx, unsigned int lock_code);
173 int rccUnlockConfiguration(rcc_context ctx, unsigned int lock_code);
174 
175 /*******************************************************************************
176 ******************* Altering Language Configuaration ***************************
177 *******************************************************************************/
181 typedef const char *rcc_charset;
186 
187 /* Engines */
191 typedef void *rcc_engine_internal;
208 typedef rcc_autocharset_id (*rcc_engine_function)(rcc_engine_context ctx, const char *buf, int len);
213 
219 struct rcc_engine_t {
220  const char *title;
225 };
226 typedef struct rcc_engine_t rcc_engine;
229 
234  const char *sn;
237 };
238 typedef struct rcc_language_t rcc_language;
241 
247  const char *alias;
248  const char *lang;
249 };
253 
265  const char *lang;
266  const char *parent;
267 };
269 
305 
306 /*******************************************************************************
307 ************************ Altering Configuaration *******************************
308 *******************************************************************************/
312 typedef enum rcc_class_type_t {
321 
326  const char *lang;
327  const char *charset;
328 };
330 
332 #define RCC_CLASS_FLAG_CONST 0x01
333 
334 #define RCC_CLASS_FLAG_SKIP_SAVELOAD 0x02
335 
368 struct rcc_class_t {
369  const char *name;
371  const char *defvalue;
373  const char *fullname;
374  const unsigned long flags;
375 };
376 typedef const struct rcc_class_t rcc_class;
378 
409 int rccIsDisabledCharsetName(rcc_context ctx, rcc_class_id class_id, const char *charset);
410 
424 const char *rccGetClassName(rcc_context ctx, rcc_class_id class_id);
431 const char *rccGetClassFullName(rcc_context ctx, rcc_class_id class_id);
432 
433 /*******************************************************************************
434 ************************ Altering Configuaration *******************************
435 *******************************************************************************/
436 typedef int rcc_option_value;
437 
441 #define RCC_OPTION_LEARNING_FLAG_USE 1
442 
445 #define RCC_OPTION_LEARNING_FLAG_LEARN 2
446 
455 
459 typedef enum rcc_option_t {
472 
476 typedef enum rcc_option_type_t {
481 
492 
496 typedef struct rcc_option_range_t {
502 
503 /* lng.c */
504 
526 const char *rccGetLanguageName(rcc_context ctx, rcc_language_id language_id);
557 const char *rccGetRealLanguageName(rcc_context ctx, rcc_language_id language_id);
589 
590 
606 int rccSetLanguageByName(rcc_context ctx, const char *name);
607 
608 /* opt.c */
658 
665 const char *rccGetOptionName(rcc_option option);
666 
681 rcc_option rccGetOptionByName(const char *name);
690 
691 
692 /* lngconfig.c */
753 
766 
789 
815 
886 
931 
956 int rccConfigSetEngineByName(rcc_language_config config, const char *name);
965 int rccConfigSetCharsetByName(rcc_language_config config, rcc_class_id class_id, const char *name);
966 
974 rcc_charset_id rccConfigGetLocaleCharset(rcc_language_config config, const char *locale_variable);
983 rcc_charset_id rccConfigGetLocaleClassCharset(rcc_language_config config, rcc_class_id class_id, const char *locale_variable);
984 
985 /* curconfig.c */
989 
990 const char *rccGetEngineName(rcc_context ctx, rcc_engine_id engine_id);
991 const char *rccGetCharsetName(rcc_context ctx, rcc_charset_id charset_id);
992 const char *rccGetClassCharsetName(rcc_context ctx, rcc_class_id class_id, rcc_charset_id charset_id);
993 
997 
999 
1008 
1010 int rccSetCharset(rcc_context ctx, rcc_class_id class_id, rcc_charset_id charset_id);
1011 int rccSetEngineByName(rcc_context ctx, const char *name);
1012 int rccSetCharsetByName(rcc_context ctx, rcc_class_id class_id, const char *name);
1013 
1014 rcc_charset_id rccGetLocaleCharset(rcc_context ctx, const char *locale_variable);
1015 rcc_charset_id rccGetLocaleClassCharset(rcc_context ctx, rcc_class_id class_id, const char *locale_variable);
1016 
1017 rcc_autocharset_id rccDetectCharset(rcc_context ctx, rcc_class_id class_id, const char *buf, size_t len);
1018 
1019 /*******************************************************************************
1020 ************************ Language Configuaration *******************************
1021 *******************************************************************************/
1022 
1023 /*******************************************************************************
1024 ************************ RCC_STRING Manipulations ******************************
1025 *******************************************************************************/
1026 /* string.c */
1032 typedef char *rcc_string;
1038 typedef const char *rcc_const_string;
1039 
1045 size_t rccStringCheck(const char *str);
1053 size_t rccStringSizedCheck(const char *str, size_t len);
1054 
1076 
1084 const char *rccGetString(const char *str);
1093 const char *rccSizedGetString(const char *str, size_t len);
1094 
1095 int rccStringCmp(const char *str1, const char *str2);
1096 int rccStringNCmp(const char *str1, const char *str2, size_t n);
1097 int rccStringCaseCmp(const char *str1, const char *str2);
1098 int rccStringNCaseCmp(const char *str1, const char *str2, size_t n);
1099 
1100 /*******************************************************************************
1101 ******************************** Recoding **************************************
1102 *******************************************************************************/
1103 /* rcciconv.c */
1104 
1108 typedef struct rcc_iconv_t *rcc_iconv;
1109 
1119 rcc_iconv rccIConvOpen(const char *from, const char *to);
1134 char *rccIConv(rcc_iconv icnv, const char *buf, size_t len, size_t *rlen);
1135 
1136 /* rcctranslate.c */
1137 
1141 typedef struct rcc_translate_t *rcc_translate;
1142 
1152 rcc_translate rccTranslateOpen(const char *from, const char *to);
1159 
1160 /*
1161  * Set translation timeout
1162  *
1163  * @param translate is translating context
1164  * @param us is timeout in microseconds (0 - no timeout)
1165  * @return non-zero value is returned in the case of errror
1166  */
1167 int rccTranslateSetTimeout(rcc_translate translate, unsigned long us);
1168 
1169 /*
1170  * Allows translation engine to perform pending task after the main program is
1171  * being terminated
1172  *
1173  * @param translate is translating context
1174  * @return non-zero value is returned in the case of errror
1175  */
1177 
1185 char *rccTranslate(rcc_translate translate, const char *buf);
1186 
1187 
1188 /* rccspell.c */
1189 
1193 typedef struct rcc_speller_t *rcc_speller;
1194 
1198 typedef enum rcc_speller_result_t {
1205 
1209 
1218 rcc_speller rccSpellerCreate(const char *lang);
1240 rcc_speller_result rccSpeller(rcc_speller speller, const char *word);
1241 
1242 /* recode.c */
1243 
1252 rcc_language_id rccDetectLanguage(rcc_context ctx, rcc_class_id class_id, const char *buf, size_t len);
1253 
1262 rcc_autocharset_id rccConfigDetectCharset(rcc_language_config config, rcc_class_id class_id, const char *buf, size_t len);
1263 
1275 rcc_string rccSizedFrom(rcc_context ctx, rcc_class_id class_id, const char *buf, size_t len);
1287 char *rccSizedTo(rcc_context ctx, rcc_class_id class_id, rcc_const_string buf, size_t *rlen);
1302 char *rccSizedRecode(rcc_context ctx, rcc_class_id from, rcc_class_id to, const char *buf, size_t len, size_t *rlen);
1322 char *rccFS(rcc_context ctx, rcc_class_id from, rcc_class_id to, const char *fspath, const char *path, const char *filename);
1323 
1333 rcc_string rccSizedFromCharset(rcc_context ctx, const char *charset, const char *buf, size_t len);
1343 char *rccSizedToCharset(rcc_context ctx, const char *charset, rcc_const_string buf, size_t *rlen);
1358 char *rccSizedRecodeToCharset(rcc_context ctx, rcc_class_id class_id, const char *charset, rcc_const_string buf, size_t len, size_t *rlen);
1373 rcc_string rccSizedRecodeFromCharset(rcc_context ctx, rcc_class_id class_id, const char *charset, const char *buf, size_t len, size_t *rlen);
1385 char *rccSizedRecodeCharsets(rcc_context ctx, const char *from, const char *to, const char *buf, size_t len, size_t *rlen);
1386 
1387 
1399 rcc_string rccConfigSizedFrom(rcc_language_config config, rcc_class_id class_id, const char *buf, size_t len);
1411 char *rccConfigSizedTo(rcc_language_config config, rcc_class_id class_id, rcc_const_string buf, size_t *rlen);
1426 char *rccConfigSizedRecode(rcc_language_config config, rcc_class_id from, rcc_class_id to, const char *buf, size_t len, size_t *rlen);
1438 rcc_string rccConfigSizedRecodeFromCharset(rcc_language_config config, rcc_class_id class_id, const char *charset, const char *buf, size_t len, size_t *rlen);
1450 char *rccConfigSizedRecodeToCharset(rcc_language_config config, rcc_class_id class_id, const char *charset, rcc_const_string buf, size_t len, size_t *rlen);
1451 
1452 
1453 #define rccFrom(ctx, class_id, buf) rccSizedFrom(ctx, class_id, buf, 0)
1454 #define rccTo(ctx, class_id, buf) rccSizedTo(ctx, class_id, buf, NULL)
1455 #define rccRecode(ctx, from, to, buf) rccSizedRecode(ctx, from, to, buf, 0, NULL)
1456 
1457 #define rccFromCharset(ctx, charset, buf) rccSizedFromCharset(ctx, charset, buf, 0)
1458 #define rccToCharset(ctx, charset, buf) rccSizedToCharset(ctx, charset, buf, NULL)
1459 #define rccRecodeToCharset(ctx, class_id, charset, buf) rccSizedRecodeToCharset(ctx, class_id, charset, buf, 0, NULL)
1460 #define rccRecodeFromCharset(ctx, class_id, charset, buf) rccSizedRecodeFromCharset(ctx, class_id, charset, buf, 0, NULL)
1461 #define rccRecodeCharsets(ctx, from, to, buf) rccSizedRecodeCharsets(ctx, from, to, buf, 0, NULL)
1462 
1463 #define rccConfigFrom(ctx, class_id, buf) rccConfigSizedFrom(ctx, class_id, buf, 0)
1464 #define rccConfigTo(ctx, class_id, buf) rccConfigSizedTo(ctx, class_id, buf, NULL)
1465 #define rccConfigRecode(ctx, from, to, buf) rccConfigSizedRecode(ctx, from, to, buf, 0, NULL)
1466 #define rccConfigRecodeToCharset(ctx, class_id, charset, buf) rccConfigSizedRecodeToCharset(ctx, class_id, charset, buf, 0, NULL)
1467 #define rccConfigRecodeFromCharset(ctx, class_id, charset, buf) rccConfigSizedRecodeFromCharset(ctx, class_id, charset, buf, 0, NULL)
1468 
1469 /*******************************************************************************
1470 ******************************** Options ***************************************
1471 *******************************************************************************/
1472 
1473 /* xml.c */
1474 typedef void *rcc_config;
1476 
1484 int rccSave(rcc_context ctx, const char *name);
1492 int rccLoad(rcc_context ctx, const char *name);
1493 
1494 /*******************************************************************************
1495 **************************** Engine Plugins ************************************
1496 *******************************************************************************/
1497 
1498 typedef rcc_engine *(*rcc_plugin_engine_info_function)(const char *lang);
1499 
1505 
1506 
1507 /*******************************************************************************
1508 **************************** Configuration *************************************
1509 *******************************************************************************/
1510 
1514 #define RCC_CC_FLAG_HAVE_BERKLEY_DB 0x01
1515 
1518 #define RCC_CC_FLAG_HAVE_DYNAMIC_ENGINES 0x02
1519 
1522 #define RCC_CC_FLAG_HAVE_ENCA 0x04
1523 
1526 #define RCC_CC_FLAG_HAVE_RCD 0x08
1527 
1530 #define RCC_CC_FLAG_HAVE_LIBTRANSLATE 0x10
1531 
1536  unsigned long flags;
1537 };
1540 
1545 
1546 int rccLocaleGetClassByName(const char *locale);
1547 int rccLocaleGetLanguage(char *result, const char *lv, unsigned int n);
1548 int rccLocaleGetCharset(char *result, const char *lv, unsigned int n);
1549 
1550 
1554 #define RCC_OPTION_TRANSLATE_SKIP_PARRENT RCC_OPTION_TRANSLATE_SKIP_PARENT
1555 #define RCC_SPELLER_ALMOST_PARRENT RCC_SPELLER_ALMOST_PARENT
1556 #define RCC_SPELLER_PARRENT RCC_SPELLER_PARENT
1557 #define rccSpellerAddParrent rccSpellerAddParent
1558 
1559 #ifdef __cplusplus
1560 }
1561 #endif
1562 
1563 #endif /* _LIBRCC_H */
RCC_SPELLER_PARENT
@ RCC_SPELLER_PARENT
Definition: librcc.h:1202
rcc_engine_id
unsigned char rcc_engine_id
Definition: librcc.h:71
rcc_engine_ptr
rcc_engine * rcc_engine_ptr
Definition: librcc.h:227
rccInitDefaultContext
int rccInitDefaultContext(const char *locale_variable, unsigned int max_languages, unsigned int max_classes, rcc_class_ptr defclasses, rcc_init_flags flags)
rccGetClassCharsetByName
rcc_charset_id rccGetClassCharsetByName(rcc_context ctx, rcc_class_id class_id, const char *name)
rccEngineGetInternal
rcc_engine_internal rccEngineGetInternal(rcc_engine_context ctx)
rccOptionIsDefault
int rccOptionIsDefault(rcc_context ctx, rcc_option option)
rcc_option
enum rcc_option_t rcc_option
rccConfigGetEngineByName
rcc_engine_id rccConfigGetEngineByName(rcc_language_config config, const char *name)
rccGetLocaleCharset
rcc_charset_id rccGetLocaleCharset(rcc_context ctx, const char *locale_variable)
rccConfigGetCharsetNumber
int rccConfigGetCharsetNumber(rcc_language_config config)
RCC_OPTION_TRANSLATE_TRANSLITERATE
@ RCC_OPTION_TRANSLATE_TRANSLITERATE
Definition: librcc.h:449
rccTo
#define rccTo(ctx, class_id, buf)
Definition: librcc.h:1454
rcc_class_ptr
const struct rcc_class_t * rcc_class_ptr
Definition: librcc.h:93
rccConfigGetEngineName
const char * rccConfigGetEngineName(rcc_language_config config, rcc_engine_id engine_id)
rccGetString
const char * rccGetString(const char *str)
rccGetCurrentEngine
rcc_engine_id rccGetCurrentEngine(rcc_context ctx)
rcc_context
struct rcc_context_t * rcc_context
Definition: librcc.h:78
rccGetOptionByName
rcc_option rccGetOptionByName(const char *name)
rccConfigSetEngine
int rccConfigSetEngine(rcc_language_config config, rcc_engine_id engine_id)
rcc_language_t::engines
rcc_engine_list engines
Definition: librcc.h:236
rcc_class_t::class_type
const rcc_class_type class_type
Definition: librcc.h:370
main
int main(int argc, char *argv[])
Definition: example2.c:28
rccSetCharsetByName
int rccSetCharsetByName(rcc_context ctx, rcc_class_id class_id, const char *name)
rcc_iconv
struct rcc_iconv_t * rcc_iconv
Definition: librcc.h:1108
rcc_class_list
rcc_class_ptr rcc_class_list[RCC_MAX_CLASSES+1]
Definition: librcc.h:377
RCC_OPTION_TRANSLATE_SKIP_RELATED
@ RCC_OPTION_TRANSLATE_SKIP_RELATED
Definition: librcc.h:451
rccGetUsableConfig
rcc_language_config rccGetUsableConfig(rcc_context ctx, rcc_language_id language_id)
rccSetCharset
int rccSetCharset(rcc_context ctx, rcc_class_id class_id, rcc_charset_id charset_id)
rcc_language_t::sn
const char * sn
Definition: librcc.h:234
rccSizedTo
char * rccSizedTo(rcc_context ctx, rcc_class_id class_id, rcc_const_string buf, size_t *rlen)
rcc_language_config
struct rcc_language_config_t * rcc_language_config
Definition: librcc.h:92
rccIConvClose
void rccIConvClose(rcc_iconv icnv)
rcc_language_list
rcc_language_ptr rcc_language_list[RCC_MAX_LANGUAGES+1]
Definition: librcc.h:240
rcc_option_range_type_t
rcc_option_range_type_t
Definition: librcc.h:485
RCC_OPTION_TRANSLATE_FULL
@ RCC_OPTION_TRANSLATE_FULL
Definition: librcc.h:453
rcc_option_range_t::min
rcc_option_value min
Definition: librcc.h:498
rccStringGetString
const char * rccStringGetString(rcc_const_string str)
rccGetLanguageName
const char * rccGetLanguageName(rcc_context ctx, rcc_language_id language_id)
rcc_language_alias_t
Definition: librcc.h:246
rccStringCaseCmp
int rccStringCaseCmp(const char *str1, const char *str2)
RCC_MAX_ENGINES
#define RCC_MAX_ENGINES
Definition: librcc.h:30
rccOptionGetRange
rcc_option_range * rccOptionGetRange(rcc_context ctx, rcc_option option)
rcc_language_relation_t
Definition: librcc.h:264
RCC_CLASS_TRANSLATE_FROM
@ RCC_CLASS_TRANSLATE_FROM
Definition: librcc.h:319
RCC_OPTION_TRANSLATE_SKIP_PARENT
@ RCC_OPTION_TRANSLATE_SKIP_PARENT
Definition: librcc.h:452
rccGetCurrentLanguage
rcc_language_id rccGetCurrentLanguage(rcc_context ctx)
rcc_class_t::defcharset
rcc_class_default_charset * defcharset
Definition: librcc.h:372
rccTranslateOpen
rcc_translate rccTranslateOpen(const char *from, const char *to)
rccFrom
#define rccFrom(ctx, class_id, buf)
Definition: librcc.h:1453
rccSetEngineByName
int rccSetEngineByName(rcc_context ctx, const char *name)
RCC_OPTION_CONFIGURED_LANGUAGES_ONLY
@ RCC_OPTION_CONFIGURED_LANGUAGES_ONLY
Definition: librcc.h:463
rcc_db4_flags
unsigned int rcc_db4_flags
Definition: librcc.h:160
rcc_option_range_t::max
rcc_option_value max
Definition: librcc.h:499
RCC_MAX_ALIASES
#define RCC_MAX_ALIASES
Definition: librcc.h:32
rccConfigGetCurrentCharsetName
const char * rccConfigGetCurrentCharsetName(rcc_language_config config, rcc_class_id class_id)
rcc_engine_function
rcc_autocharset_id(* rcc_engine_function)(rcc_engine_context ctx, const char *buf, int len)
Definition: librcc.h:208
RCC_CLASS_TRANSLATE_CURRENT
@ RCC_CLASS_TRANSLATE_CURRENT
Definition: librcc.h:318
rccRegisterAdditionalCharsets
int rccRegisterAdditionalCharsets(rcc_context ctx, rcc_class_id class_id, rcc_charset *charsets)
RCC_OPTION_TRANSLATE
@ RCC_OPTION_TRANSLATE
Definition: librcc.h:466
rcc_speller
struct rcc_speller_t * rcc_speller
Definition: librcc.h:1193
rcc_relation_id
unsigned char rcc_relation_id
Definition: librcc.h:51
RCC_OPTION_TYPE_INVISIBLE
@ RCC_OPTION_TYPE_INVISIBLE
Definition: librcc.h:477
rcc_language_relation_t::lang
const char * lang
Definition: librcc.h:265
rccStringSizedCheck
size_t rccStringSizedCheck(const char *str, size_t len)
RCC_CLASS_INVALID
@ RCC_CLASS_INVALID
Definition: librcc.h:313
rccGetOptionName
const char * rccGetOptionName(rcc_option option)
rccTranslateClose
void rccTranslateClose(rcc_translate translate)
rccGetClassCharsetNumber
int rccGetClassCharsetNumber(rcc_context ctx, rcc_class_id class_id)
rccLocaleGetLanguage
int rccLocaleGetLanguage(char *result, const char *lv, unsigned int n)
rccFreeContext
void rccFreeContext(rcc_context ctx)
rccLanguageRegisterCharset
rcc_charset_id rccLanguageRegisterCharset(rcc_language *language, rcc_charset charset)
RCC_OPTION_RANGE_TYPE_RANGE
@ RCC_OPTION_RANGE_TYPE_RANGE
Definition: librcc.h:487
rccConfigIsDisabledCharset
int rccConfigIsDisabledCharset(rcc_language_config config, rcc_class_id class_id, rcc_charset_id charset_id)
RCC_CLASS_FS
@ RCC_CLASS_FS
Definition: librcc.h:316
rcc_language_t
Definition: librcc.h:233
rccConfigGetClassCharsetNumber
int rccConfigGetClassCharsetNumber(rcc_language_config config, rcc_class_id class_id)
rccRegisterLanguageAlias
rcc_alias_id rccRegisterLanguageAlias(rcc_context ctx, rcc_language_alias *alias)
rccGetCurrentCharset
rcc_charset_id rccGetCurrentCharset(rcc_context ctx, rcc_class_id class_id)
RCC_OPTION_AUTOENGINE_SET_CURRENT
@ RCC_OPTION_AUTOENGINE_SET_CURRENT
Definition: librcc.h:464
rccSpellerFree
void rccSpellerFree(rcc_speller speller)
rcc_config
void * rcc_config
Definition: librcc.h:1474
rcc_language_t::charsets
rcc_charset_list charsets
Definition: librcc.h:235
rccLocaleGetCharset
int rccLocaleGetCharset(char *result, const char *lv, unsigned int n)
rccCheckConfig
rcc_language_config rccCheckConfig(rcc_context ctx, rcc_language_id language_id)
RCC_OPTION_AUTODETECT_LANGUAGE
@ RCC_OPTION_AUTODETECT_LANGUAGE
Definition: librcc.h:465
rccConfigGetCurrentEngineName
const char * rccConfigGetCurrentEngineName(rcc_language_config config)
rcc_class_id
int rcc_class_id
Definition: librcc.h:75
rccSizedFromCharset
rcc_string rccSizedFromCharset(rcc_context ctx, const char *charset, const char *buf, size_t len)
rccIConv
char * rccIConv(rcc_iconv icnv, const char *buf, size_t len, size_t *rlen)
rcc_class_t::defvalue
const char * defvalue
Definition: librcc.h:371
RCC_SPELLER_ALMOST_CORRECT
@ RCC_SPELLER_ALMOST_CORRECT
Definition: librcc.h:1201
rccTranslate
char * rccTranslate(rcc_translate translate, const char *buf)
rccConfigSetCharsetByName
int rccConfigSetCharsetByName(rcc_language_config config, rcc_class_id class_id, const char *name)
rccEngineGetInfo
rcc_engine * rccEngineGetInfo(rcc_engine_context ctx)
RCC_OPTION_RANGE_TYPE_FLAGS
@ RCC_OPTION_RANGE_TYPE_FLAGS
Definition: librcc.h:488
rccSetLanguage
int rccSetLanguage(rcc_context ctx, rcc_language_id language_id)
rcc_engine_list
rcc_engine_ptr rcc_engine_list[RCC_MAX_ENGINES+1]
Definition: librcc.h:228
rcc_speller_result_t
rcc_speller_result_t
Definition: librcc.h:1198
rccOptionGetType
rcc_option_type rccOptionGetType(rcc_context ctx, rcc_option option)
rccSetEngine
int rccSetEngine(rcc_context ctx, rcc_engine_id engine_id)
rcc_engine_t::func
rcc_engine_function func
Definition: librcc.h:223
rccGetConfig
rcc_language_config rccGetConfig(rcc_context ctx, rcc_language_id language_id)
rccLoad
int rccLoad(rcc_context ctx, const char *name)
rcc_option_range
struct rcc_option_range_t rcc_option_range
rccGetOption
rcc_option_value rccGetOption(rcc_context ctx, rcc_option option)
rccConfigGetSelectedCharset
rcc_charset_id rccConfigGetSelectedCharset(rcc_language_config config, rcc_class_id class_id)
rcc_option_range_type
enum rcc_option_range_type_t rcc_option_range_type
RCC_MAX_CHARSETS
#define RCC_MAX_CHARSETS
Definition: librcc.h:29
rccGetLanguageByName
rcc_language_id rccGetLanguageByName(rcc_context ctx, const char *name)
rcc_engine_t::charsets
rcc_charset_list charsets
Definition: librcc.h:224
rccSizedRecode
char * rccSizedRecode(rcc_context ctx, rcc_class_id from, rcc_class_id to, const char *buf, size_t len, size_t *rlen)
rcc_class_type_t
rcc_class_type_t
Definition: librcc.h:312
rcc_language_alias_list
rcc_language_alias_ptr rcc_language_alias_list[RCC_MAX_ALIASES+1]
Definition: librcc.h:252
rcc_engine_internal
void * rcc_engine_internal
Definition: librcc.h:191
rcc_engine_context
struct rcc_engine_context_t * rcc_engine_context
Definition: librcc.h:86
rccConfigGetCurrentCharset
rcc_charset_id rccConfigGetCurrentCharset(rcc_language_config config, rcc_class_id class_id)
rccConfigSetEngineByName
int rccConfigSetEngineByName(rcc_language_config config, const char *name)
RCC_OPTION_TRANSLATE_TO_ENGLISH
@ RCC_OPTION_TRANSLATE_TO_ENGLISH
Definition: librcc.h:450
rccGetSelectedCharsetName
const char * rccGetSelectedCharsetName(rcc_context ctx, rcc_class_id class_id)
rccRecode
#define rccRecode(ctx, from, to, buf)
Definition: librcc.h:1455
rccGetCurrentConfig
rcc_language_config rccGetCurrentConfig(rcc_context ctx)
RCC_CLASS_TRANSLATE_LOCALE
@ RCC_CLASS_TRANSLATE_LOCALE
Definition: librcc.h:317
rccRegisterClass
rcc_class_id rccRegisterClass(rcc_context ctx, rcc_class *cl)
rccConfigGetClassCharsetName
const char * rccConfigGetClassCharsetName(rcc_language_config config, rcc_class_id class_id, rcc_charset_id charset_id)
rccStringCmp
int rccStringCmp(const char *str1, const char *str2)
rcc_language_alias_t::lang
const char * lang
Definition: librcc.h:248
RCC_MAX_LANGUAGES
#define RCC_MAX_LANGUAGES
Definition: librcc.h:31
rccGetCompiledConfiguration
rcc_compiled_configuration rccGetCompiledConfiguration()
rcc_language_id
unsigned char rcc_language_id
Definition: librcc.h:43
rccGetConfiguration
rcc_config rccGetConfiguration()
rcc_translate
struct rcc_translate_t * rcc_translate
Definition: librcc.h:1141
rcc_engine_t::title
const char * title
Definition: librcc.h:220
rcc_language_alias_ptr
rcc_language_alias * rcc_language_alias_ptr
Definition: librcc.h:251
rccGetConfigByName
rcc_language_config rccGetConfigByName(rcc_context ctx, const char *name)
RCC_CLASS_STANDARD
@ RCC_CLASS_STANDARD
Definition: librcc.h:314
rccConfigGetSelectedEngineName
const char * rccConfigGetSelectedEngineName(rcc_language_config config)
rccGetClassName
const char * rccGetClassName(rcc_context ctx, rcc_class_id class_id)
rcc_class_t::flags
const unsigned long flags
Definition: librcc.h:374
rccGetClassNumber
int rccGetClassNumber(rcc_context ctx)
rccConfigGetCurrentEngine
rcc_engine_id rccConfigGetCurrentEngine(rcc_language_config config)
RCC_OPTION_ALL
@ RCC_OPTION_ALL
Definition: librcc.h:470
rccSpellerResultIsPrecise
int rccSpellerResultIsPrecise(rcc_speller_result res)
rccStringNCaseCmp
int rccStringNCaseCmp(const char *str1, const char *str2, size_t n)
rccIsDisabledCharsetName
int rccIsDisabledCharsetName(rcc_context ctx, rcc_class_id class_id, const char *charset)
RCC_OPTION_AUTODETECT_FS_NAMES
@ RCC_OPTION_AUTODETECT_FS_NAMES
Definition: librcc.h:462
rccRegisterLanguage
rcc_language_id rccRegisterLanguage(rcc_context ctx, rcc_language *language)
rccGetEngineNumber
int rccGetEngineNumber(rcc_context ctx)
rccGetCharsetName
const char * rccGetCharsetName(rcc_context ctx, rcc_charset_id charset_id)
rccSizedRecodeFromCharset
rcc_string rccSizedRecodeFromCharset(rcc_context ctx, rcc_class_id class_id, const char *charset, const char *buf, size_t len, size_t *rlen)
rccIsDisabledCharset
int rccIsDisabledCharset(rcc_context ctx, rcc_class_id class_id, rcc_charset_id charset_id)
rcc_option_t
rcc_option_t
Definition: librcc.h:459
rcc_option_range_t::type
rcc_option_range_type type
Definition: librcc.h:497
rccGetLanguageNumber
int rccGetLanguageNumber(rcc_context ctx)
rccFree
void rccFree()
rccGetOptionValueByName
rcc_option_value rccGetOptionValueByName(rcc_option option, const char *name)
rccEngineGetAutoCharsetByName
rcc_autocharset_id rccEngineGetAutoCharsetByName(rcc_engine_context ctx, const char *name)
RCC_SPELLER_INCORRECT
@ RCC_SPELLER_INCORRECT
Definition: librcc.h:1199
rccGetSelectedLanguage
rcc_language_id rccGetSelectedLanguage(rcc_context ctx)
rccStringExtractString
char * rccStringExtractString(rcc_const_string str)
rccDetectLanguage
rcc_language_id rccDetectLanguage(rcc_context ctx, rcc_class_id class_id, const char *buf, size_t len)
rccLockConfiguration
int rccLockConfiguration(rcc_context ctx, unsigned int lock_code)
rcc_engine_t::init_func
rcc_engine_init_function init_func
Definition: librcc.h:221
rcc_class_default_charset_t
Definition: librcc.h:325
rccStringGetLanguage
rcc_language_id rccStringGetLanguage(rcc_const_string str)
rcc_speller_result
enum rcc_speller_result_t rcc_speller_result
rcc_engine_t::free_func
rcc_engine_free_function free_func
Definition: librcc.h:222
rccConfigGetSelectedCharsetName
const char * rccConfigGetSelectedCharsetName(rcc_language_config config, rcc_class_id class_id)
rccStringCheck
size_t rccStringCheck(const char *str)
rccGetClassType
rcc_class_type rccGetClassType(rcc_context ctx, rcc_class_id class_id)
rccSizedToCharset
char * rccSizedToCharset(rcc_context ctx, const char *charset, rcc_const_string buf, size_t *rlen)
rcc_engine_free_function
void(* rcc_engine_free_function)(rcc_engine_context ctx)
Definition: librcc.h:212
rccGetCharsetNumber
int rccGetCharsetNumber(rcc_context ctx)
rccGetRealLanguage
rcc_language_id rccGetRealLanguage(rcc_context ctx, rcc_language_id language_id)
rccConfigGetLanguageName
const char * rccConfigGetLanguageName(rcc_language_config config)
rccConfigSizedFrom
rcc_string rccConfigSizedFrom(rcc_language_config config, rcc_class_id class_id, const char *buf, size_t len)
RCC_OPTION_TYPE_STANDARD
@ RCC_OPTION_TYPE_STANDARD
Definition: librcc.h:478
rccUnlockConfiguration
int rccUnlockConfiguration(rcc_context ctx, unsigned int lock_code)
rcc_class_default_charset_t::charset
const char * charset
Definition: librcc.h:327
rccConfigGetClassCharsetByName
rcc_charset_id rccConfigGetClassCharsetByName(rcc_language_config config, rcc_class_id class_id, const char *name)
rccConfigGetLocaleClassCharset
rcc_charset_id rccConfigGetLocaleClassCharset(rcc_language_config config, rcc_class_id class_id, const char *locale_variable)
RCC_OPTION_AUTODETECT_FS_TITLES
@ RCC_OPTION_AUTODETECT_FS_TITLES
Definition: librcc.h:461
rccTranslateSetTimeout
int rccTranslateSetTimeout(rcc_translate translate, unsigned long us)
rccGetSelectedCharset
rcc_charset_id rccGetSelectedCharset(rcc_context ctx, rcc_class_id class_id)
RCC_OPTION_TRANSLATE_SKIP_PARRENT
#define RCC_OPTION_TRANSLATE_SKIP_PARRENT
Definition: librcc.h:1554
rccGetLocaleClassCharset
rcc_charset_id rccGetLocaleClassCharset(rcc_context ctx, rcc_class_id class_id, const char *locale_variable)
rccEngineGetLanguage
rcc_language * rccEngineGetLanguage(rcc_engine_context ctx)
rcc_class_t::fullname
const char * fullname
Definition: librcc.h:373
rccConfigSetCharset
int rccConfigSetCharset(rcc_language_config config, rcc_class_id class_id, rcc_charset_id charset_id)
rccSizedRecodeCharsets
char * rccSizedRecodeCharsets(rcc_context ctx, const char *from, const char *to, const char *buf, size_t len, size_t *rlen)
RCC_OPTION_TRANSLATE_OFF
@ RCC_OPTION_TRANSLATE_OFF
Definition: librcc.h:448
RCC_SPELLER_CORRECT
@ RCC_SPELLER_CORRECT
Definition: librcc.h:1203
rcc_charset_id
unsigned char rcc_charset_id
Definition: librcc.h:58
rccGetOptionValueName
const char * rccGetOptionValueName(rcc_option option, rcc_option_value value)
rcc_option_translate
enum rcc_option_translate_t rcc_option_translate
rcc_language_relation_t::parent
const char * parent
Definition: librcc.h:266
rccInit
int rccInit()
rccDetectCharset
rcc_autocharset_id rccDetectCharset(rcc_context ctx, rcc_class_id class_id, const char *buf, size_t len)
rccConfigGetCharsetByName
rcc_charset_id rccConfigGetCharsetByName(rcc_language_config config, const char *name)
rccConfigGetLanguage
rcc_language_id rccConfigGetLanguage(rcc_language_config config)
RCC_MAX_CLASSES
#define RCC_MAX_CLASSES
Definition: librcc.h:33
RCC_OPTION_RANGE_TYPE_BOOLEAN
@ RCC_OPTION_RANGE_TYPE_BOOLEAN
Definition: librcc.h:486
rccGetCurrentEngineName
const char * rccGetCurrentEngineName(rcc_context ctx)
rccConfigGetSelectedEngine
rcc_engine_id rccConfigGetSelectedEngine(rcc_language_config config)
rcc_init_flags
unsigned int rcc_init_flags
Definition: librcc.h:116
rccGetRealLanguageName
const char * rccGetRealLanguageName(rcc_context ctx, rcc_language_id language_id)
rccIConvOpen
rcc_iconv rccIConvOpen(const char *from, const char *to)
rccGetSelectedLanguageName
const char * rccGetSelectedLanguageName(rcc_context ctx)
rccRegisterDisabledCharsets
int rccRegisterDisabledCharsets(rcc_context ctx, rcc_class_id class_id, rcc_charset *charsets)
rcc_string
char * rcc_string
Definition: librcc.h:1032
rcc_language_ptr
rcc_language * rcc_language_ptr
Definition: librcc.h:239
rcc_autocharset_id
unsigned char rcc_autocharset_id
Definition: librcc.h:64
rccConfigSizedRecodeFromCharset
rcc_string rccConfigSizedRecodeFromCharset(rcc_language_config config, rcc_class_id class_id, const char *charset, const char *buf, size_t len, size_t *rlen)
RCC_OPTION_OFFLINE
@ RCC_OPTION_OFFLINE
Definition: librcc.h:468
rccSetOption
int rccSetOption(rcc_context ctx, rcc_option option, rcc_option_value value)
RCC_MAX_OPTIONS
@ RCC_MAX_OPTIONS
Definition: librcc.h:469
rccSizedRecodeToCharset
char * rccSizedRecodeToCharset(rcc_context ctx, rcc_class_id class_id, const char *charset, rcc_const_string buf, size_t len, size_t *rlen)
rcc_class_t
Definition: librcc.h:368
rcc_option_value
int rcc_option_value
Definition: librcc.h:436
rccConfigGetEngineNumber
int rccConfigGetEngineNumber(rcc_language_config config)
rcc_class_type
enum rcc_class_type_t rcc_class_type
rccSpeller
rcc_speller_result rccSpeller(rcc_speller speller, const char *word)
rcc_engine_t
Definition: librcc.h:219
rccConfigSizedRecodeToCharset
char * rccConfigSizedRecodeToCharset(rcc_language_config config, rcc_class_id class_id, const char *charset, rcc_const_string buf, size_t len, size_t *rlen)
rcc_option_translate_t
rcc_option_translate_t
Definition: librcc.h:447
rccGetEngineName
const char * rccGetEngineName(rcc_context ctx, rcc_engine_id engine_id)
rcc_compiled_configuration_t
Definition: librcc.h:1535
rccFS
char * rccFS(rcc_context ctx, rcc_class_id from, rcc_class_id to, const char *fspath, const char *path, const char *filename)
rccSizedFrom
rcc_string rccSizedFrom(rcc_context ctx, rcc_class_id class_id, const char *buf, size_t len)
rccSpellerCreate
rcc_speller rccSpellerCreate(const char *lang)
rcc_class_default_charset_t::lang
const char * lang
Definition: librcc.h:326
rccConfigGetLocaleCharset
rcc_charset_id rccConfigGetLocaleCharset(rcc_language_config config, const char *locale_variable)
rccConfigDetectCharset
rcc_autocharset_id rccConfigDetectCharset(rcc_language_config config, rcc_class_id class_id, const char *buf, size_t len)
RCC_OPTION_TIMEOUT
@ RCC_OPTION_TIMEOUT
Definition: librcc.h:467
rccGetClassFullName
const char * rccGetClassFullName(rcc_context ctx, rcc_class_id class_id)
rcc_language_alias_t::alias
const char * alias
Definition: librcc.h:247
rccSetLanguageByName
int rccSetLanguageByName(rcc_context ctx, const char *name)
rcc_charset
const char * rcc_charset
Definition: librcc.h:181
rccInitDb4
int rccInitDb4(rcc_context ctx, const char *name, rcc_db4_flags flags)
RCC_OPTION_TYPE_MAX
@ RCC_OPTION_TYPE_MAX
Definition: librcc.h:479
rcc_class_t::name
const char * name
Definition: librcc.h:369
rcc_const_string
const char * rcc_const_string
Definition: librcc.h:1038
RCC_OPTION_LEARNING_MODE
@ RCC_OPTION_LEARNING_MODE
Definition: librcc.h:460
rccSave
int rccSave(rcc_context ctx, const char *name)
rccLanguageRegisterEngine
rcc_engine_id rccLanguageRegisterEngine(rcc_language *language, rcc_engine *engine)
rccSpellerResultIsOwn
int rccSpellerResultIsOwn(rcc_speller_result res)
rcc_option_range_t
Definition: librcc.h:496
rccGetSelectedEngineName
const char * rccGetSelectedEngineName(rcc_context ctx)
rcc_option_type
enum rcc_option_type_t rcc_option_type
rccConfigGetCharsetName
const char * rccConfigGetCharsetName(rcc_language_config config, rcc_charset_id charset_id)
rcc_compiled_configuration_t::flags
unsigned long flags
Definition: librcc.h:1536
rccGetSelectedEngine
rcc_engine_id rccGetSelectedEngine(rcc_context ctx)
rcc_compiled_configuration
const struct rcc_compiled_configuration_t * rcc_compiled_configuration
Definition: librcc.h:1539
rccGetCurrentLanguageName
const char * rccGetCurrentLanguageName(rcc_context ctx)
rccEngineGetRccContext
rcc_context rccEngineGetRccContext(rcc_engine_context ctx)
rccLocaleGetClassByName
int rccLocaleGetClassByName(const char *locale)
rccGetClassCharsetName
const char * rccGetClassCharsetName(rcc_context ctx, rcc_class_id class_id, rcc_charset_id charset_id)
rccConfigSizedTo
char * rccConfigSizedTo(rcc_language_config config, rcc_class_id class_id, rcc_const_string buf, size_t *rlen)
librcc.h
rcc_engine_init_function
rcc_engine_internal(* rcc_engine_init_function)(rcc_engine_context ctx)
Definition: librcc.h:200
rccSpellerResultIsCorrect
int rccSpellerResultIsCorrect(rcc_speller_result res)
rccSizedGetString
const char * rccSizedGetString(const char *str, size_t len)
rccGetCharsetByName
rcc_charset_id rccGetCharsetByName(rcc_context ctx, const char *name)
RCC_OPTION_RANGE_TYPE_MENU
@ RCC_OPTION_RANGE_TYPE_MENU
Definition: librcc.h:489
RCC_CLASS_KNOWN
@ RCC_CLASS_KNOWN
Definition: librcc.h:315
rccTranslateAllowOfflineMode
int rccTranslateAllowOfflineMode(rcc_translate translate)
RCC_OPTION_RANGE_TYPE_MAX
@ RCC_OPTION_RANGE_TYPE_MAX
Definition: librcc.h:490
rcc_option_range_t::step
rcc_option_value step
Definition: librcc.h:500
rccGetEngineByName
rcc_engine_id rccGetEngineByName(rcc_context ctx, const char *name)
rccStringNCmp
int rccStringNCmp(const char *str1, const char *str2, size_t n)
rcc_option_type_t
rcc_option_type_t
Definition: librcc.h:476
rcc_charset_list
rcc_charset rcc_charset_list[RCC_MAX_CHARSETS+1]
Definition: librcc.h:185
rccOptionSetDefault
int rccOptionSetDefault(rcc_context ctx, rcc_option option)
rccCreateContext
rcc_context rccCreateContext(const char *locale_variable, unsigned int max_languages, unsigned int max_classes, rcc_class_ptr defclasses, rcc_init_flags flags)
rcc_alias_id
unsigned char rcc_alias_id
Definition: librcc.h:47
main
int main()
Definition: example1.c:28
rccRegisterLanguageRelation
rcc_relation_id rccRegisterLanguageRelation(rcc_context ctx, rcc_language_relation *relation)
rccConfigSizedRecode
char * rccConfigSizedRecode(rcc_language_config config, rcc_class_id from, rcc_class_id to, const char *buf, size_t len, size_t *rlen)
rccGetCurrentCharsetName
const char * rccGetCurrentCharsetName(rcc_context ctx, rcc_class_id class_id)
rccSpellerAddParent
int rccSpellerAddParent(rcc_speller speller, rcc_speller parent)
RCC_SPELLER_ALMOST_PARENT
@ RCC_SPELLER_ALMOST_PARENT
Definition: librcc.h:1200