summaryrefslogtreecommitdiffstats
path: root/src/engine.c
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@dside.dyndns.org>2005-08-03 18:24:08 +0000
committerSuren A. Chilingaryan <csa@dside.dyndns.org>2005-08-03 18:24:08 +0000
commit50aa5cd62ef4a66da41d68f4a50ddfca97863c38 (patch)
tree43f1bf415e56ace9eb3e19731d3eaffe064c8d68 /src/engine.c
parentdcd966ba50fa18853c5ae06125a5b08b0ee6b10d (diff)
downloadlibrcc-50aa5cd62ef4a66da41d68f4a50ddfca97863c38.tar.gz
librcc-50aa5cd62ef4a66da41d68f4a50ddfca97863c38.tar.bz2
librcc-50aa5cd62ef4a66da41d68f4a50ddfca97863c38.tar.xz
librcc-50aa5cd62ef4a66da41d68f4a50ddfca97863c38.zip
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'
Diffstat (limited to 'src/engine.c')
-rw-r--r--src/engine.c24
1 files changed, 9 insertions, 15 deletions
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;
}