summaryrefslogtreecommitdiffstats
path: root/src/rccxml.c
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@dside.dyndns.org>2005-07-18 15:22:28 +0000
committerSuren A. Chilingaryan <csa@dside.dyndns.org>2005-07-18 15:22:28 +0000
commit537c4b33fdf6e143243d5a0d286eeb247362e806 (patch)
treed8a94cfaa4a71ffc826b7d8176c54445369539f3 /src/rccxml.c
parent4032f92867e5570f130e4175b3b4fb61240f9752 (diff)
downloadlibrcc-537c4b33fdf6e143243d5a0d286eeb247362e806.tar.gz
librcc-537c4b33fdf6e143243d5a0d286eeb247362e806.tar.bz2
librcc-537c4b33fdf6e143243d5a0d286eeb247362e806.tar.xz
librcc-537c4b33fdf6e143243d5a0d286eeb247362e806.zip
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
Diffstat (limited to 'src/rccxml.c')
-rw-r--r--src/rccxml.c11
1 files changed, 8 insertions, 3 deletions
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 <stdio.h>
+#include <string.h>
#include <stdarg.h>
#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) {