librcc.h File Reference
`#include <stdlib.h>`

Go to the source code of this file.

## Classes

struct | rcc_engine_t
struct | rcc_language_t
struct | rcc_language_alias_t
struct | rcc_language_relation_t
struct | rcc_class_default_charset_t
struct | rcc_class_t
struct | rcc_option_range_t
struct | rcc_compiled_configuration_t

## Macros

#define | RCC_MAX_CHARSETS 16
#define | RCC_MAX_ENGINES 5
#define | RCC_MAX_LANGUAGES 64
#define | RCC_MAX_ALIASES 64
#define | RCC_MAX_CLASSES 16
#define | RCC_FLAG_NO_DEFAULT_CONFIGURATION 1
#define | RCC_CLASS_FLAG_CONST 0x01
#define | RCC_CLASS_FLAG_SKIP_SAVELOAD 0x02
#define | RCC_OPTION_LEARNING_FLAG_USE 1
#define | RCC_OPTION_LEARNING_FLAG_LEARN 2
#define | rccFrom(ctx, class_id, buf)
#define | rccTo(ctx, class_id, buf)
#define | rccRecode(ctx, from, to, buf)
#define | rccFromCharset(ctx, charset, buf)
#define | rccToCharset(ctx, charset, buf)
#define | rccRecodeToCharset(ctx, class_id, charset, buf)
#define | rccRecodeFromCharset(ctx, class_id, charset, buf)
#define | rccRecodeCharsets(ctx, from, to, buf)
#define | rccConfigFrom(ctx, class_id, buf)
#define | rccConfigTo(ctx, class_id, buf)
#define | rccConfigRecode(ctx, from, to, buf)
#define | rccConfigRecodeToCharset(ctx, class_id, charset, buf)
#define | rccConfigRecodeFromCharset(ctx, class_id, charset, buf)
#define | RCC_CC_FLAG_HAVE_BERKLEY_DB 0x01
#define | RCC_CC_FLAG_HAVE_DYNAMIC_ENGINES 0x02
#define | RCC_CC_FLAG_HAVE_ENCA 0x04
#define | RCC_CC_FLAG_HAVE_RCD 0x08
#define | RCC_CC_FLAG_HAVE_LIBTRANSLATE 0x10
#define | RCC_OPTION_TRANSLATE_SKIP_PARRENT RCC_OPTION_TRANSLATE_SKIP_PARENT
#define | RCC_SPELLER_ALMOST_PARRENT RCC_SPELLER_ALMOST_PARENT
#define | RCC_SPELLER_PARRENT RCC_SPELLER_PARENT
#define | rccSpellerAddParrent rccSpellerAddParent

## Typedefs

typedef unsigned char | rcc_language_id
typedef unsigned char | rcc_alias_id
typedef unsigned char | rcc_relation_id
typedef unsigned char | rcc_charset_id
typedef unsigned char | rcc_autocharset_id
typedef unsigned char | rcc_engine_id
typedef int | rcc_class_id
typedef struct rcc_context_t * | rcc_context
typedef struct rcc_engine_context_t * | rcc_engine_context
typedef struct rcc_language_config_t * | rcc_language_config
typedef const struct rcc_class_t * | rcc_class_ptr
typedef unsigned int | rcc_init_flags
typedef unsigned int | rcc_db4_flags
typedef const char * | rcc_charset
typedef rcc_charset | rcc_charset_list[RCC_MAX_CHARSETS+1]
typedef void * | rcc_engine_internal
typedef rcc_engine_internal(* | rcc_engine_init_function) (rcc_engine_context ctx)
typedef rcc_autocharset_id(* | rcc_engine_function) (rcc_engine_context ctx, const char *buf, int len)
typedef void(* | rcc_engine_free_function) (rcc_engine_context ctx)
typedef struct rcc_engine_t | rcc_engine
typedef rcc_engine * | rcc_engine_ptr
typedef rcc_engine_ptr | rcc_engine_list[RCC_MAX_ENGINES+1]
typedef struct rcc_language_t | rcc_language
typedef rcc_language * | rcc_language_ptr
typedef rcc_language_ptr | rcc_language_list[RCC_MAX_LANGUAGES+1]
typedef struct rcc_language_alias_t | rcc_language_alias
typedef rcc_language_alias * | rcc_language_alias_ptr
typedef rcc_language_alias_ptr | rcc_language_alias_list[RCC_MAX_ALIASES+1]
typedef struct rcc_language_relation_t | rcc_language_relation
typedef enum rcc_class_type_t | rcc_class_type
typedef const struct rcc_class_default_charset_t | rcc_class_default_charset
typedef const struct rcc_class_t | rcc_class
typedef rcc_class_ptr | rcc_class_list[RCC_MAX_CLASSES+1]
typedef int | rcc_option_value
typedef enum rcc_option_translate_t | rcc_option_translate
typedef enum rcc_option_t | rcc_option
typedef enum rcc_option_type_t | rcc_option_type
typedef enum rcc_option_range_type_t | rcc_option_range_type
typedef struct rcc_option_range_t | rcc_option_range
typedef char * | rcc_string
typedef const char * | rcc_const_string
typedef struct rcc_iconv_t * | rcc_iconv
typedef struct rcc_translate_t * | rcc_translate
typedef struct rcc_speller_t * | rcc_speller
typedef enum rcc_speller_result_t | rcc_speller_result
typedef void * | rcc_config
typedef rcc_engine *(* | rcc_plugin_engine_info_function) (const char *lang)
typedef struct rcc_compiled_configuration_t | rcc_compiled_configuration_s
typedef const struct rcc_compiled_configuration_t * | rcc_compiled_configuration

## Enumerations

enum | rcc_class_type_t { RCC_CLASS_INVALID = 0 , RCC_CLASS_STANDARD , RCC_CLASS_KNOWN , RCC_CLASS_FS , RCC_CLASS_TRANSLATE_LOCALE , RCC_CLASS_TRANSLATE_CURRENT , RCC_CLASS_TRANSLATE_FROM }
enum | rcc_option_translate_t { RCC_OPTION_TRANSLATE_OFF = 0 , RCC_OPTION_TRANSLATE_TRANSLITERATE , RCC_OPTION_TRANSLATE_TO_ENGLISH , RCC_OPTION_TRANSLATE_SKIP_RELATED , RCC_OPTION_TRANSLATE_SKIP_PARENT , RCC_OPTION_TRANSLATE_FULL }
enum | rcc_option_t { RCC_OPTION_LEARNING_MODE = 0 , RCC_OPTION_AUTODETECT_FS_TITLES , RCC_OPTION_AUTODETECT_FS_NAMES , RCC_OPTION_CONFIGURED_LANGUAGES_ONLY , RCC_OPTION_AUTOENGINE_SET_CURRENT , RCC_OPTION_AUTODETECT_LANGUAGE , RCC_OPTION_TRANSLATE , RCC_OPTION_TIMEOUT , RCC_OPTION_OFFLINE , RCC_MAX_OPTIONS , RCC_OPTION_ALL }
enum | rcc_option_type_t { RCC_OPTION_TYPE_INVISIBLE = 0 , RCC_OPTION_TYPE_STANDARD , RCC_OPTION_TYPE_MAX }
enum | rcc_option_range_type_t { RCC_OPTION_RANGE_TYPE_BOOLEAN = 0 , RCC_OPTION_RANGE_TYPE_RANGE , RCC_OPTION_RANGE_TYPE_FLAGS , RCC_OPTION_RANGE_TYPE_MENU , RCC_OPTION_RANGE_TYPE_MAX }
enum | rcc_speller_result_t { RCC_SPELLER_INCORRECT = 0 , RCC_SPELLER_ALMOST_PARENT , RCC_SPELLER_ALMOST_CORRECT , RCC_SPELLER_PARENT , RCC_SPELLER_CORRECT }

## Functions

