From 537c4b33fdf6e143243d5a0d286eeb247362e806 Mon Sep 17 00:00:00 2001 From: "Suren A. Chilingaryan" Date: Mon, 18 Jul 2005 15:22:28 +0000 Subject: API Improvements - Removed 'rlen' return parameters there not necessary for multibyte encodings - Two versions of recode functions: rccRecode -> rccRecode, rccSizedRecode - Class Types: CONST, SKIP_SAVELOAD - New recode functions: rccToCharset, rccFromCharset - More new recode functions: rccRecodeToCharset, rccRecodeFromCharset, rccRecodeCharsets - New function: rccGetCompiledConfiguration - All warnings are fixed - Perform "File Name" search only if there are non ISO8859-1 chars in the name. - Do not copy invalid characters, - skip them. - Fixed error in rccRecode with 'Recoding Cache' switched On. - Strip leading and trailing spaces in rccDB4 get/set --- src/lng.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/lng.c') diff --git a/src/lng.c b/src/lng.c index 3f02895..b0ce7cd 100644 --- a/src/lng.c +++ b/src/lng.c @@ -10,7 +10,7 @@ rcc_language_ptr rccGetLanguagePointer(rcc_context ctx, rcc_language_id language if (rcc_default_ctx) ctx = rcc_default_ctx; else return NULL; } - if ((language_id<0)||(language_id>=ctx->n_languages)) return NULL; + if (language_id>=ctx->n_languages) return NULL; return ctx->languages[language_id]; } @@ -37,7 +37,6 @@ rcc_language_id rccGetLanguageByName(rcc_context ctx, const char *name) { } static rcc_language_id rccGetDefaultLanguage(rcc_context ctx) { - int err; unsigned int i; rcc_option_value clo; rcc_engine_ptr *engines; @@ -74,7 +73,7 @@ rcc_language_id rccGetRealLanguage(rcc_context ctx, rcc_language_id language_id) if (rcc_default_ctx) ctx = rcc_default_ctx; else return (rcc_language_id)-1; } - if ((language_id<0)||(language_id>=ctx->n_languages)) return (rcc_language_id)-1; + if (language_id>=ctx->n_languages) return (rcc_language_id)-1; if (language_id) return language_id; return rccGetDefaultLanguage(ctx); @@ -132,7 +131,7 @@ int rccSetLanguage(rcc_context ctx, rcc_language_id language_id) { else return -1; } - if ((language_id < 0)||(language_id >= ctx->n_languages)) return -1; + if (language_id >= ctx->n_languages) return -1; if ((!ctx->languages[language_id]->engines[0])||(!ctx->languages[language_id]->charsets[0])) return -2; if (ctx->current_language != language_id) { -- cgit v1.2.3