/rusxmms/librcc

To get this branch, use:
bzr branch http://suren.me/webbzr/rusxmms/librcc

« back to all changes in this revision

Viewing changes to src/rccxml.c

  • Committer: Suren A. Chilingaryan
  • Date: 2005-07-18 15:22:28 UTC
  • Revision ID: Arch-1:ds@dside.dyndns.org--darksoft-2004%librcc--main--0.1--patch-17
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

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#include <stdio.h>
 
2
#include <string.h>
2
3
#include <stdarg.h>
3
4
 
4
5
#include "../config.h"
42
43
 
43
44
static const char *rccXmlGetText(xmlNodePtr node) {
44
45
    if ((node)&&(node->children)&&(node->children->type == XML_TEXT_NODE)&&(node->children->content)) return node->children->content;
 
46
    return NULL;
45
47
}
46
48
 
47
49
int rccXmlInit(int LoadConfiguration) {
49
51
    char config[MAX_HOME_CHARS + 32];
50
52
 
51
53
    xmlXPathContextPtr xpathctx;    
52
 
    xmlXPathObjectPtr obj;
 
54
    xmlXPathObjectPtr obj = NULL;
53
55
    xmlNodeSetPtr node_set;
54
56
    unsigned long i, nnodes;
55
57
    xmlNodePtr enode, cnode, pnode, node;
56
58
    xmlAttrPtr attr;
57
 
    const char *lang, *fullname, *engine_name;
 
59
    const char *lang, *engine_name;
58
60
    unsigned int pos, lpos, epos, cpos;
59
61
    
60
62
    rcc_engine *engine;
159
161
            }
160
162
        }
161
163
    }
 
164
    return 0;
162
165
}
163
166
 
164
167
void rccXmlFree() {
240
243
    rcc_class_ptr *classes;
241
244
    rcc_class_ptr cl;
242
245
    
243
 
    xmlXPathContextPtr xpathctx;    
 
246
    xmlXPathContextPtr xpathctx = NULL;    
244
247
    xmlDocPtr doc = NULL;
245
248
    xmlNodePtr pnode, lnode, onode, llnode, cnode, enode, node;
246
249
    unsigned char oflag = 0, llflag = 0, cflag;
361
364
        
362
365
        for (j=0;classes[j];j++) {
363
366
            cl = classes[j];
 
367
            if (cl->flags&RCC_CLASS_FLAG_SKIP_SAVELOAD) continue;
364
368
            
365
369
            if (cflag) node = rccNodeFind(xpathctx, XPATH_SELECTED_CLASS, language->sn, cl->name);
366
370
            else node = NULL;
538
542
        
539
543
        for (j=0;classes[j];j++) {
540
544
            cl = classes[j];
 
545
            if (cl->flags&RCC_CLASS_FLAG_SKIP_SAVELOAD) continue;
541
546
            
542
547
            node = rccNodeFind(curxpathctx, XPATH_SELECTED_CLASS, language->sn, cl->name);
543
548
            if (node) {