|
#include <stdio.h>
#ifdef PYTHON
#define XMLAPI_MALLOC_PYTHON
#undef XMLAPI_MALLOC_NATIVE
#endif
#ifndef XMLAPI_MALLOC_NATIVE
#define XMLAPI_MALLOC_NATIVE
#endif
#ifdef XMLAPI_MALLOC_NATIVE
#include <malloc.h>
#define MALLOC(x) malloc(x)
#define REALLOC(x,y) realloc((x),(y))
#define FREE(x) free(x)
#endif
#ifdef XMLAPI_MALLOC_PYTHON
#include <python.h>
#define MALLOC(x) PyMem_Malloc(x)
#define REALLOC(x,y) PyMem_Realloc((x),(y))
#define FREE(x,y) PyMem_Free(x)
#endif
#include <string.h>
#include <stdlib.h>
#include <stdarg.h>
#ifndef PYTHON
#include <expat.h>
#endif
#include "xmlapi.h"
/* Note to self: put these *after* xmlapi.h... (What was I thinking?) */
XMLAPI char * xml_strdup (const char * str)
{
char * ret;
ret = MALLOC (strlen (str) + 1);
strcpy (ret, str);
return (ret);
}
XMLAPI void xml_strfree (char * str)
{
free (str);
}
See xml_string: Writing XML data to strings in memory
See xml_create: Creating an empty element
See Working with attributes: xml_set and xml_attrval
See xml_prepend: Inserting elements
See xml_append: Inserting elements
See xml_replace and xml_replacecontent: Replacing an element with another.
See inserting things: xml_insertbefore and xml_insertafter
See xml_createtext: a shortcut for plain text
See xml_write: Writing XML data to disk
See xml_free: Cleaning up afterwards
See Deleting pieces: xml_delete
See Children: xml_first and xml_last
See Siblings: xml_next and xml_prev
See Bookmarking things: xml_loc and xml_getloc
#ifndef PYTHON
See xml_read: Using expat to parse XML files into memory
#endif
See xml_copy: making fresh copies of XML
See xml_attr*: Working with attributes
See xml_is: Checking an object's name
See xml_search: Searching trees for elements
See xml_charcodings: dealing with UTF-8 and systems that don't quite get it
See xml_sort: Sorting children
See xml_assemble: Putting together SOAP responses
|