Changeset 2448

Show
Ignore:
Timestamp:
08/15/07 12:22:10 (1 year ago)
Author:
paule
Message:

Move the one common XML-related function used by both the main plugin and the format plugin from opie_xml.c to a new file opie_xml_utils.c, and remove opie_xml.c from the format plugin.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • plugins/opie-sync/src/SConscript

    r2398 r2448  
    88 
    99# basic vformat plugins 
    10 opie = env.SharedLibrary('opie', ['opie_format.c', 'opie_xml.c']) 
    11 opie_sync = env.SharedLibrary('opie-sync', ['opie_sync.c', 'opie_qcop.c', 'opie_comms.c', 'opie_xml.c']) 
     10opie = env.SharedLibrary('opie', ['opie_format.c', 'opie_xml_utils.c']) 
     11opie_sync = env.SharedLibrary('opie-sync', ['opie_sync.c', 'opie_qcop.c', 'opie_comms.c', 'opie_xml.c', 'opie_xml_utils.c']) 
    1212 
    1313 
  • plugins/opie-sync/src/opie_format.c

    r2442 r2448  
    2424 
    2525#include "opie_comms.h" 
    26 #include "opie_xml.h" 
     26#include "opie_xml_utils.h" 
    2727#include "opie_format.h" 
    2828 
  • plugins/opie-sync/src/opie_sync.c

    r2445 r2448  
    3333#include "opie_comms.h" 
    3434#include "opie_xml.h" 
     35#include "opie_xml_utils.h" 
    3536 
    3637/* sync_cancelled() 
  • plugins/opie-sync/src/opie_xml.c

    r2444 r2448  
    306306} 
    307307 
    308 char *xml_node_to_text(xmlDoc *doc, xmlNode *node) { 
    309         xmlBufferPtr bufptr = xmlBufferCreate(); 
    310         xmlNodeDump(bufptr, doc, node, 0, 0); 
    311         int length = xmlBufferLength(bufptr); 
    312         char *nodetext = g_malloc0(length+1); 
    313         memcpy(nodetext, xmlBufferContent(bufptr), length); 
    314         xmlBufferFree(bufptr); 
    315         return nodetext; 
    316 } 
    317  
    318308char *opie_xml_strip_uid(const char *ext_uid) { 
    319309        if(g_str_has_prefix(ext_uid, "uid-")) { 
  • plugins/opie-sync/src/opie_xml.h

    r2447 r2448  
    2727#include <glib.h> 
    2828 
    29 #include "opie_comms.h" 
    3029#include "opie_sync.h" 
    3130 
     
    4342char *hash_xml_node(xmlDoc *doc, xmlNode *node); 
    4443char *hash_str(const char *str); 
    45 char *xml_node_to_text(xmlDoc *doc, xmlNode *node);  
    4644char *opie_xml_strip_uid(const char *ext_uid); 
    4745char *opie_xml_set_ext_uid(xmlNode *node, xmlDoc *doc, const char *listelement,