#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "dancer-xml.h"
Internal static functions used inside XML parser. | |
This section describes function that are used only inside the XML parsing system. | |
#define | ERROR_RETURN return NULL; |
static void | dxml_free_attrib (dxml_attribute *a) |
Free attribute of a XML element. | |
static void * | mallocwm (int l) |
malloc with an error message on error, exits with 1. | |
static int | skipwhitechars (FILE *f) |
skip whitechar characters. | |
static int | checkchar (int expect, FILE *f) |
check if the next char is c and barf if not. | |
static dxml_element * | initialize_element (void) |
Initializes element for use. | |
static char * | read_character_stream (FILE *f, const char *stop_chars) |
read character stream | |
static dxml_element * | read_PCDATA (FILE *f) |
reads PCdata, and returns. | |
static dxml_attribute * | read_attribute (FILE *f) |
read attributes, and end with / (/>) or > and give it back to the caller name="string" -- no space allowed? | |
static int | skip_read_PI (FILE *f, int strict) |
read PI or doctype decl, <? . | |
static int | skip_read_comment (FILE *f) |
read comment, <!(--) --> | |
static int | read_element_start (FILE *f) |
read the start of <. | |
static dxml_element * | read_element (FILE *f) |
Read an element tag start -- end. | |
Functions | |
dxml_element * | dxml_read_xml (FILE *f) |
Read the XML file and load it as the element structure. | |
void | dxml_free_xml (dxml_element *e) |
free the allocated xml structure |
|
|
|
check if the next char is c and barf if not. return 1 if error. |
|
Free attribute of a XML element.
|
|
free the allocated xml structure
|
|
Read the XML file and load it as the element structure.
|
|
Initializes element for use. allocate, and initialize |
|
malloc with an error message on error, exits with 1.
|
|
read attributes, and end with / (/>) or > and give it back to the caller name="string" -- no space allowed?
|
|
read character stream
|
|
Read an element tag start -- end. assume that the pointer is at <tagname att="..."> ^ i.e. "<" is already read.
|
|
read the start of <. .. part
|
|
reads PCdata, and returns.
|
|
read comment, <!(--) -->
|
|
read PI or doctype decl, <? . .. ?>
|
|
skip whitechar characters. ..
|