int | rccInit ()
void | rccFree ()
rcc_context | rccCreateContext (const char *locale_variable, unsigned int max_languages, unsigned int max_classes, rcc_class_ptr defclasses, rcc_init_flags flags)
int | rccInitDefaultContext (const char *locale_variable, unsigned int max_languages, unsigned int max_classes, rcc_class_ptr defclasses, rcc_init_flags flags)
void | rccFreeContext (rcc_context ctx)
int | rccInitDb4 (rcc_context ctx, const char *name, rcc_db4_flags flags)
int | rccLockConfiguration (rcc_context ctx, unsigned int lock_code)
int | rccUnlockConfiguration (rcc_context ctx, unsigned int lock_code)
rcc_language_id | rccRegisterLanguage (rcc_context ctx, rcc_language *language)
rcc_charset_id | rccLanguageRegisterCharset (rcc_language *language, rcc_charset charset)
rcc_engine_id | rccLanguageRegisterEngine (rcc_language *language, rcc_engine *engine)
rcc_alias_id | rccRegisterLanguageAlias (rcc_context ctx, rcc_language_alias *alias)
rcc_relation_id | rccRegisterLanguageRelation (rcc_context ctx, rcc_language_relation *relation)
rcc_class_id | rccRegisterClass (rcc_context ctx, rcc_class *cl)
int | rccRegisterAdditionalCharsets (rcc_context ctx, rcc_class_id class_id, rcc_charset *charsets)
int | rccRegisterDisabledCharsets (rcc_context ctx, rcc_class_id class_id, rcc_charset *charsets)
int | rccIsDisabledCharsetName (rcc_context ctx, rcc_class_id class_id, const char *charset)
rcc_class_type | rccGetClassType (rcc_context ctx, rcc_class_id class_id)
const char * | rccGetClassName (rcc_context ctx, rcc_class_id class_id)
const char * | rccGetClassFullName (rcc_context ctx, rcc_class_id class_id)
int | rccGetLanguageNumber (rcc_context ctx)
int | rccGetClassNumber (rcc_context ctx)
const char * | rccGetLanguageName (rcc_context ctx, rcc_language_id language_id)
rcc_language_id | rccGetLanguageByName (rcc_context ctx, const char *name)
rcc_language_id | rccGetRealLanguage (rcc_context ctx, rcc_language_id language_id)
const char * | rccGetRealLanguageName (rcc_context ctx, rcc_language_id language_id)
rcc_language_id | rccGetSelectedLanguage (rcc_context ctx)
const char * | rccGetSelectedLanguageName (rcc_context ctx)
rcc_language_id | rccGetCurrentLanguage (rcc_context ctx)
const char * | rccGetCurrentLanguageName (rcc_context ctx)
int | rccSetLanguage (rcc_context ctx, rcc_language_id language_id)
int | rccSetLanguageByName (rcc_context ctx, const char *name)
rcc_option_value | rccGetOption (rcc_context ctx, rcc_option option)
int | rccOptionIsDefault (rcc_context ctx, rcc_option option)
int | rccOptionSetDefault (rcc_context ctx, rcc_option option)
int | rccSetOption (rcc_context ctx, rcc_option option, rcc_option_value value)
rcc_option_type | rccOptionGetType (rcc_context ctx, rcc_option option)
rcc_option_range * | rccOptionGetRange (rcc_context ctx, rcc_option option)
const char * | rccGetOptionName (rcc_option option)
const char * | rccGetOptionValueName (rcc_option option, rcc_option_value value)
rcc_option | rccGetOptionByName (const char *name)
rcc_option_value | rccGetOptionValueByName (rcc_option option, const char *name)
rcc_language_config | rccCheckConfig (rcc_context ctx, rcc_language_id language_id)
rcc_language_config | rccGetConfig (rcc_context ctx, rcc_language_id language_id)
rcc_language_config | rccGetUsableConfig (rcc_context ctx, rcc_language_id language_id)
rcc_language_config | rccGetConfigByName (rcc_context ctx, const char *name)
rcc_language_config | rccGetCurrentConfig (rcc_context ctx)
rcc_language_id | rccConfigGetLanguage (rcc_language_config config)
const char * | rccConfigGetLanguageName (rcc_language_config config)
int | rccConfigGetCharsetNumber (rcc_language_config config)
int | rccConfigGetClassCharsetNumber (rcc_language_config config, rcc_class_id class_id)
int | rccConfigGetEngineNumber (rcc_language_config config)
const char * | rccConfigGetEngineName (rcc_language_config config, rcc_engine_id engine_id)
const char * | rccConfigGetCharsetName (rcc_language_config config, rcc_charset_id charset_id)
const char * | rccConfigGetClassCharsetName (rcc_language_config config, rcc_class_id class_id, rcc_charset_id charset_id)
rcc_engine_id | rccConfigGetEngineByName (rcc_language_config config, const char *name)
rcc_charset_id | rccConfigGetCharsetByName (rcc_language_config config, const char *name)
rcc_charset_id | rccConfigGetClassCharsetByName (rcc_language_config config, rcc_class_id class_id, const char *name)
int | rccConfigIsDisabledCharset (rcc_language_config config, rcc_class_id class_id, rcc_charset_id charset_id)
rcc_engine_id | rccConfigGetSelectedEngine (rcc_language_config config)
const char * | rccConfigGetSelectedEngineName (rcc_language_config config)
rcc_engine_id | rccConfigGetCurrentEngine (rcc_language_config config)
const char * | rccConfigGetCurrentEngineName (rcc_language_config config)
rcc_charset_id | rccConfigGetSelectedCharset (rcc_language_config config, rcc_class_id class_id)
const char * | rccConfigGetSelectedCharsetName (rcc_language_config config, rcc_class_id class_id)
rcc_charset_id | rccConfigGetCurrentCharset (rcc_language_config config, rcc_class_id class_id)
const char * | rccConfigGetCurrentCharsetName (rcc_language_config config, rcc_class_id class_id)
int | rccConfigSetEngine (rcc_language_config config, rcc_engine_id engine_id)
int | rccConfigSetCharset (rcc_language_config config, rcc_class_id class_id, rcc_charset_id charset_id)
int | rccConfigSetEngineByName (rcc_language_config config, const char *name)
int | rccConfigSetCharsetByName (rcc_language_config config, rcc_class_id class_id, const char *name)
rcc_charset_id | rccConfigGetLocaleCharset (rcc_language_config config, const char *locale_variable)
rcc_charset_id | rccConfigGetLocaleClassCharset (rcc_language_config config, rcc_class_id class_id, const char *locale_variable)
int | rccGetCharsetNumber (rcc_context ctx)
int | rccGetClassCharsetNumber (rcc_context ctx, rcc_class_id class_id)
int | rccGetEngineNumber (rcc_context ctx)
const char * | rccGetEngineName (rcc_context ctx, rcc_engine_id engine_id)
const char * | rccGetCharsetName (rcc_context ctx, rcc_charset_id charset_id)
const char * | rccGetClassCharsetName (rcc_context ctx, rcc_class_id class_id, rcc_charset_id charset_id)
rcc_engine_id | rccGetEngineByName (rcc_context ctx, const char *name)
rcc_charset_id | rccGetCharsetByName (rcc_context ctx, const char *name)
rcc_charset_id | rccGetClassCharsetByName (rcc_context ctx, rcc_class_id class_id, const char *name)
int | rccIsDisabledCharset (rcc_context ctx, rcc_class_id class_id, rcc_charset_id charset_id)
rcc_engine_id | rccGetSelectedEngine (rcc_context ctx)
const char * | rccGetSelectedEngineName (rcc_context ctx)
rcc_engine_id | rccGetCurrentEngine (rcc_context ctx)
const char * | rccGetCurrentEngineName (rcc_context ctx)
rcc_charset_id | rccGetSelectedCharset (rcc_context ctx, rcc_class_id class_id)
const char * | rccGetSelectedCharsetName (rcc_context ctx, rcc_class_id class_id)
rcc_charset_id | rccGetCurrentCharset (rcc_context ctx, rcc_class_id class_id)
const char * | rccGetCurrentCharsetName (rcc_context ctx, rcc_class_id class_id)
int | rccSetEngine (rcc_context ctx, rcc_engine_id engine_id)
int | rccSetCharset (rcc_context ctx, rcc_class_id class_id, rcc_charset_id charset_id)
int | rccSetEngineByName (rcc_context ctx, const char *name)
int | rccSetCharsetByName (rcc_context ctx, rcc_class_id class_id, const char *name)
rcc_charset_id | rccGetLocaleCharset (rcc_context ctx, const char *locale_variable)
rcc_charset_id | rccGetLocaleClassCharset (rcc_context ctx, rcc_class_id class_id, const char *locale_variable)
rcc_autocharset_id | rccDetectCharset (rcc_context ctx, rcc_class_id class_id, const char *buf, size_t len)
size_t | rccStringCheck (const char *str)
size_t | rccStringSizedCheck (const char *str, size_t len)
rcc_language_id | rccStringGetLanguage (rcc_const_string str)
const char * | rccStringGetString (rcc_const_string str)
char * | rccStringExtractString (rcc_const_string str)
const char * | rccGetString (const char *str)
const char * | rccSizedGetString (const char *str, size_t len)
int | rccStringCmp (const char *str1, const char *str2)
int | rccStringNCmp (const char *str1, const char *str2, size_t n)
int | rccStringCaseCmp (const char *str1, const char *str2)
int | rccStringNCaseCmp (const char *str1, const char *str2, size_t n)
rcc_iconv | rccIConvOpen (const char *from, const char *to)
void | rccIConvClose (rcc_iconv icnv)
char * | rccIConv (rcc_iconv icnv, const char *buf, size_t len, size_t *rlen)
rcc_translate | rccTranslateOpen (const char *from, const char *to)
void | rccTranslateClose (rcc_translate translate)
int | rccTranslateSetTimeout (rcc_translate translate, unsigned long us)
int | rccTranslateAllowOfflineMode (rcc_translate translate)
char * | rccTranslate (rcc_translate translate, const char *buf)
int | rccSpellerResultIsOwn (rcc_speller_result res)
int | rccSpellerResultIsPrecise (rcc_speller_result res)
int | rccSpellerResultIsCorrect (rcc_speller_result res)
rcc_speller | rccSpellerCreate (const char *lang)
void | rccSpellerFree (rcc_speller speller)
int | rccSpellerAddParent (rcc_speller speller, rcc_speller parent)
rcc_speller_result | rccSpeller (rcc_speller speller, const char *word)
rcc_language_id | rccDetectLanguage (rcc_context ctx, rcc_class_id class_id, const char *buf, size_t len)
rcc_autocharset_id | rccConfigDetectCharset (rcc_language_config config, rcc_class_id class_id, const char *buf, size_t len)
rcc_string | rccSizedFrom (rcc_context ctx, rcc_class_id class_id, const char *buf, size_t len)
char * | rccSizedTo (rcc_context ctx, rcc_class_id class_id, rcc_const_string buf, size_t *rlen)
char * | rccSizedRecode (rcc_context ctx, rcc_class_id from, rcc_class_id to, const char *buf, size_t len, size_t *rlen)
char * | rccFS (rcc_context ctx, rcc_class_id from, rcc_class_id to, const char *fspath, const char *path, const char *filename)
rcc_string | rccSizedFromCharset (rcc_context ctx, const char *charset, const char *buf, size_t len)
char * | rccSizedToCharset (rcc_context ctx, const char *charset, rcc_const_string buf, size_t *rlen)
char * | rccSizedRecodeToCharset (rcc_context ctx, rcc_class_id class_id, const char *charset, rcc_const_string buf, size_t len, size_t *rlen)
rcc_string | rccSizedRecodeFromCharset (rcc_context ctx, rcc_class_id class_id, const char *charset, const char *buf, size_t len, size_t *rlen)
char * | rccSizedRecodeCharsets (rcc_context ctx, const char *from, const char *to, const char *buf, size_t len, size_t *rlen)
rcc_string | rccConfigSizedFrom (rcc_language_config config, rcc_class_id class_id, const char *buf, size_t len)
char * | rccConfigSizedTo (rcc_language_config config, rcc_class_id class_id, rcc_const_string buf, size_t *rlen)
char * | rccConfigSizedRecode (rcc_language_config config, rcc_class_id from, rcc_class_id to, const char *buf, size_t len, size_t *rlen)
rcc_string | rccConfigSizedRecodeFromCharset (rcc_language_config config, rcc_class_id class_id, const char *charset, const char *buf, size_t len, size_t *rlen)
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_config | rccGetConfiguration ()
int | rccSave (rcc_context ctx, const char *name)
int | rccLoad (rcc_context ctx, const char *name)
rcc_engine_internal | rccEngineGetInternal (rcc_engine_context ctx)
rcc_language * | rccEngineGetLanguage (rcc_engine_context ctx)
rcc_context | rccEngineGetRccContext (rcc_engine_context ctx)
rcc_engine * | rccEngineGetInfo (rcc_engine_context ctx)
rcc_autocharset_id | rccEngineGetAutoCharsetByName (rcc_engine_context ctx, const char *name)
rcc_compiled_configuration | rccGetCompiledConfiguration ()
int | rccLocaleGetClassByName (const char *locale)
int | rccLocaleGetLanguage (char *result, const char *lv, unsigned int n)
int | rccLocaleGetCharset (char *result, const char *lv, unsigned int n)

## Macro Definition Documentation

## RCC_CC_FLAG_HAVE_BERKLEY_DB

#define RCC_CC_FLAG_HAVE_BERKLEY_DB 0x01

The Berkley DB support is compiled in

## RCC_CC_FLAG_HAVE_DYNAMIC_ENGINES

#define RCC_CC_FLAG_HAVE_DYNAMIC_ENGINES 0x02

The dynamic engine plugins support is compiled in

## RCC_CC_FLAG_HAVE_ENCA

#define RCC_CC_FLAG_HAVE_ENCA 0x04

Enca engine is compiled in

## RCC_CC_FLAG_HAVE_LIBTRANSLATE

#define RCC_CC_FLAG_HAVE_LIBTRANSLATE 0x10

Libtranslate translation engine compiled in

## RCC_CC_FLAG_HAVE_RCD

#define RCC_CC_FLAG_HAVE_RCD 0x08

LibRCD engine is compiled in

## RCC_CLASS_FLAG_CONST

#define RCC_CLASS_FLAG_CONST 0x01

Forbid change class value using Library API

## RCC_CLASS_FLAG_SKIP_SAVELOAD

#define RCC_CLASS_FLAG_SKIP_SAVELOAD 0x02

Forbid saving and loading of class value

## RCC_FLAG_NO_DEFAULT_CONFIGURATION

#define RCC_FLAG_NO_DEFAULT_CONFIGURATION 1

Do not load default language configuration

## RCC_MAX_ALIASES

#define RCC_MAX_ALIASES 64

## RCC_MAX_CHARSETS

#define RCC_MAX_CHARSETS 16

## RCC_MAX_CLASSES

#define RCC_MAX_CLASSES 16

## RCC_MAX_ENGINES

#define RCC_MAX_ENGINES 5

## RCC_MAX_LANGUAGES

#define RCC_MAX_LANGUAGES 64

## RCC_OPTION_LEARNING_FLAG_LEARN

