diff options
author | Suren A. Chilingaryan <csa@dside.dyndns.org> | 2005-07-13 16:49:47 +0000 |
---|---|---|
committer | Suren A. Chilingaryan <csa@dside.dyndns.org> | 2005-07-13 16:49:47 +0000 |
commit | 7233ff9095194b38586ce438379f08691a0fecdd (patch) | |
tree | 8c14b8899914b4ae9e0d6f62e14dd6b3519983cd /src/rccconfig.c | |
parent | fad788d3f02564486039886b1de1cbf976776ac3 (diff) | |
download | librcc-7233ff9095194b38586ce438379f08691a0fecdd.tar.gz librcc-7233ff9095194b38586ce438379f08691a0fecdd.tar.bz2 librcc-7233ff9095194b38586ce438379f08691a0fecdd.tar.xz librcc-7233ff9095194b38586ce438379f08691a0fecdd.zip |
Engine Plugins
Diffstat (limited to 'src/rccconfig.c')
-rw-r--r-- | src/rccconfig.c | 58 |
1 files changed, 39 insertions, 19 deletions
diff --git a/src/rccconfig.c b/src/rccconfig.c index e2a0740..37b6cc0 100644 --- a/src/rccconfig.c +++ b/src/rccconfig.c @@ -11,6 +11,8 @@ rcc_language_alias rcc_default_aliases[] = { { NULL, NULL} }; +const char rcc_default_charset[] = "Default"; +const char rcc_utf8_charset[] = "UTF-8"; const char rcc_engine_nonconfigured[] = "Default"; const char rcc_option_nonconfigured[] = "DEFAULT"; @@ -22,74 +24,80 @@ rcc_engine rcc_russian_engine = { "Russian", NULL, NULL, &rccAutoengineRussian, {"CP1251","KOI8-R","UTF-8","IBM866", NULL} }; -rcc_language rcc_default_languages[RCC_MAX_LANGUAGES + 1] = { -{"default", {"Default", NULL}, { +rcc_engine rcc_ukrainian_engine = { + "Russian", NULL, NULL, &rccAutoengineRussian, {"CP1251","KOI8-U","UTF-8","IBM865", NULL} +}; + +rcc_language rcc_default_languages[RCC_MAX_LANGUAGES + 1]; + +rcc_language rcc_default_languages_embeded[RCC_MAX_LANGUAGES + 1] = { +{"default", {rcc_default_charset, NULL}, { &rcc_default_engine, NULL }}, -{"off", {"Default", NULL}, { +{"off", {rcc_default_charset, NULL}, { &rcc_default_engine, NULL }}, -{"ru", {"Default","KOI8-R","CP1251","UTF-8","IBM866","MACCYRILLIC","ISO8859-5", NULL}, { +{"ru", {rcc_default_charset,"KOI8-R","CP1251",rcc_utf8_charset,"IBM866","MACCYRILLIC","ISO8859-5", NULL}, { &rcc_default_engine, #ifdef RCC_RCD_SUPPORT &rcc_russian_engine, #endif /* RCC_RCD_SUPPORT */ NULL }}, -{"uk", {"Default","KOI8-U","CP1251","UTF-8","IBM855","MACCYRILLIC","ISO8859-5","CP1125", NULL}, { +{"uk", {rcc_default_charset,"KOI8-U","CP1251",rcc_utf8_charset,"IBM855","MACCYRILLIC","ISO8859-5","CP1125", NULL}, { &rcc_default_engine, #ifdef RCC_RCD_SUPPORT - &rcc_russian_engine, + &rcc_ukrainian_engine, #endif /* RCC_RCD_SUPPORT */ NULL }}, -{"be", {"Default", "UTF-8", "CP1251", "IBM866", "ISO-8859-5", "KOI8-UNI", "maccyr" "IBM855", NULL},{ +{"be", {rcc_default_charset, rcc_utf8_charset, "CP1251", "IBM866", "ISO-8859-5", "KOI8-UNI", "maccyr" "IBM855", NULL},{ &rcc_default_engine, NULL }}, -{"bg", {"Default", "UTF-8", "CP1251", "ISO-8859-5", "IBM855", "maccyr", "ECMA-113", NULL},{ +{"bg", {rcc_default_charset, rcc_utf8_charset, "CP1251", "ISO-8859-5", "IBM855", "maccyr", "ECMA-113", NULL},{ &rcc_default_engine, NULL }}, -{"cz", {"Default", "UTF-8", "ISO-8859-2", "CP1250", "IBM852", "KEYBCS2", "macce", "KOI-8_CS_2", "CORK", NULL},{ +{"cz", {rcc_default_charset, rcc_utf8_charset, "ISO-8859-2", "CP1250", "IBM852", "KEYBCS2", "macce", "KOI-8_CS_2", "CORK", NULL},{ &rcc_default_engine, NULL }}, -{"es", {"Default", "UTF-8", "ISO-8859-4", "CP1257", "IBM775", "ISO-8859-13", "macce", "baltic", NULL},{ +{"es", {rcc_default_charset, rcc_utf8_charset, "ISO-8859-4", "CP1257", "IBM775", "ISO-8859-13", "macce", "baltic", NULL},{ &rcc_default_engine, NULL }}, -{"hr", {"Default", "UTF-8", "CP1250", "ISO-8859-2", "IBM852", "macce", "CORK", NULL},{ +{"hr", {rcc_default_charset, rcc_utf8_charset, "CP1250", "ISO-8859-2", "IBM852", "macce", "CORK", NULL},{ &rcc_default_engine, NULL }}, -{"hu", {"Default", "UTF-8", "ISO-8859-2", "CP1250", "IBM852", "macce", "CORK", NULL},{ +{"hu", {rcc_default_charset, rcc_utf8_charset, "ISO-8859-2", "CP1250", "IBM852", "macce", "CORK", NULL},{ &rcc_default_engine, NULL }}, -{"lt", {"Default", "UTF-8", "CP1257", "ISO-8859-4", "IBM775", "ISO-8859-13", "macce", "baltic", NULL},{ +{"lt", {rcc_default_charset, rcc_utf8_charset, "CP1257", "ISO-8859-4", "IBM775", "ISO-8859-13", "macce", "baltic", NULL},{ &rcc_default_engine, NULL }}, -{"lv", {"Default", "UTF-8", "CP1257", "ISO-8859-4", "IBM775", "ISO-8859-13", "macce", "baltic", NULL},{ +{"lv", {rcc_default_charset, rcc_utf8_charset, "CP1257", "ISO-8859-4", "IBM775", "ISO-8859-13", "macce", "baltic", NULL},{ &rcc_default_engine, NULL }}, -{"pl", {"Default", "UTF-8", "ISO-8859-2", "CP1250", "IBM852", "macce", "ISO-8859-13", "ISO-8859-16", "baltic", "CORK", NULL},{ +{"pl", {rcc_default_charset, rcc_utf8_charset, "ISO-8859-2", "CP1250", "IBM852", "macce", "ISO-8859-13", "ISO-8859-16", "baltic", "CORK", NULL},{ &rcc_default_engine, NULL }}, -{"sk", {"Default", "UTF-8", "CP1250", "ISO-8859-2", "IBM852", "KEYBCS2", "macce", "KOI-8_CS_2", "CORK", NULL},{ +{"sk", {rcc_default_charset, rcc_utf8_charset, "CP1250", "ISO-8859-2", "IBM852", "KEYBCS2", "macce", "KOI-8_CS_2", "CORK", NULL},{ &rcc_default_engine, NULL }}, -{"sl", {"Default", "UTF-8", "ISO-8859-2", "CP1250", "IBM852", "macce", "CORK", NULL},{ +{"sl", {rcc_default_charset, rcc_utf8_charset, "ISO-8859-2", "CP1250", "IBM852", "macce", "CORK", NULL},{ &rcc_default_engine, NULL }}, -{"zh", {"Default", "UTF-8", "GB2312", "GBK", "GB18030", "BIG5", NULL},{ +{"zh", {rcc_default_charset, rcc_utf8_charset, "GB2312", "GBK", "GB18030", "BIG5", NULL},{ &rcc_default_engine, NULL }}, @@ -100,7 +108,8 @@ rcc_option_value_name rcc_sn_boolean[] = { "OFF", "ON", NULL }; rcc_option_value_name rcc_sn_learning[] = { "OFF", "ON", "RELEARN", "LEARN", NULL }; rcc_option_value_name rcc_sn_clo[] = { "ALL", "CONFIGURED_AND_AUTO", "CONFIGURED_ONLY", NULL }; -rcc_option_description rcc_option_descriptions[] = { +rcc_option_description rcc_option_descriptions[RCC_MAX_OPTIONS+1]; +rcc_option_description rcc_option_descriptions_embeded[RCC_MAX_OPTIONS+1] = { {RCC_LEARNING_MODE, 1, { RCC_OPTION_RANGE_TYPE_MENU, 0, 3, 1 }, RCC_OPTION_TYPE_STANDARD, "LEARNING_MODE", rcc_sn_learning }, {RCC_AUTODETECT_FS_NAMES, 1, { RCC_OPTION_RANGE_TYPE_BOOLEAN, 0, 0, 0}, RCC_OPTION_TYPE_STANDARD, "AUTODETECT_FS_NAMES", rcc_sn_boolean}, {RCC_AUTODETECT_FS_TITLES, 1, { RCC_OPTION_RANGE_TYPE_BOOLEAN, 0, 0, 0}, RCC_OPTION_TYPE_INVISIBLE, "AUTODETECT_FS_TITLES", rcc_sn_boolean}, @@ -129,3 +138,14 @@ rcc_option_description *rccGetOptionDescriptionByName(const char *name) { return NULL; } + +rcc_language_id rccDefaultGetLanguageByName(const char *name) { + unsigned int i; + + if (!name) return (rcc_language_id)-1; + + for (i=0;rcc_default_languages[i].sn;i++) + if (!strcasecmp(rcc_default_languages[i].sn, name)) return (rcc_language_id)i; + + return (rcc_language_id)-1; +} |