diff options
author | Suren A. Chilingaryan <csa@dside.dyndns.org> | 2005-07-02 05:08:36 +0000 |
---|---|---|
committer | Suren A. Chilingaryan <csa@dside.dyndns.org> | 2005-07-02 05:08:36 +0000 |
commit | 97e76f4c979d7a0c4ed296c512c3024e3c6afa18 (patch) | |
tree | a83fe703fa3ef3a26eed5d6c5929fdcad7429072 /src/librcc.h | |
parent | 081011f386915bd037a3569e46ed5e4f10c490da (diff) | |
download | librcc-97e76f4c979d7a0c4ed296c512c3024e3c6afa18.tar.gz librcc-97e76f4c979d7a0c4ed296c512c3024e3c6afa18.tar.bz2 librcc-97e76f4c979d7a0c4ed296c512c3024e3c6afa18.tar.xz librcc-97e76f4c979d7a0c4ed296c512c3024e3c6afa18.zip |
02.07.2005
Diffstat (limited to 'src/librcc.h')
-rw-r--r-- | src/librcc.h | 93 |
1 files changed, 61 insertions, 32 deletions
diff --git a/src/librcc.h b/src/librcc.h index 0ca55a4..2e06911 100644 --- a/src/librcc.h +++ b/src/librcc.h @@ -1,5 +1,5 @@ -#ifndef LIBRCC_H -#define LIBRCC_H +#ifndef _LIBRCC_H +#define _LIBRCC_H /******************************************************************************* ***************************** Global Defines *********************************** @@ -44,9 +44,12 @@ void rccFree(); *******************************************************************************/ typedef unsigned int rcc_init_flags; #define RCC_DEFAULT_CONFIGURATION 1 -rcc_context rccInitContext(rcc_init_flags flags, unsigned int max_languages, unsigned int max_classes, const char *locale); +rcc_context rccCreateContext(rcc_init_flags flags, unsigned int max_languages, unsigned int max_classes, const char *locale); void rccFreeContext(rcc_context ctx); +int rccLockConfiguration(rcc_context ctx, unsigned int lock_code); +int rccUnlockConfiguration(rcc_context ctx, unsigned int lock_code); + /******************************************************************************* ******************* Altering Language Configuaration *************************** *******************************************************************************/ @@ -73,7 +76,6 @@ typedef rcc_engine_ptr rcc_engine_list[RCC_MAX_ENGINES+1]; /* Language */ struct rcc_language_t { const char *sn; - const char *name; rcc_charset_list charsets; rcc_engine_list engines; }; @@ -90,6 +92,12 @@ 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]; +struct rcc_language_name_t { + const char *sn; + const char *name; +}; +typedef struct rcc_language_name_t rcc_language_name; + 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); @@ -101,6 +109,7 @@ rcc_alias_id rccRegisterLanguageAlias(rcc_context ctx, rcc_language_alias *alias typedef enum rcc_class_type_t { RCC_CLASS_INVALID = 0, RCC_CLASS_STANDARD, + RCC_CLASS_KNOWN, RCC_CLASS_FS } rcc_class_type; typedef const struct rcc_class_t rcc_class; @@ -109,6 +118,7 @@ struct rcc_class_t { const char *name; const char *defvalue; /* locale variable name or parrent name */ const rcc_class_type class_type; + const char *fullname; }; typedef rcc_class *rcc_class_ptr; typedef rcc_class_ptr rcc_class_list[RCC_MAX_CLASSES+1]; @@ -124,10 +134,15 @@ typedef enum rcc_option_t { RCC_LEARNING_MODE = 0, RCC_AUTODETECT_FS_TITLES, RCC_AUTODETECT_FS_NAMES, - RCC_USE_HEADERS, RCC_MAX_OPTIONS } rcc_option; +struct rcc_option_name_t { + rcc_option option; + const char *name; +}; +typedef struct rcc_option_name_t rcc_option_name; + /* lng.c */ const char *rccGetLanguageName(rcc_context ctx, rcc_language_id language_id); rcc_language_id rccGetLanguageByName(rcc_context ctx, const char *name); @@ -141,6 +156,10 @@ const char *rccGetCurrentLanguageName(rcc_context ctx); int rccSetLanguage(rcc_context ctx, rcc_language_id language_id); int rccSetLanguageByName(rcc_context ctx, const char *name); +/* opt.c */ +rcc_option_value rccGetOption(rcc_context ctx, rcc_option option); +int rccSetOption(rcc_context ctx, rcc_option option, rcc_option_value value); + /* lngconfig.c */ int rccConfigInit(rcc_language_config config, rcc_context ctx); int rccConfigFree(rcc_language_config config); @@ -164,41 +183,51 @@ rcc_charset_id rccConfigGetSelectedCharset(rcc_language_config config, rcc_class 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); -rcc_option_value rccConfigGetOption(rcc_language_config config, rcc_option option); 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); -int rccConfigSetOption(rcc_language_config config, rcc_option option, rcc_option_value value); rcc_charset_id rccConfigGetLocaleCharset(rcc_language_config config, const char *locale_variable); /* curconfig.c */ -#define rccGetEngineName(ctx, engine_id) rccConfigGetEngineName(ctx->current_config, engine_id) -#define rccGetCharsetName(ctx, charset_id) rccConfigGetCharsetName(ctx->current_config, charset_id) -#define rccGetAutoCharsetName(ctx, charset_id) rccConfigGetAutoCharsetName(ctx->current_config, charset_id) -#define rccGetEngineByName(ctx, name) rccConfigGetEngineByName(ctx->current_config, name) -#define rccGetCharsetByName(ctx, name) rccConfigGetCharsetByName(ctx->current_config, name) -#define rccGetAutoCharsetByName(ctx, name) rccConfigGetAutoCharsetByName(ctx->current_config, name) - -#define rccGetSelectedEngine(ctx) rccConfigGetSelectedEngine(ctx->current_config) -#define rccGetSelectedEngineName(ctx) rccConfigGetSelectedEngineName(ctx->current_config) -#define rccGetCurrentEngine(ctx) rccConfigGetCurrentEngine(ctx->current_config) -#define rccGetCurrentEngineName(ctx) rccConfigGetCurrentEngineName(ctx->current_config) -#define rccGetSelectedCharset(ctx,class_id) rccConfigGetSelectedCharset(ctx->current_config, class_id) -#define rccGetSelectedCharsetName(ctx,class_id) rccConfigGetSelectedCharsetName(ctx->current_config, class_id) -#define rccGetCurrentCharset(ctx,class_id) rccConfigGetCurrentCharset(ctx->current_config, class_id) -#define rccGetCurrentCharsetName(ctx,class_id) rccConfigGetCurrentCharsetName(ctx->current_config, class_id) -#define rccGetOption(ctx, option) rccConfigGetOption(ctx->current_config, option) - -#define rccSetEngine(ctx, engine_id) rccConfigSetEngine(ctx->current_config, engine_id) -#define rccSetCharset(ctx, class_id, charset_id) rccConfigSetCharset(ctx->current_config, class_id, charset_id) -#define rccSetOption(ctx,option,value) rccConfigSetOption(ctx->current_config, option, value) -#define rccSetEngineByName(ctx, name) rccConfigSetEngineByName(ctx->current_config, name) -#define rccSetCharsetByName(ctx, class_id, name) rccConfigSetCharsetByName(ctx->current_config, class_id, name) - -#define rccGetLocaleCharset(ctx, locale_variable) rccConfigGetLocaleCharset(ctx->current_config, locale_variable) +const char *rccGetEngineName(rcc_context ctx, rcc_engine_id engine_id); +const char *rccGetCharsetName(rcc_context ctx, rcc_charset_id charset_id); +const char *rccGetAutoCharsetName(rcc_context ctx, 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 rccGetAutoCharsetByName(rcc_context ctx, const char *name); + +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); + +/******************************************************************************* +************************ Language Configuaration ******************************* +*******************************************************************************/ +/* rcclist.c */ +rcc_language_ptr *rccGetLanguageList(rcc_context ctx); +rcc_charset *rccGetCharsetList(rcc_context ctx, rcc_language_id language_id); +rcc_engine_ptr *rccGetEngineList(rcc_context ctx, rcc_language_id language_id); +rcc_charset *rccGetCurrentCharsetList(rcc_context ctx); +rcc_engine_ptr *rccGetCurrentEngineList(rcc_context ctx); +rcc_charset *rccGetCurrentAutoCharsetList(rcc_context ctx); +rcc_class_ptr *rccGetClassList(rcc_context ctx); + /******************************************************************************* ************************ RCC_STRING Manipulations ****************************** @@ -238,4 +267,4 @@ int rccLoad(rcc_context ctx); } #endif -#endif /* LIBRCC_H */ +#endif /* _LIBRCC_H */ |