From 9d4628df369b92016b7fc3bfc7fed6d06ff2ca9a Mon Sep 17 00:00:00 2001 From: "Suren A. Chilingaryan" Date: Sun, 7 Aug 2005 21:41:32 +0000 Subject: - Russian autoengine is renamed to LibRCD - Fix Learning with Language Autodetection switched on - Attempt to perform rccFS with Language Autodetection switched off, if failed with default behaviour. - Systematization of translation engine: + Rearangement of the translation modes: OFF, TO_ENGLISH, SKIP_RELATED, SKIP_PARRENT, FULL. + New class types: TRANSLATE_LOCALE, TRANSLATE_CURRENT, TRANSLATE_FROM. - Detect "Unicode" locales for foreign languages - "out" class is assumed to be TRANSLATE_LOCALE - Respect RCC_CLASS_KNOWN - Check for Latin UTF-8 prior to running any charset detection engine. --- engines/Makefile.am | 4 ++-- engines/librcd.c | 26 ++++++++++++++++++++++++++ engines/russian.c | 26 -------------------------- 3 files changed, 28 insertions(+), 28 deletions(-) create mode 100644 engines/librcd.c delete mode 100644 engines/russian.c (limited to 'engines') diff --git a/engines/Makefile.am b/engines/Makefile.am index 404cc32..678fc8b 100644 --- a/engines/Makefile.am +++ b/engines/Makefile.am @@ -3,8 +3,8 @@ lib_LTLIBRARIES = libwestern.la libdir = $(pkgdatadir)/engines if HAVE_RCD -lib_LTLIBRARIES += librussian.la -librussian_la_SOURCES = russian.c +lib_LTLIBRARIES += librcd.la +librussian_la_SOURCES = librcd.c librussian_la_LDFLAGS = -module -avoid-version -export-symbols-regex "rccGetInfo" endif diff --git a/engines/librcd.c b/engines/librcd.c new file mode 100644 index 0000000..c24d244 --- /dev/null +++ b/engines/librcd.c @@ -0,0 +1,26 @@ +#include +#include + +#include +#include + +static rcc_autocharset_id AutoengineRussian(rcc_engine_context ctx, const char *buf, int len) { + return (rcc_autocharset_id)rcdGetRussianCharset(buf,len); +} + +static rcc_engine russian_engine = { + "LibRCD", NULL, NULL, &AutoengineRussian, {"CP1251","KOI8-R","UTF-8","IBM866", NULL} +}; + +static rcc_engine ukrainian_engine = { + "LibRCD", NULL, NULL, &AutoengineRussian, {"CP1251","KOI8-U","UTF-8","IBM865", NULL} +}; + +rcc_engine *rccGetInfo(const char *lang) { + if (!lang) return NULL; + + if (!strcmp(lang, "ru")) return &russian_engine; + if (!strcmp(lang, "uk")) return &ukrainian_engine; + + return NULL; +} diff --git a/engines/russian.c b/engines/russian.c deleted file mode 100644 index 0df145c..0000000 --- a/engines/russian.c +++ /dev/null @@ -1,26 +0,0 @@ -#include -#include - -#include -#include - -static rcc_autocharset_id AutoengineRussian(rcc_engine_context ctx, const char *buf, int len) { - return (rcc_autocharset_id)rcdGetRussianCharset(buf,len); -} - -static rcc_engine russian_engine = { - "Russian", NULL, NULL, &AutoengineRussian, {"CP1251","KOI8-R","UTF-8","IBM866", NULL} -}; - -static rcc_engine ukrainian_engine = { - "Russian", NULL, NULL, &AutoengineRussian, {"CP1251","KOI8-U","UTF-8","IBM865", NULL} -}; - -rcc_engine *rccGetInfo(const char *lang) { - if (!lang) return NULL; - - if (!strcmp(lang, "ru")) return &russian_engine; - if (!strcmp(lang, "uk")) return &ukrainian_engine; - - return NULL; -} -- cgit v1.2.3