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/rccxml.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/rccxml.c') diff --git a/src/rccxml.c b/src/rccxml.c index c7ee405..65a9c4d 100644 --- a/src/rccxml.c +++ b/src/rccxml.c @@ -1,4 +1,5 @@ #include +#include #include #include "../config.h" @@ -42,6 +43,7 @@ rcc_config rccGetConfiguration() { static const char *rccXmlGetText(xmlNodePtr node) { if ((node)&&(node->children)&&(node->children->type == XML_TEXT_NODE)&&(node->children->content)) return node->children->content; + return NULL; } int rccXmlInit(int LoadConfiguration) { @@ -49,12 +51,12 @@ int rccXmlInit(int LoadConfiguration) { char config[MAX_HOME_CHARS + 32]; xmlXPathContextPtr xpathctx; - xmlXPathObjectPtr obj; + xmlXPathObjectPtr obj = NULL; xmlNodeSetPtr node_set; unsigned long i, nnodes; xmlNodePtr enode, cnode, pnode, node; xmlAttrPtr attr; - const char *lang, *fullname, *engine_name; + const char *lang, *engine_name; unsigned int pos, lpos, epos, cpos; rcc_engine *engine; @@ -159,6 +161,7 @@ clear: } } } + return 0; } void rccXmlFree() { @@ -240,7 +243,7 @@ int rccSave(rcc_context ctx, const char *name) { rcc_class_ptr *classes; rcc_class_ptr cl; - xmlXPathContextPtr xpathctx; + xmlXPathContextPtr xpathctx = NULL; xmlDocPtr doc = NULL; xmlNodePtr pnode, lnode, onode, llnode, cnode, enode, node; unsigned char oflag = 0, llflag = 0, cflag; @@ -361,6 +364,7 @@ int rccSave(rcc_context ctx, const char *name) { for (j=0;classes[j];j++) { cl = classes[j]; + if (cl->flags&RCC_CLASS_FLAG_SKIP_SAVELOAD) continue; if (cflag) node = rccNodeFind(xpathctx, XPATH_SELECTED_CLASS, language->sn, cl->name); else node = NULL; @@ -538,6 +542,7 @@ int rccLoad(rcc_context ctx, const char *name) { for (j=0;classes[j];j++) { cl = classes[j]; + if (cl->flags&RCC_CLASS_FLAG_SKIP_SAVELOAD) continue; node = rccNodeFind(curxpathctx, XPATH_SELECTED_CLASS, language->sn, cl->name); if (node) { -- cgit v1.2.3