#define RCC_OPTION_LEARNING_FLAG_LEARN 2

Cache recodings in BerkeleyDB recoding cache for future use

Referenced by main().

## RCC_OPTION_LEARNING_FLAG_USE

#define RCC_OPTION_LEARNING_FLAG_USE 1

Use BerkeleyDB recodings cache for encoding detection

Referenced by main().

## RCC_OPTION_TRANSLATE_SKIP_PARRENT

#define RCC_OPTION_TRANSLATE_SKIP_PARRENT RCC_OPTION_TRANSLATE_SKIP_PARENT

For compatibilty reasons

Referenced by main().

## RCC_SPELLER_ALMOST_PARRENT

#define RCC_SPELLER_ALMOST_PARRENT RCC_SPELLER_ALMOST_PARENT

## RCC_SPELLER_PARRENT

#define RCC_SPELLER_PARRENT RCC_SPELLER_PARENT

## rccConfigFrom

#define rccConfigFrom | ( |  | ctx,
|  |  | class_id,
|  |  | buf )

Value:
rccConfigSizedFrom(ctx, class_id, buf, 0)
rccConfigSizedFrom
rcc_string rccConfigSizedFrom(rcc_language_config config, rcc_class_id class_id, const char *buf, size_t len)

## rccConfigRecode

#define rccConfigRecode | ( |  | ctx,
|  |  | from,
|  |  | to,
|  |  | buf )

Value:
rccConfigSizedRecode(ctx, from, to, buf, 0, NULL)
rccConfigSizedRecode
char * rccConfigSizedRecode(rcc_language_config config, rcc_class_id from, rcc_class_id to, const char *buf, size_t len, size_t *rlen)

## rccConfigRecodeFromCharset

#define rccConfigRecodeFromCharset | ( |  | ctx,
|  |  | class_id,
|  |  | charset,
|  |  | buf )

Value:
rccConfigSizedRecodeFromCharset(ctx, class_id, charset, buf, 0, NULL)
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)

## rccConfigRecodeToCharset

#define rccConfigRecodeToCharset | ( |  | ctx,
|  |  | class_id,
|  |  | charset,
|  |  | buf )

Value:
rccConfigSizedRecodeToCharset(ctx, class_id, charset, buf, 0, NULL)
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)

## rccConfigTo

#define rccConfigTo | ( |  | ctx,
|  |  | class_id,
|  |  | buf )

Value:
rccConfigSizedTo(ctx, class_id, buf, NULL)
rccConfigSizedTo
char * rccConfigSizedTo(rcc_language_config config, rcc_class_id class_id, rcc_const_string buf, size_t *rlen)

## rccFrom

#define rccFrom | ( |  | ctx,
|  |  | class_id,
|  |  | buf )

Value:
rccSizedFrom(ctx, class_id, buf, 0)
rccSizedFrom
rcc_string rccSizedFrom(rcc_context ctx, rcc_class_id class_id, const char *buf, size_t len)

Referenced by main(), and Translate().

## rccFromCharset

#define rccFromCharset | ( |  | ctx,
|  |  | charset,
|  |  | buf )

Value:
rccSizedFromCharset(ctx, charset, buf, 0)
rccSizedFromCharset
rcc_string rccSizedFromCharset(rcc_context ctx, const char *charset, const char *buf, size_t len)

Referenced by Translate().

## rccRecode

#define rccRecode | ( |  | ctx,
|  |  | from,
|  |  | to,
|  |  | buf )

Value:
rccSizedRecode(ctx, from, to, buf, 0, NULL)
rccSizedRecode
char * rccSizedRecode(rcc_context ctx, rcc_class_id from, rcc_class_id to, const char *buf, size_t len, size_t *rlen)

Referenced by main().

## rccRecodeCharsets

#define rccRecodeCharsets | ( |  | ctx,
|  |  | from,
|  |  | to,
|  |  | buf )

Value:
rccSizedRecodeCharsets(ctx, from, to, buf, 0, NULL)
rccSizedRecodeCharsets
char * rccSizedRecodeCharsets(rcc_context ctx, const char *from, const char *to, const char *buf, size_t len, size_t *rlen)

Referenced by Translate().

## rccRecodeFromCharset

#define rccRecodeFromCharset | ( |  | ctx,
|  |  | class_id,
|  |  | charset,
|  |  | buf )

Value:
rccSizedRecodeFromCharset(ctx, class_id, charset, buf, 0, NULL)
rccSizedRecodeFromCharset
rcc_string rccSizedRecodeFromCharset(rcc_context ctx, rcc_class_id class_id, const char *charset, const char *buf, size_t len, size_t *rlen)

## rccRecodeToCharset

#define rccRecodeToCharset | ( |  | ctx,
|  |  | class_id,
|  |  | charset,
|  |  | buf )

Value:
rccSizedRecodeToCharset(ctx, class_id, charset, buf, 0, NULL)
rccSizedRecodeToCharset
char * rccSizedRecodeToCharset(rcc_context ctx, rcc_class_id class_id, const char *charset, rcc_const_string buf, size_t len, size_t *rlen)

## rccSpellerAddParrent

#define rccSpellerAddParrent rccSpellerAddParent

## rccTo

#define rccTo | ( |  | ctx,
|  |  | class_id,
|  |  | buf )

Value:
rccSizedTo(ctx, class_id, buf, NULL)
rccSizedTo
char * rccSizedTo(rcc_context ctx, rcc_class_id class_id, rcc_const_string buf, size_t *rlen)

Referenced by main(), and Translate().

## rccToCharset

#define rccToCharset | ( |  | ctx,
|  |  | charset,
|  |  | buf )

Value:
rccSizedToCharset(ctx, charset, buf, NULL)
rccSizedToCharset
char * rccSizedToCharset(rcc_context ctx, const char *charset, rcc_const_string buf, size_t *rlen)

Referenced by Translate().

## Typedef Documentation

## rcc_alias_id

typedef unsigned char rcc_alias_id

Alias ID

## rcc_autocharset_id

typedef unsigned char rcc_autocharset_id

Autocharset ID.

- -1 is error
- >0 is some encoding

## rcc_charset

typedef const char* rcc_charset

Encoding name.

## rcc_charset_id

typedef unsigned char rcc_charset_id

Charset ID.

- 0 is default charset
- -1 is error
- >0 is some charset

## rcc_charset_list

typedef rcc_charset rcc_charset_list[RCC_MAX_CHARSETS+1]

List of Encoding names

## rcc_class

typedef const struct rcc_class_t rcc_class

## rcc_class_default_charset

typedef const struct rcc_class_default_charset_t rcc_class_default_charset

## rcc_class_id

typedef int rcc_class_id

Class ID.

## rcc_class_list

typedef rcc_class_ptr rcc_class_list[RCC_MAX_CLASSES+1]

## rcc_class_ptr

typedef const struct rcc_class_t* rcc_class_ptr

## rcc_class_type

typedef enum rcc_class_type_t rcc_class_type

Enumeration represents type of class.

## rcc_compiled_configuration

typedef const struct rcc_compiled_configuration_t* rcc_compiled_configuration

## rcc_compiled_configuration_s

typedef struct rcc_compiled_configuration_t rcc_compiled_configuration_s

## rcc_config

typedef void* rcc_config

## rcc_const_string

typedef const char* rcc_const_string

Intermediate string format. RCC_string can be manipulated as standard NULL terminated string. However it contains small header with information about string language. All strings are encoded using UTF-8 encoding.

## rcc_context

typedef struct rcc_context_t* rcc_context

Current Working Context

## rcc_db4_flags

typedef unsigned int rcc_db4_flags

Berkeley DB initialization flags

## rcc_engine

typedef struct rcc_engine_t rcc_engine

## rcc_engine_context

typedef struct rcc_engine_context_t* rcc_engine_context

Encoding Detection Engine Context. Containes considered information about engine, which can be extracted using API functions.

See also
  rccEngineGetInternal
  rccEngineGetLanguage
  rccEngineGetRccContext

## rcc_engine_free_function

typedef void(* rcc_engine_free_function) (rcc_engine_context ctx)

Engine destructor function

## rcc_engine_function

typedef rcc_autocharset_id(* rcc_engine_function) (rcc_engine_context ctx, const char *buf, int len)

Engine encoding detection function.

Parameters

  ctx | is engine context
  buf | is string encoded in unknow encoding
  len | is exact size of string or 0 (size will be detected with strlen)

Returns
  the rcc_autocharset_id of the detected encoding or -1 in case of error

## rcc_engine_id

typedef unsigned char rcc_engine_id

Engine ID.

- -1 is non configured (first available will be used if any)
- 0 autodetection is switched off
- >0 is some auto-engine

## rcc_engine_init_function

typedef rcc_engine_internal(* rcc_engine_init_function) (rcc_engine_context ctx)

Engine constructor function

Parameters

  ctx | is engine context

See also
  rccEngineGetInternal
  rccEngineGetLanguage
  rccEngineGetRccContext

Returns
  pointer on desired internal data to be stored in engine_context.

## rcc_engine_internal

typedef void* rcc_engine_internal

Engine internal data

## rcc_engine_list

typedef rcc_engine_ptr rcc_engine_list[RCC_MAX_ENGINES+1]

## rcc_engine_ptr

typedef rcc_engine* rcc_engine_ptr

## rcc_iconv

typedef struct rcc_iconv_t* rcc_iconv

recoding context

## rcc_init_flags

typedef unsigned int rcc_init_flags

RCC context initialization flags

## rcc_language

typedef struct rcc_language_t rcc_language

## rcc_language_alias

typedef struct rcc_language_alias_t rcc_language_alias

## rcc_language_alias_list

typedef rcc_language_alias_ptr rcc_language_alias_list[RCC_MAX_ALIASES+1]

## rcc_language_alias_ptr

typedef rcc_language_alias* rcc_language_alias_ptr

## rcc_language_config

typedef struct rcc_language_config_t* rcc_language_config

Current Language Configuration: Information about current 'class encodings', and selected 'Encoding Detection Engine'

## rcc_language_id

typedef unsigned char rcc_language_id

Language ID.

- 0 is default language
- -1 is error
- 1 usually represents "LibRCC off" language
- >1 is some language

## rcc_language_list

typedef rcc_language_ptr rcc_language_list[RCC_MAX_LANGUAGES+1]

## rcc_language_ptr

typedef rcc_language* rcc_language_ptr

## rcc_language_relation

typedef struct rcc_language_relation_t rcc_language_relation

## rcc_option

typedef enum rcc_option_t rcc_option

List of options available

## rcc_option_range

typedef struct rcc_option_range_t rcc_option_range

Descriptionm of value range

## rcc_option_range_type

typedef enum rcc_option_range_type_t rcc_option_range_type

Description of option values range type

## rcc_option_translate

typedef enum rcc_option_translate_t rcc_option_translate

## rcc_option_type

typedef enum rcc_option_type_t rcc_option_type

List of option types

## rcc_option_value

typedef int rcc_option_value

## rcc_plugin_engine_info_function

typedef rcc_engine *(* rcc_plugin_engine_info_function) (const char *lang)

## rcc_relation_id

typedef unsigned char rcc_relation_id

Relation ID

## rcc_speller

typedef struct rcc_speller_t* rcc_speller

spelling context

## rcc_speller_result

typedef enum rcc_speller_result_t rcc_speller_result

result of spelling

## rcc_string

typedef char* rcc_string

Intermediate string format. RCC_string can be manipulated as standard NULL terminated string. However it contains small header with information about string language. All strings are encoded using UTF-8 encoding.

## rcc_translate

