From 50aa5cd62ef4a66da41d68f4a50ddfca97863c38 Mon Sep 17 00:00:00 2001 From: "Suren A. Chilingaryan" Date: Wed, 3 Aug 2005 18:24:08 +0000 Subject: Multithreading - Multithreaded access to recoding functions using same context - Engine plugin to select between UTF-8 and ISO8859-1 for Western European Languages - Fix: 'rccTo' converting FS classes - FS class support in 'rccConfigSizedToCharset' --- src/engine.c | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) (limited to 'src/engine.c') diff --git a/src/engine.c b/src/engine.c index d83fbf7..8058faf 100644 --- a/src/engine.c +++ b/src/engine.c @@ -92,10 +92,10 @@ void rccEngineFree() { #endif /* RCC_RCD_DYNAMIC */ } -int rccEngineInitContext(rcc_engine_context engine_ctx, rcc_context ctx) { - if ((!ctx)||(!engine_ctx)) return -1; +int rccEngineInitContext(rcc_engine_context engine_ctx, rcc_language_config config) { + if ((!config)||(!engine_ctx)) return -1; - engine_ctx->ctx = ctx; + engine_ctx->config = config; engine_ctx->free_func = NULL; engine_ctx->func = NULL; return 0; @@ -114,25 +114,19 @@ void rccEngineFreeContext(rcc_engine_context engine_ctx) { } int rccEngineConfigure(rcc_engine_context ctx) { - rcc_language_id language_id; rcc_engine_id engine_id; rcc_engine *engine; - if ((!ctx)||(!ctx->ctx)) return -1; + if ((!ctx)||(!ctx->config)) return -1; rccEngineFreeContext(ctx); - - language_id = rccGetCurrentLanguage(ctx->ctx); - if (language_id == (rcc_language_id)-1) return -1; - - engine_id = rccGetCurrentEngine(ctx->ctx); + engine_id = rccConfigGetCurrentEngine(ctx->config); if (engine_id == (rcc_engine_id)-1) return -1; - - engine = ctx->ctx->languages[language_id]->engines[engine_id]; + + engine = ctx->config->language->engines[engine_id]; ctx->free_func = engine->free_func; ctx->func = engine->func; - ctx->language = ctx->ctx->languages[language_id]; if (engine->init_func) ctx->internal = engine->init_func(ctx); else ctx->internal = NULL; @@ -149,11 +143,11 @@ rcc_engine_internal rccEngineGetInternal(rcc_engine_context ctx) { rcc_language *rccEngineGetLanguage(rcc_engine_context ctx) { if (!ctx) return NULL; - return ctx->language; + return ctx->config->language; } rcc_context rccEngineGetRccContext(rcc_engine_context ctx) { if (!ctx) return NULL; - return ctx->ctx; + return ctx->config->ctx; } -- cgit v1.2.3