diff options
Diffstat (limited to 'engines/librcd.c')
-rw-r--r-- | engines/librcd.c | 26 |
1 files changed, 26 insertions, 0 deletions
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 <stdio.h> +#include <string.h> + +#include <librcd.h> +#include <librcc.h> + +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; +} |