xine-lib 1.2.11
Macros | Enumerations | Functions | Variables
xmlparser.c File Reference
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include <ctype.h>
#include <xine/xineutils.h>
#include <xine/xmllexer.h>
#include <xine/xmlparser.h>

Macros

#define LOG_MODULE   "xmlparser"
 
#define LOG_VERBOSE
 
#define TOKEN_SIZE   4 * 1024
 
#define DATA_SIZE   4 * 1024
 
#define MAX_RECURSION   10
 
#define Q_STATE(CURRENT, NEW)   (STATE_##NEW + state - STATE_##CURRENT)
 

Enumerations

enum  parser_state_t {
  STATE_IDLE , STATE_NODE , STATE_ATTRIBUTE , STATE_NODE_CLOSE ,
  STATE_TAG_TERM , STATE_ATTRIBUTE_EQUALS , STATE_STRING , STATE_TAG_TERM_IGNORE ,
  STATE_Q_NODE , STATE_Q_ATTRIBUTE , STATE_Q_NODE_CLOSE , STATE_Q_TAG_TERM ,
  STATE_Q_ATTRIBUTE_EQUALS , STATE_Q_STRING , STATE_COMMENT , STATE_DOCTYPE ,
  STATE_CDATA
}
 

Functions

static char * strtoupper (char *str)
 
static xml_node_tnew_xml_node (void)
 
static void free_xml_node (xml_node_t *node)
 
static xml_property_tnew_xml_property (void)
 
static void free_xml_property (xml_property_t *property)
 
void xml_parser_init (const char *buf, int size, int mode)
 
xml_parser_txml_parser_init_r (const char *buf, int size, int mode)
 
void xml_parser_finalize_r (xml_parser_t *xml_parser)
 
static void xml_parser_free_props (xml_property_t *current_property)
 
static void xml_parser_free_tree_rec (xml_node_t *current_node, int free_next)
 
void xml_parser_free_tree (xml_node_t *current_node)
 
static xml_node_txml_parser_append_text (xml_node_t *node, xml_node_t *subnode, const char *text, int flags)
 
static int xml_parser_get_node_internal (xml_parser_t *xml_parser, char **token_buffer, int *token_buffer_size, char **pname_buffer, int *pname_buffer_size, char **nname_buffer, int *nname_buffer_size, xml_node_t *current_node, char *root_names[], int rec, int flags)
 
static int xml_parser_get_node (xml_parser_t *xml_parser, xml_node_t *current_node, int flags)
 
int xml_parser_build_tree_with_options (xml_node_t **root_node, int flags)
 
int xml_parser_build_tree_with_options_r (xml_parser_t *xml_parser, xml_node_t **root_node, int flags)
 
int xml_parser_build_tree (xml_node_t **root_node)
 
int xml_parser_build_tree_r (xml_parser_t *xml_parser, xml_node_t **root_node)
 
const char * xml_parser_get_property (const xml_node_t *node, const char *name)
 
int xml_parser_get_property_int (const xml_node_t *node, const char *name, int def_value)
 
int xml_parser_get_property_bool (const xml_node_t *node, const char *name, int def_value)
 
static int xml_escape_string_internal (char *buf, const char *s, xml_escape_quote_t quote_type)
 
char * xml_escape_string (const char *s, xml_escape_quote_t quote_type)
 
static void xml_parser_dump_node (const xml_node_t *node, int indent)
 
void xml_parser_dump_tree (const xml_node_t *node)
 

Variables

xml_parser_tstatic_xml_parser
 
static const char cdata [] = CDATA_MARKER
 

Macro Definition Documentation

◆ DATA_SIZE

#define DATA_SIZE   4 * 1024

◆ LOG_MODULE

#define LOG_MODULE   "xmlparser"

◆ LOG_VERBOSE

#define LOG_VERBOSE

◆ MAX_RECURSION

#define MAX_RECURSION   10

◆ Q_STATE