typedef struct rcc_translate_t* rcc_translate

translating context

## Enumeration Type Documentation

## rcc_class_type_t

enum rcc_class_type_t

Enumeration represents type of class.

Enumerator
RCC_CLASS_INVALID | Invalid value
RCC_CLASS_STANDARD | Standard class
RCC_CLASS_KNOWN | Class encoding is known and no autodetection should be performed
RCC_CLASS_FS | Class strings are representing file names
RCC_CLASS_TRANSLATE_LOCALE | It is permited to translate class strings to current Locale Language in rccTo
RCC_CLASS_TRANSLATE_CURRENT | It is permited to translate class strings to Current Language in rccTo
RCC_CLASS_TRANSLATE_FROM | It is permited to translate class strings to Current Language in rccFrom

{
RCC_CLASS_INVALID = 0,
RCC_CLASS_STANDARD,
RCC_CLASS_KNOWN,
RCC_CLASS_FS,
RCC_CLASS_TRANSLATE_LOCALE,
RCC_CLASS_TRANSLATE_CURRENT,
RCC_CLASS_TRANSLATE_FROM,
} rcc_class_type;
rcc_class_type
enum rcc_class_type_t rcc_class_type
RCC_CLASS_STANDARD
@ RCC_CLASS_STANDARD
Definition librcc.h:314
RCC_CLASS_TRANSLATE_FROM
@ RCC_CLASS_TRANSLATE_FROM
Definition librcc.h:319
RCC_CLASS_INVALID
@ RCC_CLASS_INVALID
Definition librcc.h:313
RCC_CLASS_FS
@ RCC_CLASS_FS
Definition librcc.h:316
RCC_CLASS_KNOWN
@ RCC_CLASS_KNOWN
Definition librcc.h:315
RCC_CLASS_TRANSLATE_CURRENT
@ RCC_CLASS_TRANSLATE_CURRENT
Definition librcc.h:318
RCC_CLASS_TRANSLATE_LOCALE
@ RCC_CLASS_TRANSLATE_LOCALE
Definition librcc.h:317

## rcc_option_range_type_t

enum rcc_option_range_type_t

Description of option values range type

Enumerator
RCC_OPTION_RANGE_TYPE_BOOLEAN | Boolean option
RCC_OPTION_RANGE_TYPE_RANGE | Range of integer values
RCC_OPTION_RANGE_TYPE_FLAGS | Set of boolean flags
RCC_OPTION_RANGE_TYPE_MENU | Enumeration
RCC_OPTION_RANGE_TYPE_MAX |

{
RCC_OPTION_RANGE_TYPE_BOOLEAN = 0,
RCC_OPTION_RANGE_TYPE_RANGE,
RCC_OPTION_RANGE_TYPE_FLAGS,
RCC_OPTION_RANGE_TYPE_MENU,
RCC_OPTION_RANGE_TYPE_MAX
} rcc_option_range_type;
rcc_option_range_type
enum rcc_option_range_type_t rcc_option_range_type
RCC_OPTION_RANGE_TYPE_MAX
@ RCC_OPTION_RANGE_TYPE_MAX
Definition librcc.h:490
RCC_OPTION_RANGE_TYPE_RANGE
@ RCC_OPTION_RANGE_TYPE_RANGE
Definition librcc.h:487
RCC_OPTION_RANGE_TYPE_BOOLEAN
@ RCC_OPTION_RANGE_TYPE_BOOLEAN
Definition librcc.h:486
RCC_OPTION_RANGE_TYPE_MENU
@ RCC_OPTION_RANGE_TYPE_MENU
Definition librcc.h:489
RCC_OPTION_RANGE_TYPE_FLAGS
@ RCC_OPTION_RANGE_TYPE_FLAGS
Definition librcc.h:488

## rcc_option_t

enum rcc_option_t

List of options available

Enumerator
RCC_OPTION_LEARNING_MODE | Recoding Caching mode (OFF/ON/RELEARN/LEARN)
RCC_OPTION_AUTODETECT_FS_TITLES | Detect titles of RCC_CLASS_FS classes
RCC_OPTION_AUTODETECT_FS_NAMES | Try to find encoding of RCC_CLASS_FS by accessing fs
RCC_OPTION_CONFIGURED_LANGUAGES_ONLY | Use only configured languages or languages with auto-engines
RCC_OPTION_AUTOENGINE_SET_CURRENT | If enabled autodetection engine will set current charset
RCC_OPTION_AUTODETECT_LANGUAGE | Enables language detection
RCC_OPTION_TRANSLATE | Translate rcc_string if it's language differs from current one
RCC_OPTION_TIMEOUT | Recoding timeout. Currently it is only used to limit translation time
RCC_OPTION_OFFLINE | Allows external module to finish it's job in offline after the main program is terminated
RCC_MAX_OPTIONS |
RCC_OPTION_ALL |

{
RCC_OPTION_LEARNING_MODE = 0,
RCC_OPTION_AUTODETECT_FS_TITLES,
RCC_OPTION_AUTODETECT_FS_NAMES,
RCC_OPTION_CONFIGURED_LANGUAGES_ONLY,
RCC_OPTION_AUTOENGINE_SET_CURRENT,
RCC_OPTION_AUTODETECT_LANGUAGE,
RCC_OPTION_TRANSLATE,
RCC_OPTION_TIMEOUT,
RCC_OPTION_OFFLINE,
RCC_MAX_OPTIONS,
RCC_OPTION_ALL
} rcc_option;
RCC_OPTION_OFFLINE
@ RCC_OPTION_OFFLINE
Definition librcc.h:468
RCC_OPTION_TRANSLATE
@ RCC_OPTION_TRANSLATE
Definition librcc.h:466
RCC_OPTION_LEARNING_MODE
@ RCC_OPTION_LEARNING_MODE
Definition librcc.h:460
RCC_OPTION_ALL
@ RCC_OPTION_ALL
Definition librcc.h:470
RCC_OPTION_AUTODETECT_LANGUAGE
@ RCC_OPTION_AUTODETECT_LANGUAGE
Definition librcc.h:465
RCC_OPTION_AUTOENGINE_SET_CURRENT
@ RCC_OPTION_AUTOENGINE_SET_CURRENT
Definition librcc.h:464
RCC_OPTION_TIMEOUT
@ RCC_OPTION_TIMEOUT
Definition librcc.h:467
RCC_MAX_OPTIONS
@ RCC_MAX_OPTIONS
Definition librcc.h:469
RCC_OPTION_AUTODETECT_FS_TITLES
@ RCC_OPTION_AUTODETECT_FS_TITLES
Definition librcc.h:461
RCC_OPTION_AUTODETECT_FS_NAMES
@ RCC_OPTION_AUTODETECT_FS_NAMES
Definition librcc.h:462
RCC_OPTION_CONFIGURED_LANGUAGES_ONLY
@ RCC_OPTION_CONFIGURED_LANGUAGES_ONLY
Definition librcc.h:463
rcc_option
enum rcc_option_t rcc_option

## rcc_option_translate_t

enum rcc_option_translate_t

