From 7233ff9095194b38586ce438379f08691a0fecdd Mon Sep 17 00:00:00 2001 From: "Suren A. Chilingaryan" Date: Wed, 13 Jul 2005 16:49:47 +0000 Subject: Engine Plugins --- engines/Makefile.am | 11 +++++++++++ engines/russian.c | 25 +++++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 engines/Makefile.am create mode 100644 engines/russian.c (limited to 'engines') diff --git a/engines/Makefile.am b/engines/Makefile.am new file mode 100644 index 0000000..307fddf --- /dev/null +++ b/engines/Makefile.am @@ -0,0 +1,11 @@ +lib_LTLIBRARIES = + +libdir = $(pkgdatadir)/engines + +if HAVE_RCD +lib_LTLIBRARIES += librussian.la +librussian_la_SOURCES = russian.c +librussian_la_LDFLAGS = -module -avoid-version -export-symbols-regex "rccGetInfo" +endif + +INCLUDES = -I../src @RCD_INCLUDES@ diff --git a/engines/russian.c b/engines/russian.c new file mode 100644 index 0000000..f7e5146 --- /dev/null +++ b/engines/russian.c @@ -0,0 +1,25 @@ +#include + +#include +#include + +static rcc_charset_id AutoengineRussian(rcc_engine_context ctx, const char *buf, int len) { + return (rcc_charset_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