#define Q_STATE (   CURRENT,
  NEW 
)    (STATE_##NEW + state - STATE_##CURRENT)

◆ TOKEN_SIZE

#define TOKEN_SIZE   4 * 1024

Enumeration Type Documentation

◆ parser_state_t

Enumerator
STATE_IDLE 
STATE_NODE 
STATE_ATTRIBUTE 
STATE_NODE_CLOSE 
STATE_TAG_TERM 
STATE_ATTRIBUTE_EQUALS 
STATE_STRING 
STATE_TAG_TERM_IGNORE 
STATE_Q_NODE 
STATE_Q_ATTRIBUTE 
STATE_Q_NODE_CLOSE 
STATE_Q_TAG_TERM 
STATE_Q_ATTRIBUTE_EQUALS 
STATE_Q_STRING 
STATE_COMMENT 
STATE_DOCTYPE 
STATE_CDATA 

Function Documentation

◆ free_xml_node()

static void free_xml_node ( xml_node_t node)
static

◆ free_xml_property()

static void free_xml_property ( xml_property_t property)
static

◆ new_xml_node()

static xml_node_t * new_xml_node ( void  )
static

◆ new_xml_property()

static xml_property_t * new_xml_property ( void  )
static

◆ strtoupper()

static char * strtoupper ( char *  str)
static

◆ xml_escape_string()

char * xml_escape_string ( const char *  s,
xml_escape_quote_t  quote_type 
)

References NULL, and xml_escape_string_internal().

Referenced by xml_parser_dump_node().

◆ xml_escape_string_internal()

static int xml_escape_string_internal ( char *  buf,
const char *  s,
xml_escape_quote_t  quote_type 
)
static

◆ xml_parser_append_text()

static xml_node_t * xml_parser_append_text ( xml_node_t node,
xml_node_t subnode,
const char *  text,
int  flags 
)
static

◆ xml_parser_build_tree()

int xml_parser_build_tree ( xml_node_t **  root_node)

◆ xml_parser_build_tree_r()

int xml_parser_build_tree_r ( xml_parser_t xml_parser,
xml_node_t **  root_node 
)

◆ xml_parser_build_tree_with_options()

int xml_parser_build_tree_with_options ( xml_node_t **  root_node,
int  flags 
)

◆ xml_parser_build_tree_with_options_r()

int xml_parser_build_tree_with_options_r ( xml_parser_t xml_parser,
xml_node_t **  root_node,
int  flags 
)

◆ xml_parser_dump_node()

static void xml_parser_dump_node ( const xml_node_t node,
int  indent 
)
static

◆ xml_parser_dump_tree()

void xml_parser_dump_tree ( const xml_node_t node)

◆ xml_parser_finalize_r()

void xml_parser_finalize_r ( xml_parser_t xml_parser)

◆ xml_parser_free_props()

static void xml_parser_free_props ( xml_property_t current_property)
static

◆ xml_parser_free_tree()

void xml_parser_free_tree ( xml_node_t current_node)

◆ xml_parser_free_tree_rec()

static void xml_parser_free_tree_rec ( xml_node_t current_node,
int  free_next 
)
static

◆ xml_parser_get_node()

static int xml_parser_get_node ( xml_parser_t xml_parser,
xml_node_t current_node,
int  flags 
)
static

◆ xml_parser_get_node_internal()

static int xml_parser_get_node_internal ( xml_parser_t xml_parser,
char **  token_buffer,
int *  token_buffer_size,
char **  pname_buffer,
int *  pname_buffer_size,
char **  nname_buffer,
int *  nname_buffer_size,
xml_node_t current_node,
char *  root_names[],
int  rec,
int  flags 
)
static

◆ xml_parser_get_property()

const char * xml_parser_get_property ( const xml_node_t node,
const char *  name 
)

◆ xml_parser_get_property_bool()

int xml_parser_get_property_bool ( const xml_node_t node,
const char *  name,
int  def_value 
)

References name, and xml_parser_get_property().

◆ xml_parser_get_property_int()

int xml_parser_get_property_int ( const xml_node_t node,
const char *  name,
int  def_value 
)

References name, and xml_parser_get_property().

◆ xml_parser_init()

void xml_parser_init ( const char *  buf,
int  size,
int  mode 
)

◆ xml_parser_init_r()

xml_parser_t * xml_parser_init_r ( const char *  buf,
int  size,
int  mode 
)

Variable Documentation

◆ cdata

const char cdata[] = CDATA_MARKER
static

◆ static_xml_parser

xml_parser_t* static_xml_parser