Enumerator
RCC_OPTION_TRANSLATE_OFF | Switch translation off.
RCC_OPTION_TRANSLATE_TRANSLITERATE | Transliterate data.
RCC_OPTION_TRANSLATE_TO_ENGLISH | Translate data to english language (Current language don't matter).
RCC_OPTION_TRANSLATE_SKIP_RELATED | Skip translation of the text's between related languages.
RCC_OPTION_TRANSLATE_SKIP_PARENT | Skip translation of the text's from parent languages (from english).
RCC_OPTION_TRANSLATE_FULL | Translate whole data to the current language

{
RCC_OPTION_TRANSLATE_OFF = 0,
RCC_OPTION_TRANSLATE_TRANSLITERATE,
RCC_OPTION_TRANSLATE_TO_ENGLISH,
RCC_OPTION_TRANSLATE_SKIP_RELATED,
RCC_OPTION_TRANSLATE_SKIP_PARENT,
RCC_OPTION_TRANSLATE_FULL
} rcc_option_translate;
rcc_option_translate
enum rcc_option_translate_t rcc_option_translate
RCC_OPTION_TRANSLATE_TO_ENGLISH
@ RCC_OPTION_TRANSLATE_TO_ENGLISH
Definition librcc.h:450
RCC_OPTION_TRANSLATE_OFF
@ RCC_OPTION_TRANSLATE_OFF
Definition librcc.h:448
RCC_OPTION_TRANSLATE_SKIP_RELATED
@ RCC_OPTION_TRANSLATE_SKIP_RELATED
Definition librcc.h:451
RCC_OPTION_TRANSLATE_FULL
@ RCC_OPTION_TRANSLATE_FULL
Definition librcc.h:453
RCC_OPTION_TRANSLATE_TRANSLITERATE
@ RCC_OPTION_TRANSLATE_TRANSLITERATE
Definition librcc.h:449
RCC_OPTION_TRANSLATE_SKIP_PARENT
#define RCC_OPTION_TRANSLATE_SKIP_PARENT
Definition rcc-recode.c:50

## rcc_option_type_t

enum rcc_option_type_t

List of option types

Enumerator
RCC_OPTION_TYPE_INVISIBLE | Invisible option. Wouldn't be represented in UI menu
RCC_OPTION_TYPE_STANDARD | Standard option.
RCC_OPTION_TYPE_MAX |

{
RCC_OPTION_TYPE_INVISIBLE = 0,
RCC_OPTION_TYPE_STANDARD,
RCC_OPTION_TYPE_MAX
} rcc_option_type;
rcc_option_type
enum rcc_option_type_t rcc_option_type
RCC_OPTION_TYPE_INVISIBLE
@ RCC_OPTION_TYPE_INVISIBLE
Definition librcc.h:477
RCC_OPTION_TYPE_STANDARD
@ RCC_OPTION_TYPE_STANDARD
Definition librcc.h:478
RCC_OPTION_TYPE_MAX
@ RCC_OPTION_TYPE_MAX
Definition librcc.h:479

## rcc_speller_result_t

enum rcc_speller_result_t

result of spelling

Enumerator
RCC_SPELLER_INCORRECT | Word not found in dictionaries
RCC_SPELLER_ALMOST_PARENT | Similliar word is found in parents dictionary
RCC_SPELLER_ALMOST_CORRECT | Similliar word is found in dictionary
RCC_SPELLER_PARENT | Word is found in parent dictionary
RCC_SPELLER_CORRECT | Word is found in dictionary

{
RCC_SPELLER_INCORRECT = 0,
RCC_SPELLER_ALMOST_PARENT,
RCC_SPELLER_ALMOST_CORRECT,
RCC_SPELLER_PARENT,
RCC_SPELLER_CORRECT
} rcc_speller_result;
rcc_speller_result
enum rcc_speller_result_t rcc_speller_result
RCC_SPELLER_INCORRECT
@ RCC_SPELLER_INCORRECT
Definition librcc.h:1199
RCC_SPELLER_CORRECT
@ RCC_SPELLER_CORRECT
Definition librcc.h:1203
RCC_SPELLER_ALMOST_CORRECT
@ RCC_SPELLER_ALMOST_CORRECT
Definition librcc.h:1201
RCC_SPELLER_PARENT
@ RCC_SPELLER_PARENT
Definition librcc.h:1202
RCC_SPELLER_ALMOST_PARENT
@ RCC_SPELLER_ALMOST_PARENT
Definition librcc.h:1200

## Function Documentation

## rccCheckConfig()

rcc_language_config rccCheckConfig | ( | rcc_context | ctx,
|  | rcc_language_id | language_id )

Check if configuration is initialized for supplied language.

Parameters

  ctx | is working context ( or default one if NULL supplied )
  language_id | is concerned language id

Returns
  configuration context if:
  - language_id is particular language, not default one

- language already intialized
- language is not dummy (Disable LibRCC) language otherwise NULL is returned

## rccConfigDetectCharset()

rcc_autocharset_id rccConfigDetectCharset | ( | rcc_language_config | config,
|  | rcc_class_id | class_id,
|  | const char * | buf,
|  | size_t | len )

Tries to detect charset of string

Parameters

  config | is language configuration
  class_id | is encoding class
  buf | is original string (perhaps not zero terminated)
  len | is exact size of string or 0. In the last case the size is determined using 'strlen' function.

Returns
  is auto_charset_id or -1 if autodetection is failed

## rccConfigGetCharsetByName()

rcc_charset_id rccConfigGetCharsetByName | ( | rcc_language_config | config,
|  | const char * | name )

Function finds encoding id by the supplied name.

Parameters

  config | is language configuration
  name | is encoding name

Returns
  encoding id [0-n] or -1 if not found.

## rccConfigGetCharsetName()

const char * rccConfigGetCharsetName | ( | rcc_language_config | config,
|  | rcc_charset_id | charset_id )

Return supplied encoding name

Parameters

  config | is language configuration
  charset_id | is desired charset

Returns
  selected encoding name or NULL in case of error.

## rccConfigGetCharsetNumber()

int rccConfigGetCharsetNumber | ( | rcc_language_config | config | ) |

Return number of configured charsets

Parameters

  config | is language configuration

Returns
  number of charsets available in the configuration or 0 in the case of error

## rccConfigGetClassCharsetByName()

rcc_charset_id rccConfigGetClassCharsetByName | ( | rcc_language_config | config,
|  | rcc_class_id | class_id,
|  | const char * | name )

Function finds encoding id by the supplied name.

Parameters

  config | is language configuration
  class_id | is encoding class
  name | is encoding name

Returns
  encoding id [0-n] or -1 if not found.

## rccConfigGetClassCharsetName()

const char * rccConfigGetClassCharsetName | ( | rcc_language_config | config,
|  | rcc_class_id | class_id,
|  | rcc_charset_id | charset_id )

Return supplied encoding name

Parameters

  config | is language configuration
  class_id | is charset encodings
  charset_id | is desired charset

Returns
  selected encoding name or NULL in case of error.

## rccConfigGetClassCharsetNumber()

int rccConfigGetClassCharsetNumber | ( | rcc_language_config | config,
|  | rcc_class_id | class_id )

Return number of configured charsets

Parameters

  config | is language configuration
  class_id | is class id.

Returns
  number of charsets available in the configuration or 0 in the case of error

## rccConfigGetCurrentCharset()

rcc_charset_id rccConfigGetCurrentCharset | ( | rcc_language_config | config,
|  | rcc_class_id | class_id )

Return current encoding_id. The default value will be resolved to paticular encoding id. The following procedure is used to detect default encoding:

- If Unicode encoding selected for the same class english language. Return this encoding.
- If the parent class is defined in #defcharset, - return current encoding of parent class.
- If the locale variable is defined in #defcharset and either config language coincide with locale language or unciode encoding defined, use locale encoding.
- If the default value for config language is defined in #defvalue return that default value.
- If the default value for all languages is defined in #defvalue return that default value.
- If either config language is coincide with locale language or unicode locale is used, return locale encoding.
- Return first by the list non-dissabled encoding.

Parameters

  config | is language configuration
  class_id | is encoding class

Returns
  selected charset id [1-n] or -1 in case of error

## rccConfigGetCurrentCharsetName()

const char * rccConfigGetCurrentCharsetName | ( | rcc_language_config | config,
|  | rcc_class_id | class_id )

Return current encoding name.

See also
  rccConfigGetCurrentCharset

Parameters

  config | is language configuration
  class_id | is encoding class

Returns
  current charset name or NULL in case of error.

## rccConfigGetCurrentEngine()

rcc_engine_id rccConfigGetCurrentEngine | ( | rcc_language_config | config | ) |

Return current engine_id. The default value will be resolved to paticular engine id. Normally, the id of the first available engine will be returned. If no engines registered for supplied language the 0 will be returned, indicating id of dummy(disabled) engine.

Parameters

  config | is language configuration

Returns
  selected engine id [0-n] or -1 in case of error
  - 0 engines are disabled
  - >0 paticular engine id

## rccConfigGetCurrentEngineName()

const char * rccConfigGetCurrentEngineName | ( | rcc_language_config | config | ) |

Return current engine name.

See also
  rccConfigGetCurrentEngine

Parameters

  config | is language configuration

Returns
  current engine name or NULL in case of error.

## rccConfigGetEngineByName()

rcc_engine_id rccConfigGetEngineByName | ( | rcc_language_config | config,
|  | const char * | name )

Function finds engine id by the supplied name.

Parameters

  config | is language configuration
  name | is engine name

Returns
  engine id [0-n] or -1 if not found

## rccConfigGetEngineName()

const char * rccConfigGetEngineName | ( | rcc_language_config | config,
|  | rcc_engine_id | engine_id )

Return supplied engine name

Parameters

  config | is language configuration
  engine_id | is desired engine

Returns
  selected engine name or NULL in case of error.

## rccConfigGetEngineNumber()

int rccConfigGetEngineNumber | ( | rcc_language_config | config | ) |

Return number of configured encoding auto-detection engines

Parameters

  config | is language configuration

Returns
  number of engines or 0 in the case of error

## rccConfigGetLanguage()

rcc_language_id rccConfigGetLanguage | ( | rcc_language_config | config | ) |

Return language associated with supplied configuration.

Parameters

  config | is language configuration

## rccConfigGetLanguageName()

const char * rccConfigGetLanguageName | ( | rcc_language_config | config | ) |

Return name of the language associated with supplied configuration.

Parameters

  config | is language configuration

## rccConfigGetLocaleCharset()

rcc_charset_id rccConfigGetLocaleCharset | ( | rcc_language_config | config,
|  | const char * | locale_variable )

Function will return encoding id of charset specified by locale configuration.

Parameters

  config | is language configuration
  locale_variable | is locale variable (Default(NULL) is LC_CTYPE)

Returns
  encoding id

## rccConfigGetLocaleClassCharset()

rcc_charset_id rccConfigGetLocaleClassCharset | ( | rcc_language_config | config,
|  | rcc_class_id | class_id,
|  | const char * | locale_variable )

Function will return encoding id of charset specified by locale configuration.

Parameters

  config | is language configuration
  class_id | is encoding class
  locale_variable | is locale variable (Default(NULL) is LC_CTYPE)

Returns
  encoding id

## rccConfigGetSelectedCharset()

rcc_charset_id rccConfigGetSelectedCharset | ( | rcc_language_config | config,
|  | rcc_class_id | class_id )

Return selected encoding id.

Parameters

  config | is language configuration
  class_id | is encoding class

Returns
  selected encoding id [0-n] or -1 in case of error
  - 0 default encoding
  - >0 paticular encoding id

## rccConfigGetSelectedCharsetName()

const char * rccConfigGetSelectedCharsetName | ( | rcc_language_config | config,
|  | rcc_class_id | class_id )

Return selected encoding name.

See also
  rccConfigGetSelectedCharset

Parameters

  config | is language configuration
  class_id | is charset encodings

Returns
  selected encodings name ('default' will be returned if engine not configured) or NULL in case of error.

## rccConfigGetSelectedEngine()

rcc_engine_id rccConfigGetSelectedEngine | ( | rcc_language_config | config | ) |

Return selected engin id.

Parameters

  config | is language configuration

Returns
  selected engine id [-1-n]
  - -1 engine is not configured and first available will be used

- 0 engines are disabled
- >0 paticular engine id

## rccConfigGetSelectedEngineName()

const char * rccConfigGetSelectedEngineName | ( | rcc_language_config | config | ) |

Return selected engine name.

See also
  rccConfigGetSelectedEngine

Parameters

  config | is language configuration

Returns
  selected engine name ('default' will be returned if engine not configured) or NULL in case of error.

## rccConfigIsDisabledCharset()

int rccConfigIsDisabledCharset | ( | rcc_language_config | config,
|  | rcc_class_id | class_id,
|  | rcc_charset_id | charset_id )

Checks if charset is disabled for the specified class.

Parameters

  config | is language configuration
  class_id | is class id.
  charset_id | is charset id.

Returns
  1 if charset is disabled, 0 if charset is enabled, -1 in the case of error.

## rccConfigSetCharset()

int rccConfigSetCharset | ( | rcc_language_config | config,
|  | rcc_class_id | class_id,
|  | rcc_charset_id | charset_id )

Set current encoding.

Parameters

  config | is language configuration
  class_id | is encoding class
  charset_id | is new charset id [0-n]. The 0 will switch charset to encoding state.

Returns
  non-zero value in case of error

## rccConfigSetCharsetByName()

int rccConfigSetCharsetByName | ( | rcc_language_config | config,
|  | rcc_class_id | class_id,
|  | const char * | name )

Set current encoding by name.

Parameters

  config | is language configuration
  class_id | is encoding class
  name | is the short name of new encoding ("default" is okey).

Returns
  non-zero value in case of error

## rccConfigSetEngine()

int rccConfigSetEngine | ( | rcc_language_config | config,
|  | rcc_engine_id | engine_id )

Set current engine.

Parameters

  config | is language configuration
  engine_id | is new language id [-1-n]. If -1 supplied the engine will go in non-configured state.

Returns
  non-zero value in case of error

## rccConfigSetEngineByName()

int rccConfigSetEngineByName | ( | rcc_language_config | config,
|  | const char * | name )

Set current engine by name.

Parameters

  config | is language configuration
  name | is the short name of new engine ("default" is okey).

Returns
  non-zero value in case of error

## rccConfigSizedFrom()

rcc_string rccConfigSizedFrom | ( | rcc_language_config | config,
|  | rcc_class_id | class_id,
|  | const char * | buf,
|  | size_t | len )

Recode string from specified encoding class to rcc_string. Encoding detection engines and recoding cache are used (if possible) to detect original 'buf' encoding. Otherwise the preconfigured encoding of class is assumed.

Parameters

  config | is language configuration
  class_id | is encoding class
  buf | is original string (perhaps not zero terminated)
  len | is exact size of string or 0. In the last case the size is determined using 'strlen' function.

Returns
  is recoded string or NULL if recoding is not required or failed. It is up to the caller to free memory.

## rccConfigSizedRecode()

char * rccConfigSizedRecode | ( | rcc_language_config | config,
|  | rcc_class_id | from,
|  | rcc_class_id | to,
|  | const char * | buf,
|  | size_t | len,
|  | size_t * | rlen )

Recode string between different encoding classes. The conversion is relays on rccConfigSizedFrom and rccConfigSizedTo functions.

See also
  rccConfigSizedFrom
  rccConfigSizedTo

Parameters

  config | is language configuration
  from | is source encoding class
  to | is destination encoding class
  buf | is original string (perhaps not zero terminated)
  len | is exact size of string or 0. In the last case the size is determined using 'strlen' function.
  rlen | in rlen the size of recoded string will be returned.

Returns
  is recoded string or NULL if recoding is not required or failed. It is up to the caller to free memory.

## 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 )

Recode string from specified encoding to rcc_string.

Parameters

  config | is language configuration
  class_id | is encoding class
  charset | is source encoding
  buf | is original string (perhaps not zero terminated)
  len | is exact size of string or 0. In the last case the size is determined using 'strlen' function.
  rlen | in rlen the size of recoded string will be returned.

Returns
  is recoded string or NULL if recoding is not required or failed. It is up to the caller to free memory.

## 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 )

Recode string from rcc_string to specified encoding.

Parameters

  config | is language configuration
  class_id | is encoding class
  charset | is destination encoding
  buf | is original zero terminated string
  len | is exact size of string or 0. In the last case the size is determined using 'strlen' function.
  rlen | in rlen the size of recoded string will be returned.

Returns
  is recoded string or NULL if recoding is not required or failed. It is up to the caller to free memory.

## rccConfigSizedTo()

char * rccConfigSizedTo | ( | rcc_language_config | config,
|  | rcc_class_id | class_id,
|  | rcc_const_string | buf,
|  | size_t * | rlen )

Recode string from rcc_string to specified encoding class. If encoding class is of 'File System' type, the autoprobing for file names can be performed. In the other cases the rcc_string will be recoded in preconfigured class encoding.

Parameters

  config | is language configuration
  class_id | is encoding class
  buf | is original zero terminated string
  rlen | in rlen the size of recoded string will be returned.

Returns
  is recoded string or NULL if recoding is not required or failed. It is up to the caller to free memory.

## rccCreateContext()

rcc_context rccCreateContext | ( | const char * | locale_variable,
|  | unsigned int | max_languages,
|  | unsigned int | max_classes,
|  | rcc_class_ptr | defclasses,
|  | rcc_init_flags | flags )

Initialize working context.

Parameters

  locale_variable | is variable to get locale from (Default: LC_CTYPE).
  max_languages | is maximal number of languages supported by context. (Default: detect)
  max_classes | is maximal number of classes (Default: detect)
  defclasses | is list of encoding classes (Default: will add later)
  flags | is option flag (Default: nothing)

See also
  RCC_FLAG_NO_DEFAULT_CONFIGURATION

Returns
  working context or NULL in case of error

Referenced by main().

## rccDetectCharset()

rcc_autocharset_id rccDetectCharset | ( | rcc_context | ctx,
|  | rcc_class_id | class_id,
|  | const char * | buf,
|  | size_t | len )

## rccDetectLanguage()

rcc_language_id rccDetectLanguage | ( | rcc_context | ctx,
|  | rcc_class_id | class_id,
|  | const char * | buf,
|  | size_t | len )

Tries to detect language of string

Parameters

  ctx | is working context ( or default one if NULL supplied )
  class_id | is encoding class
  buf | is original string (perhaps not zero terminated)
  len | is exact size of string or 0. In the last case the size is determined using 'strlen' function.

Returns
  is language_id or -1 if autodetection is failed

## rccEngineGetAutoCharsetByName()

rcc_autocharset_id rccEngineGetAutoCharsetByName | ( | rcc_engine_context | ctx,
|  | const char * | name )

## rccEngineGetInfo()

rcc_engine * rccEngineGetInfo | ( | rcc_engine_context | ctx | ) |

## rccEngineGetInternal()

rcc_engine_internal rccEngineGetInternal | ( | rcc_engine_context | ctx | ) |

## rccEngineGetLanguage()

rcc_language * rccEngineGetLanguage | ( | rcc_engine_context | ctx | ) |

## rccEngineGetRccContext()

rcc_context rccEngineGetRccContext | ( | rcc_engine_context | ctx | ) |

## rccFree()

void rccFree | ( |  | ) |

Library Cleanup function.

Referenced by main(), and main().

## rccFreeContext()

void rccFreeContext | ( | rcc_context | ctx | ) |

Free all memory used by working context and destroy it.

Parameters

  ctx | is working context to be destroyed.

Referenced by main().

## rccFS()

char * rccFS | ( | rcc_context | ctx,
|  | rcc_class_id | from,
|  | rcc_class_id | to,
|  | const char * | fspath,
|  | const char * | path,
|  | const char * | filename )

Recode file name between different encoding classes. Normally, should be used to convert string from the file list to real file system names. The autoprobing of names is enabled depending on the output encoding class configuration and current options.

See also
  rcc_class_t
  rcc_class_type_t
  rcc_option_t

The conversion is partly relays on rccSizedFrom.

See also
  rccSizedFrom

Parameters

  ctx | is working context ( or default one if NULL supplied )
  from | is source encoding class
  to | is destination encoding class
  fspath | is path to the filesystem where file are located.
  path | is file path
  filename | is file name

Returns
  is recoded file name or NULL if recoding is not required or failed. It is up to the caller to free memory.

## rccGetCharsetByName()

rcc_charset_id rccGetCharsetByName | ( | rcc_context | ctx,
|  | const char * | name )

## rccGetCharsetName()

const char * rccGetCharsetName | ( | rcc_context | ctx,
|  | rcc_charset_id | charset_id )

## rccGetCharsetNumber()

int rccGetCharsetNumber | ( | rcc_context | ctx | ) |

## rccGetClassCharsetByName()

rcc_charset_id rccGetClassCharsetByName | ( | rcc_context | ctx,
|  | rcc_class_id | class_id,
|  | const char * | name )

## rccGetClassCharsetName()

const char * rccGetClassCharsetName | ( | rcc_context | ctx,
|  | rcc_class_id | class_id,
|  | rcc_charset_id | charset_id )

## rccGetClassCharsetNumber()

int rccGetClassCharsetNumber | ( | rcc_context | ctx,
|  | rcc_class_id | class_id )

## rccGetClassFullName()

const char * rccGetClassFullName | ( | rcc_context | ctx,
|  | rcc_class_id | class_id )

Returns full name of supplied class.

Parameters

  ctx | is working context ( or default one if NULL supplied )
  class_id | is class id

Returns
  class full name or NULL in case of a error.

## rccGetClassName()

const char * rccGetClassName | ( | rcc_context | ctx,
|  | rcc_class_id | class_id )

Returns name of supplied class.

Parameters

  ctx | is working context ( or default one if NULL supplied )
  class_id | is class id

Returns
  class name or NULL in case of a error.

## rccGetClassNumber()

int rccGetClassNumber | ( | rcc_context | ctx | ) |

Return number of configured classes

Parameters

  ctx | is working context ( or default one if NULL supplied )

Returns
  number of configured classes or 0 in the case of error

## rccGetClassType()

rcc_class_type rccGetClassType | ( | rcc_context | ctx,
|  | rcc_class_id | class_id )

Determines 'class type' of supplied class.

Parameters

  ctx | is working context ( or default one if NULL supplied )
  class_id | is class id

Returns
  class type or -1 in case of a error.

## rccGetCompiledConfiguration()

rcc_compiled_configuration rccGetCompiledConfiguration | ( |  | ) |

Get information about library compilation environment

## rccGetConfig()

rcc_language_config rccGetConfig | ( | rcc_context | ctx,
|  | rcc_language_id | language_id )

Initializes language configuration if not yet configured and returns pointer on that configuration. If default language is supplied (language_id = 0), the language id will be resolved to particular language and config of that language will be returned.

Parameters

  ctx | is working context ( or default one if NULL supplied )
  language_id | is concerned language id

Returns
  configuration context. The NULL is returned in the case of errors or dummy (Disable LibRCC) language is selected.

## rccGetConfigByName()

rcc_language_config rccGetConfigByName | ( | rcc_context | ctx,
|  | const char * | name )

Initializes language configuration if not yet configured and returns pointer on that configuration.

Parameters

  ctx | is working context ( or default one if NULL supplied )
  name | is concerned language name

Returns
  configuration context or NULL in case of error

## rccGetConfiguration()

rcc_config rccGetConfiguration | ( |  | ) |

## rccGetCurrentCharset()

rcc_charset_id rccGetCurrentCharset | ( | rcc_context | ctx,
|  | rcc_class_id | class_id )

## rccGetCurrentCharsetName()

const char * rccGetCurrentCharsetName | ( | rcc_context | ctx,
|  | rcc_class_id | class_id )

## rccGetCurrentConfig()

rcc_language_config rccGetCurrentConfig | ( | rcc_context | ctx | ) |

Returns pointer on the current language configuration (Initializes it as well if required)

Parameters

  ctx | is working context ( or default one if NULL supplied )

Returns
  configuration context or NULL in case of error

## rccGetCurrentEngine()

rcc_engine_id rccGetCurrentEngine | ( | rcc_context | ctx | ) |

## rccGetCurrentEngineName()

const char * rccGetCurrentEngineName | ( | rcc_context | ctx | ) |

## rccGetCurrentLanguage()

rcc_language_id rccGetCurrentLanguage | ( | rcc_context | ctx | ) |

Return current language id, resolving default language to particular one if necessary. See more details how default language is resolved:

See also
  rccGetRealLanguage

Parameters

  ctx | is working context ( or default one if NULL supplied )

Returns
  current language id [1-n] or -1 in case of error

Referenced by main().

## rccGetCurrentLanguageName()

const char * rccGetCurrentLanguageName | ( | rcc_context | ctx | ) |

Return current language name.

# autotoc_md0

See also
  rccGetCurrentLanguage

Parameters

  ctx | is working context ( or default one if NULL supplied )

Returns
  current language id [1-n] or -1 in case of error

Referenced by main(), and main().

## rccGetEngineByName()

rcc_engine_id rccGetEngineByName | ( | rcc_context | ctx,
|  | const char * | name )

## rccGetEngineName()

const char * rccGetEngineName | ( | rcc_context | ctx,
|  | rcc_engine_id | engine_id )

## rccGetEngineNumber()

int rccGetEngineNumber | ( | rcc_context | ctx | ) |

## rccGetLanguageByName()

rcc_language_id rccGetLanguageByName | ( | rcc_context | ctx,
|  | const char * | name )

Finds language id by the supplied name.

Parameters

  ctx | is working context ( or default one if NULL supplied )
  name | is language name

Returns
  language id [0-n] or -1 if not found.

Referenced by main().

## rccGetLanguageName()

const char * rccGetLanguageName | ( | rcc_context | ctx,
|  | rcc_language_id | language_id )

Determines name of the supplied language.

Parameters

  ctx | is working context ( or default one if NULL supplied )
  language_id | is 'language id' of desired language. For default language the 'default' value will be returned.

Returns
  language name or NULL in case of a error.

Referenced by main().

## rccGetLanguageNumber()

int rccGetLanguageNumber | ( | rcc_context | ctx | ) |

Return number of configured languages

Parameters

  ctx | is working context ( or default one if NULL supplied )

Returns
  number of configured languages or 0 in the case of error

## rccGetLocaleCharset()

rcc_charset_id rccGetLocaleCharset | ( | rcc_context | ctx,
|  | const char * | locale_variable )

## rccGetLocaleClassCharset()

rcc_charset_id rccGetLocaleClassCharset | ( | rcc_context | ctx,
|  | rcc_class_id | class_id,
|  | const char * | locale_variable )

## rccGetOption()

rcc_option_value rccGetOption | ( | rcc_context | ctx,
|  | rcc_option | option )

Return option value.

Parameters

  ctx | is working context ( or default one if NULL supplied )
  option | is option

Returns
  current option value or -1 in case of error

## rccGetOptionByName()

rcc_option rccGetOptionByName | ( | const char * | name | ) |

Get option by short name.

Parameters

  name | is option name

Returns
  option or -1 in case of error

## rccGetOptionName()

const char * rccGetOptionName | ( | rcc_option | option | ) |

Get short name of supplied option.

Parameters

  option | is option

Returns
  option range or NULL in case of error

## rccGetOptionValueByName()

rcc_option_value rccGetOptionValueByName | ( | rcc_option | option,
|  | const char * | name )

Get option value by short name.

Parameters

  option | is option
  name | is value name

Returns
  option value or -1 in case of error

## rccGetOptionValueName()

const char * rccGetOptionValueName | ( | rcc_option | option,
|  | rcc_option_value | value )

Get short name of supplied option value.

Parameters

  option | is option
  value | is value of #option

Returns
  option value name or NULL in case of error

## rccGetRealLanguage()

rcc_language_id rccGetRealLanguage | ( | rcc_context | ctx,
|  | rcc_language_id | language_id )

This function resolves default languages. If positive language id is supplied it will be returned back unchanged. The default language (0 is supplied as language id) will be resolved to some particular language. The following procedure will be used:

- 1. Detect Language by locale
- 2. Check if language intialized if RCC_OPTION_CONFIGURED_LANGUAGES_ONLY is set
- 3. If one of the previous steps is failed, select first available language (id=1). Usually it should be 'LibRCC off'.

Parameters

  ctx | is working context ( or default one if NULL supplied )
  language_id | is language id

Returns
  resolved language id [1-n] or -1 in case of error.

## rccGetRealLanguageName()

const char * rccGetRealLanguageName | ( | rcc_context | ctx,
|  | rcc_language_id | language_id )

Return considered language name, resolving default language if necessary.

See also
  rccGetRealLanguage

Parameters

  ctx | is working context ( or default one if NULL supplied )
  language_id | is language id

Returns
  resolved language name or NULL in case of error.

## rccGetSelectedCharset()

rcc_charset_id rccGetSelectedCharset | ( | rcc_context | ctx,
|  | rcc_class_id | class_id )

## rccGetSelectedCharsetName()

const char * rccGetSelectedCharsetName | ( | rcc_context | ctx,
|  | rcc_class_id | class_id )

## rccGetSelectedEngine()

rcc_engine_id rccGetSelectedEngine | ( | rcc_context | ctx | ) |

## rccGetSelectedEngineName()

const char * rccGetSelectedEngineName | ( | rcc_context | ctx | ) |

## rccGetSelectedLanguage()

rcc_language_id rccGetSelectedLanguage | ( | rcc_context | ctx | ) |

Return selected language id.

Parameters

  ctx | is working context ( or default one if NULL supplied )

Returns
  selected language id [0-n] or -1 in case of error

## rccGetSelectedLanguageName()

const char * rccGetSelectedLanguageName | ( | rcc_context | ctx | ) |

Return selected language name.

See also
  rccGetSelectedLanguage

Parameters

  ctx | is working context ( or default one if NULL supplied )

Returns
  selected language name or NULL in case of error.

## rccGetString()

const char * rccGetString | ( | const char * | str | ) |

If str is rcc_string function will return pointer on UTF-8 string kept inside, otherwise pointer on the passed string is returned.

Parameters

  str | is null-terminated string

Returns
  pointer on constant string

## rccGetUsableConfig()

rcc_language_config rccGetUsableConfig | ( | rcc_context | ctx,
|  | rcc_language_id | language_id )

Checks if supplied language is usable. The usability of language is determined regarding RCC_OPTION_CONFIGURED_LANGUAGES_ONLY option. Depending on that option there are several possibilities for language usability: Any non-dummy language is usable Any configured or AutoEngine enabled language is usable Only configured languages are usable

Language configuration is initialized if not yet configured. And pointer on that configuration is returned. If default language is supplied (language_id = 0), the language id will be resolved to particular language and config of that language will be returned.

Parameters

  ctx | is working context ( or default one if NULL supplied )
  language_id | is concerned language id

Returns
  configuration context. The NULL is returned in the case of errors or if unusable language is supplied.

## rccIConv()

char * rccIConv | ( | rcc_iconv | icnv,
|  | const char * | buf,
|  | size_t | len,
|  | size_t * | rlen )

Recodes chunk of data.

Parameters

  icnv | is recoding context
  buf | is data for recoding
  len | is size of the data
  rlen | is size of recoded data

Returns
  recoded string or NULL in the case of error

## rccIConvClose()

void rccIConvClose | ( | rcc_iconv | icnv | ) |

Close recoding context.

Parameters

  icnv | is recoding context

## rccIConvOpen()

rcc_iconv rccIConvOpen | ( | const char * | from,
|  | const char * | to )

Open recoding context.

Parameters

  from | is source encoding
  to | is destination encoding

Returns
  - NULL if no recoding is required
  - Pointer on initialized context if successful

## rccInit()

int rccInit | ( |  | ) |

Library Initialization function. Should be called prior to all any library manipulation.

Referenced by main(), and main().

## rccInitDb4()

int rccInitDb4 | ( | rcc_context | ctx,
|  | const char * | name,
|  | rcc_db4_flags | flags )

Enables Berkeley DB recodings caching for specified working context.

Parameters

  ctx | is working context
  name | is database name (can be shared between different applications)
  flags | are reserved for future.

Returns
  non-zero value in case of error

Referenced by main().

## rccInitDefaultContext()

int rccInitDefaultContext | ( | const char * | locale_variable,
|  | unsigned int | max_languages,
|  | unsigned int | max_classes,
|  | rcc_class_ptr | defclasses,
|  | rcc_init_flags | flags )

Initialize default working context (used then no context supplied). Previously opened default context will be freed.

Parameters

  locale_variable | is variable to get locale from (Default: LC_CTYPE).
  max_languages | is maximal number of languages supported by context. (Default: detect)
  max_classes | is maximal number of classes (Default: detect)
  defclasses | is list of encoding classes (Default: will add later)
  flags | is option flag (Default: nothing)

See also
  RCC_FLAG_NO_DEFAULT_CONFIGURATION

Returns
  non-zero value in case of error

Referenced by main(), and main().

## rccIsDisabledCharset()

int rccIsDisabledCharset | ( | rcc_context | ctx,
|  | rcc_class_id | class_id,
|  | rcc_charset_id | charset_id )

## rccIsDisabledCharsetName()

int rccIsDisabledCharsetName | ( | rcc_context | ctx,
|  | rcc_class_id | class_id,
|  | const char * | charset )

Checks if charset is disabled for the specified class.

Parameters

  ctx | is working context ( or default one if NULL supplied )
  class_id | is class id.
  charset | is charset name.

Returns
  1 if charset is disabled, 0 if charset is enabled, -1 in the case of error.

## rccLanguageRegisterCharset()

rcc_charset_id rccLanguageRegisterCharset | ( | rcc_language * | language,
|  | rcc_charset | charset )

Register new encoding belonging to language in supplied working context

Parameters

  language | is language charset should be added to ( or default one if NULL supplied )
  charset | is pointer on charset name (shouldn't be freed before library deinitialization).

Returns
  registered charset id or -1 in case of a error.

## rccLanguageRegisterEngine()

rcc_engine_id rccLanguageRegisterEngine | ( | rcc_language * | language,
|  | rcc_engine * | engine )

Register new Engine in supplied working context

Parameters

  language | is language charset should be added to ( or default one if NULL supplied )
  engine | is pointer on engine description (shouldn't be freed before library deinitialization).

Returns
  registered engine id or -1 in case of a error.

## rccLoad()

int rccLoad | ( | rcc_context | ctx,
|  | const char * | name )

Load Configuration.

Parameters

  ctx | is working context ( or default one if NULL supplied )
  name | is configuration file name ( can be shared between multiple applications! )

Returns
  non-zero in the case of errors.

Referenced by main().

## rccLocaleGetCharset()

int rccLocaleGetCharset | ( | char * | result,
|  | const char * | lv,
|  | unsigned int | n )

## rccLocaleGetClassByName()

int rccLocaleGetClassByName | ( | const char * | locale | ) |

## rccLocaleGetLanguage()

int rccLocaleGetLanguage | ( | char * | result,
|  | const char * | lv,
|  | unsigned int | n )

## rccLockConfiguration()

int rccLockConfiguration | ( | rcc_context | ctx,
|  | unsigned int | lock_code )

## rccOptionGetRange()

rcc_option_range * rccOptionGetRange | ( | rcc_context | ctx,
|  | rcc_option | option )

Return range description for specified option

Parameters

  ctx | is working context ( or default one if NULL supplied )
  option | is option

Returns
  option range or -1 in case of error

## rccOptionGetType()

rcc_option_type rccOptionGetType | ( | rcc_context | ctx,
|  | rcc_option | option )

Get current option type.

Parameters

  ctx | is working context ( or default one if NULL supplied )
  option | is option

Returns
  current option type or -1 in case of error

## rccOptionIsDefault()

int rccOptionIsDefault | ( | rcc_context | ctx,
|  | rcc_option | option )

Tests if option have unchanged default value.

Parameters

  ctx | is working context ( or default one if NULL supplied )
  option | is option

Returns
  current option value or -1 in case of error

## rccOptionSetDefault()

int rccOptionSetDefault | ( | rcc_context | ctx,
|  | rcc_option | option )

Sets option to its default value.

Parameters

  ctx | is working context ( or default one if NULL supplied )
  option | is option

Returns
  non-zero value in case of error

## rccRegisterAdditionalCharsets()

int rccRegisterAdditionalCharsets | ( | rcc_context | ctx,
|  | rcc_class_id | class_id,
|  | rcc_charset * | charsets )

Register additional charsets for the current class.

Parameters

  ctx | is working context ( or default one if NULL supplied )
  class_id | is class id.
  charsets | is NULL terminated list of classes.

Returns
  non zero value in the case of a error.

## rccRegisterClass()

rcc_class_id rccRegisterClass | ( | rcc_context | ctx,
|  | rcc_class * | cl )

Register additional class

Parameters

  ctx | is working context ( or default one if NULL supplied )
  cl | is pointer on the class description (shouldn't be freed before library deinitialization).

Returns
  registered class id or -1 in case of a error.

## rccRegisterDisabledCharsets()

int rccRegisterDisabledCharsets | ( | rcc_context | ctx,
|  | rcc_class_id | class_id,
|  | rcc_charset * | charsets )

Register names of charsets disabled in the specified class.

Parameters

  ctx | is working context ( or default one if NULL supplied )
  class_id | is class id.
  charsets | is NULL terminated list of classes ("unicode" / "nonunicode" specifies corespondent group of charsets).

Returns
  non zero value in the case of a error.

## rccRegisterLanguage()

rcc_language_id rccRegisterLanguage | ( | rcc_context | ctx,
|  | rcc_language * | language )

Register new language in supplied working context

Parameters

  ctx | is working context ( or default one if NULL supplied )
  language | is pointer on language description (shouldn't be freed before library deinitialization).

Returns
  registered language id or -1 in case of a error.

## rccRegisterLanguageAlias()

rcc_alias_id rccRegisterLanguageAlias | ( | rcc_context | ctx,
|  | rcc_language_alias * | alias )

Register new language alias in supplied working context

Parameters

  ctx | is working context ( or default one if NULL supplied )
  alias | is pointer on alias description (shouldn't be freed before library deinitialization).

Returns
  registered alias id or -1 in case of a error.

## rccRegisterLanguageRelation()

rcc_relation_id rccRegisterLanguageRelation | ( | rcc_context | ctx,
|  | rcc_language_relation * | relation )

Register new language relation in supplied working context

Parameters

  ctx | is working context ( or default one if NULL supplied )
  relation | is pointer on relation description (shouldn't be freed before library deinitialization).

Returns
  registered relation id or -1 in case of a error.

## rccSave()

int rccSave | ( | rcc_context | ctx,
|  | const char * | name )

Save Configuration.

Parameters

  ctx | is working context ( or default one if NULL supplied )
  name | is configuration file name ( can be shared between multiple applications! )

Returns
  non-zero in the case of errors.

## rccSetCharset()

int rccSetCharset | ( | rcc_context | ctx,
|  | rcc_class_id | class_id,
|  | rcc_charset_id | charset_id )

## rccSetCharsetByName()

int rccSetCharsetByName | ( | rcc_context | ctx,
|  | rcc_class_id | class_id,
|  | const char * | name )

## rccSetEngine()

int rccSetEngine | ( | rcc_context | ctx,
|  | rcc_engine_id | engine_id )

## rccSetEngineByName()

int rccSetEngineByName | ( | rcc_context | ctx,
|  | const char * | name )

## rccSetLanguage()

int rccSetLanguage | ( | rcc_context | ctx,
|  | rcc_language_id | language_id )

Set current language.

Parameters

  ctx | is working context ( or default one if NULL supplied )
  language_id | is new language id [0-n]. Set to default state is Ok.

Returns
  non-zero value in case of error

Referenced by main(), and Translate().

## rccSetLanguageByName()

int rccSetLanguageByName | ( | rcc_context | ctx,
|  | const char * | name )

Set current language by name.

Parameters

  ctx | is working context ( or default one if NULL supplied )
  name | is the short name of new language.

Returns
  non-zero value in case of error

Referenced by main().

## rccSetOption()

int rccSetOption | ( | rcc_context | ctx,
|  | rcc_option | option,
|  | rcc_option_value | value )

Set option value.

Parameters

  ctx | is working context ( or default one if NULL supplied )
  option | is option
  value | is option value

Returns
  non-zero value in case of erros

Referenced by main().

## rccSizedFrom()

rcc_string rccSizedFrom | ( | rcc_context | ctx,
|  | rcc_class_id | class_id,
|  | const char * | buf,
|  | size_t | len )

Recode string from specified encoding class to rcc_string. Encoding detection engines and recoding cache are used (if possible) to detect original 'buf' encoding. Otherwise the preconfigured encoding of class is assumed.

Parameters

  ctx | is working context ( or default one if NULL supplied )
  class_id | is encoding class
  buf | is original string (perhaps not zero terminated)
  len | is exact size of string or 0. In the last case the size is determined using 'strlen' function.

Returns
  is recoded string or NULL if recoding is not required or failed. It is up to the caller to free memory.

## rccSizedFromCharset()

rcc_string rccSizedFromCharset | ( | rcc_context | ctx,
|  | const char * | charset,
|  | const char * | buf,
|  | size_t | len )

Recode string from specified encoding to rcc_string.

Parameters

  ctx | is working context ( or default one if NULL supplied )
  charset | is source encoding
  buf | is original string (perhaps not zero terminated)
  len | is exact size of string or 0. In the last case the size is determined using 'strlen' function.

Returns
  is recoded string or NULL if recoding is not required or failed. It is up to the caller to free memory.

## rccSizedGetString()

const char * rccSizedGetString | ( | const char * | str,
|  | size_t | len )

If str is rcc_string function will return pointer on UTF-8 string kept inside, otherwise pointer on the passed string is returned.

Parameters

  str | is string (perhaps not zero terminated)
  len | is exact length of string or 0 (in this case length will be computed using 'strlen'

Returns
  pointer on constant string

## rccSizedRecode()

char * rccSizedRecode | ( | rcc_context | ctx,
|  | rcc_class_id | from,
|  | rcc_class_id | to,
|  | const char * | buf,
|  | size_t | len,
|  | size_t * | rlen )

Recode string between different encoding classes. The conversion is relays on rccSizedFrom and rccSizedTo functions.

See also
  rccSizedFrom
  rccSizedTo

Parameters

  ctx | is working context ( or default one if NULL supplied )
  from | is source encoding class
  to | is destination encoding class
  buf | is original string (perhaps not zero terminated)
  len | is exact size of string or 0. In the last case the size is determined using 'strlen' function.
  rlen | in rlen the size of recoded string will be returned.

Returns
  is recoded string or NULL if recoding is not required or failed. It is up to the caller to free memory.

## rccSizedRecodeCharsets()

char * rccSizedRecodeCharsets | ( | rcc_context | ctx,
|  | const char * | from,
|  | const char * | to,
|  | const char * | buf,
|  | size_t | len,
|  | size_t * | rlen )

Recode string between specified encodings.

Parameters

  ctx | is working context ( or default one if NULL supplied )
  from | is source encoding
  to | is destination encoding
  buf | is original string (perhaps not zero terminated)
  len | is exact size of string or 0. In the last case the size is determined using 'strlen' function.
  rlen | in rlen the size of recoded string will be returned.

Returns
  is recoded string or NULL if recoding is not required or failed. It is up to the caller to free memory.

## rccSizedRecodeFromCharset()

rcc_string rccSizedRecodeFromCharset | ( | rcc_context | ctx,
|  | rcc_class_id | class_id,
|  | const char * | charset,
|  | const char * | buf,
|  | size_t | len,
|  | size_t * | rlen )

Recode string between specified encoding and encoding class.

The conversion is partly relays on rccSizedTo

See also
  rccSizedTo

Parameters

  ctx | is working context ( or default one if NULL supplied )
  class_id | is destination encoding class
  charset | is source encoding
  buf | is original string (perhaps not zero terminated)
  len | is exact size of string or 0. In the last case the size is determined using 'strlen' function.
  rlen | in rlen the size of recoded string will be returned.

Returns
  is recoded string or NULL if recoding is not required or failed. It is up to the caller to free memory.

## rccSizedRecodeToCharset()

char * rccSizedRecodeToCharset | ( | rcc_context | ctx,
|  | rcc_class_id | class_id,
|  | const char * | charset,
|  | rcc_const_string | buf,
|  | size_t | len,
|  | size_t * | rlen )

Recode string between specified encoding class and encoding.

The conversion is partly relays on rccSizedFrom.

See also
  rccSizedFrom

Parameters

  ctx | is working context ( or default one if NULL supplied )
  class_id | is source encoding class
  charset | is destination encoding
  buf | is original string (perhaps not zero terminated)
  len | is exact size of string or 0. In the last case the size is determined using 'strlen' function.
  rlen | in rlen the size of recoded string will be returned.

Returns
  is recoded string or NULL if recoding is not required or failed. It is up to the caller to free memory.

## rccSizedTo()

char * rccSizedTo | ( | rcc_context | ctx,
|  | rcc_class_id | class_id,
|  | rcc_const_string | buf,
|  | size_t * | rlen )

Recode string from rcc_string to specified encoding class. If encoding class is of 'File System' type, the autoprobing for file names can be performed. In the other cases the rcc_string will be recoded in preconfigured class encoding.

Parameters

  ctx | is working context ( or default one if NULL supplied )
  class_id | is encoding class
  buf | is original zero terminated string
  rlen | in rlen the size of recoded string will be returned.

Returns
  is recoded string or NULL if recoding is not required or failed. It is up to the caller to free memory.

## rccSizedToCharset()

char * rccSizedToCharset | ( | rcc_context | ctx,
|  | const char * | charset,
|  | rcc_const_string | buf,
|  | size_t * | rlen )

Recode string from rcc_string to specified encoding.

Parameters

  ctx | is working context ( or default one if NULL supplied )
  charset | is destination encoding
  buf | is original zero terminated string
  rlen | in rlen the size of recoded string will be returned.

Returns
  is recoded string or NULL if recoding is not required or failed. It is up to the caller to free memory.

## rccSpeller()

rcc_speller_result rccSpeller | ( | rcc_speller | speller,
|  | const char * | word )

Spell a word.

Parameters

  speller | is spelling context
  word | is UTF-8 encoded word for spelling

Returns
  FALSE if word is not found in dictionary

## rccSpellerAddParent()

int rccSpellerAddParent | ( | rcc_speller | speller,
|  | rcc_speller | parent )

Add parent to the spelling context.

Parameters

  speller | is spelling context
  parent | is parent spelling context

Returns
  non-zero value in the case of error

## rccSpellerCreate()

rcc_speller rccSpellerCreate | ( | const char * | lang | ) |

Open spelling context.

Parameters

  lang | is language

Returns
  - NULL if language is not supported and in the case of error.
  - Pointer on initialized context if successful

## rccSpellerFree()

void rccSpellerFree | ( | rcc_speller | speller | ) |

Close spelling context.

Parameters

  speller | is spelling context

## rccSpellerResultIsCorrect()

int rccSpellerResultIsCorrect | ( | rcc_speller_result | res | ) |

## rccSpellerResultIsOwn()

int rccSpellerResultIsOwn | ( | rcc_speller_result | res | ) |

## rccSpellerResultIsPrecise()

int rccSpellerResultIsPrecise | ( | rcc_speller_result | res | ) |

## rccStringCaseCmp()

int rccStringCaseCmp | ( | const char * | str1,
|  | const char * | str2 )

## rccStringCheck()

size_t rccStringCheck | ( | const char * | str | ) |

Check string header and verify if it is really correct rcc_string.

Parameters

  str | is verifying string

## rccStringCmp()

int rccStringCmp | ( | const char * | str1,
|  | const char * | str2 )

## rccStringExtractString()

char * rccStringExtractString | ( | rcc_const_string | str | ) |

Extract UTF-8 string from rcc_string.

Parameters

  str | is rcc_string

Returns
  pointer on string or NULL in the case of error. The string should be freed by the caller.

## rccStringGetLanguage()

rcc_language_id rccStringGetLanguage | ( | rcc_const_string | str | ) |

Extract language from rcc_string.

Parameters

  str | is rcc_string

Returns
  size of string in bytes or -1 if check failed

## rccStringGetString()

const char * rccStringGetString | ( | rcc_const_string | str | ) |

Returns pointer on UTF-8 string kept inside of rcc_string.

Parameters

  str | is rcc_string

Returns
  pointer on constant string or NULL in the case of error

## rccStringNCaseCmp()

int rccStringNCaseCmp | ( | const char * | str1,
|  | const char * | str2,
|  | size_t | n )

## rccStringNCmp()

int rccStringNCmp | ( | const char * | str1,
|  | const char * | str2,
|  | size_t | n )

## rccStringSizedCheck()

size_t rccStringSizedCheck | ( | const char * | str,
|  | size_t | len )

Check string header and verify if it is really correct rcc_string.

Parameters

  str | is verifying string
  len | is preciese size of str.

Returns
  size of string in bytes or -1 if check failed

## rccTranslate()

char * rccTranslate | ( | rcc_translate | translate,
|  | const char * | buf )

Translate string.

Parameters

  translate | is translating context
  buf | is UTF-8 encoded string for translating

Returns
  recoded string or NULL in the case of error

## rccTranslateAllowOfflineMode()

int rccTranslateAllowOfflineMode | ( | rcc_translate | translate | ) |

## rccTranslateClose()

void rccTranslateClose | ( | rcc_translate | translate | ) |

Close translating context.

Parameters

  translate | is translating context

## rccTranslateOpen()

rcc_translate rccTranslateOpen | ( | const char * | from,
|  | const char * | to )

Open translating context.

Parameters

  from | is source language
  to | is destination language

Returns
  - NULL if translation is not required or possible
  - Pointer on initialized context if successful

## rccTranslateSetTimeout()

int rccTranslateSetTimeout | ( | rcc_translate | translate,
|  | unsigned long | us )

## rccUnlockConfiguration()

int rccUnlockConfiguration | ( | rcc_context | ctx,
|  | unsigned int | lock_code )