/home/dko/Projects/mobilec/src/mxml-2.2.2/mxml.h File Reference

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <errno.h>

Go to the source code of this file.

Data Structures

struct  mxml_attr_s
struct  mxml_value_s
struct  mxml_text_s
struct  mxml_custom_s
union  mxml_value_u
struct  mxml_node_s
struct  mxml_index_s

Defines

#define MXML_WRAP   72
#define MXML_TAB   8
#define MXML_NO_CALLBACK   0
#define MXML_INTEGER_CALLBACK   mxml_integer_cb
#define MXML_OPAQUE_CALLBACK   mxml_opaque_cb
#define MXML_REAL_CALLBACK   mxml_real_cb
#define MXML_TEXT_CALLBACK   0
#define MXML_NO_PARENT   0
#define MXML_DESCEND   1
#define MXML_NO_DESCEND   0
#define MXML_DESCEND_FIRST   -1
#define MXML_WS_BEFORE_OPEN   0
#define MXML_WS_AFTER_OPEN   1
#define MXML_WS_BEFORE_CLOSE   2
#define MXML_WS_AFTER_CLOSE   3
#define MXML_ADD_BEFORE   0
#define MXML_ADD_AFTER   1
#define MXML_ADD_TO_PARENT   NULL

Typedefs

typedef enum mxml_type_e mxml_type_t
typedef struct mxml_attr_s mxml_attr_t
typedef struct mxml_value_s mxml_element_t
typedef struct mxml_text_s mxml_text_t
typedef struct mxml_custom_s mxml_custom_t
typedef union mxml_value_u mxml_value_t
typedef struct mxml_node_s mxml_node_t
typedef struct mxml_index_s mxml_index_t
typedef int(* mxml_custom_load_cb_t )(mxml_node_t *, const char *)
typedef char *(* mxml_custom_save_cb_t )(mxml_node_t *)

Enumerations

enum  mxml_type_e {
  MXML_ELEMENT, MXML_INTEGER, MXML_OPAQUE, MXML_REAL,
  MXML_TEXT, MXML_CUSTOM
}

Functions

void mxmlAdd (mxml_node_t *parent, int where, mxml_node_t *child, mxml_node_t *node)
void mxmlDelete (mxml_node_t *node)
const char * mxmlElementGetAttr (mxml_node_t *node, const char *name)
void mxmlElementSetAttr (mxml_node_t *node, const char *name, const char *value)
int mxmlEntityAddCallback (int(*cb)(const char *name))
const char * mxmlEntityGetName (int val)
int mxmlEntityGetValue (const char *name)
void mxmlEntityRemoveCallback (int(*cb)(const char *name))
mxml_node_tmxmlFindElement (mxml_node_t *node, mxml_node_t *top, const char *name, const char *attr, const char *value, int descend)
void mxmlIndexDelete (mxml_index_t *ind)
mxml_node_tmxmlIndexEnum (mxml_index_t *ind)
mxml_node_tmxmlIndexFind (mxml_index_t *ind, const char *element, const char *value)
mxml_index_tmxmlIndexNew (mxml_node_t *node, const char *element, const char *attr)
mxml_node_tmxmlIndexReset (mxml_index_t *ind)
mxml_node_tmxmlLoadFd (mxml_node_t *top, int fd, mxml_type_t(*cb)(mxml_node_t *))
mxml_node_tmxmlLoadFile (mxml_node_t *top, FILE *fp, mxml_type_t(*cb)(mxml_node_t *))
mxml_node_tmxmlLoadString (mxml_node_t *top, const char *s, mxml_type_t(*cb)(mxml_node_t *))
mxml_node_tmxmlNewCustom (mxml_node_t *parent, void *data, void(*destroy)(void *))
mxml_node_tmxmlNewElement (mxml_node_t *parent, const char *name)
mxml_node_tmxmlNewInteger (mxml_node_t *parent, int integer)
mxml_node_tmxmlNewOpaque (mxml_node_t *parent, const char *opaque)
mxml_node_tmxmlNewReal (mxml_node_t *parent, double real)
mxml_node_tmxmlNewText (mxml_node_t *parent, int whitespace, const char *string)
mxml_node_tmxmlNewTextf (mxml_node_t *parent, int whitespace, const char *format,...)
void mxmlRemove (mxml_node_t *node)
char * mxmlSaveAllocString (mxml_node_t *node, const char *(*cb)(mxml_node_t *, int))
int mxmlSaveFd (mxml_node_t *node, int fd, const char *(*cb)(mxml_node_t *, int))
int mxmlSaveFile (mxml_node_t *node, FILE *fp, const char *(*cb)(mxml_node_t *, int))
int mxmlSaveString (mxml_node_t *node, char *buffer, int bufsize, const char *(*cb)(mxml_node_t *, int))
int mxmlSetCustom (mxml_node_t *node, void *data, void(*destroy)(void *))
void mxmlSetCustomHandlers (mxml_custom_load_cb_t load, mxml_custom_save_cb_t save)
int mxmlSetElement (mxml_node_t *node, const char *name)
void mxmlSetErrorCallback (void(*cb)(const char *))
int mxmlSetInteger (mxml_node_t *node, int integer)
int mxmlSetOpaque (mxml_node_t *node, const char *opaque)
int mxmlSetReal (mxml_node_t *node, double real)
int mxmlSetText (mxml_node_t *node, int whitespace, const char *string)
int mxmlSetTextf (mxml_node_t *node, int whitespace, const char *format,...)
mxml_node_tmxmlWalkNext (mxml_node_t *node, mxml_node_t *top, int descend)
mxml_node_tmxmlWalkPrev (mxml_node_t *node, mxml_node_t *top, int descend)
void mxml_error (const char *format,...)
mxml_type_t mxml_integer_cb (mxml_node_t *node)
mxml_type_t mxml_opaque_cb (mxml_node_t *node)
mxml_type_t mxml_real_cb (mxml_node_t *node)

Define Documentation

#define MXML_ADD_AFTER   1
#define MXML_ADD_BEFORE   0

Definition at line 67 of file mxml.h.

Referenced by mxmlAdd(), scan_file(), and sort_node().

#define MXML_ADD_TO_PARENT   NULL
#define MXML_DESCEND   1
#define MXML_DESCEND_FIRST   -1
#define MXML_INTEGER_CALLBACK   mxml_integer_cb

Definition at line 48 of file mxml.h.

Referenced by main().

#define MXML_NO_CALLBACK   0
#define MXML_NO_DESCEND   0
#define MXML_NO_PARENT   0
#define MXML_OPAQUE_CALLBACK   mxml_opaque_cb

Definition at line 50 of file mxml.h.

Referenced by main().

#define MXML_REAL_CALLBACK   mxml_real_cb

Definition at line 52 of file mxml.h.

Referenced by main().

#define MXML_TAB   8

Definition at line 45 of file mxml.h.

Referenced by mxml_write_ws().

#define MXML_TEXT_CALLBACK   0

Definition at line 54 of file mxml.h.

#define MXML_WRAP   72

Definition at line 44 of file mxml.h.

Referenced by mxml_write_node().

#define MXML_WS_AFTER_CLOSE   3

Definition at line 65 of file mxml.h.

Referenced by mxml_write_node(), whitespace_cb(), and ws_cb().

#define MXML_WS_AFTER_OPEN   1

Definition at line 63 of file mxml.h.

Referenced by mxml_write_node(), whitespace_cb(), and ws_cb().

#define MXML_WS_BEFORE_CLOSE   2

Definition at line 64 of file mxml.h.

Referenced by mxml_write_node(), whitespace_cb(), and ws_cb().

#define MXML_WS_BEFORE_OPEN   0

Definition at line 62 of file mxml.h.

Referenced by mxml_write_node(), whitespace_cb(), and ws_cb().


Typedef Documentation

typedef struct mxml_attr_s mxml_attr_t
typedef int(* mxml_custom_load_cb_t)(mxml_node_t *, const char *)

Definition at line 142 of file mxml.h.

typedef char*(* mxml_custom_save_cb_t)(mxml_node_t *)

Definition at line 145 of file mxml.h.

typedef struct mxml_custom_s mxml_custom_t
typedef struct mxml_value_s mxml_element_t
typedef struct mxml_index_s mxml_index_t
typedef struct mxml_node_s mxml_node_t
typedef struct mxml_text_s mxml_text_t
typedef enum mxml_type_e mxml_type_t
typedef union mxml_value_u mxml_value_t

Enumeration Type Documentation

Enumerator:
MXML_ELEMENT 
MXML_INTEGER 
MXML_OPAQUE 
MXML_REAL 
MXML_TEXT 
MXML_CUSTOM 

Definition at line 76 of file mxml.h.


Function Documentation

void mxml_error ( const char *  format,
  ... 
)
mxml_type_t mxml_integer_cb ( mxml_node_t node  ) 

Definition at line 99 of file mxml-private.c.

References MXML_INTEGER.

mxml_type_t mxml_opaque_cb ( mxml_node_t node  ) 

Definition at line 112 of file mxml-private.c.

References MXML_OPAQUE.

mxml_type_t mxml_real_cb ( mxml_node_t node  ) 

Definition at line 125 of file mxml-private.c.

References MXML_REAL.

void mxmlAdd ( mxml_node_t parent,
int  where,
mxml_node_t child,
mxml_node_t node 
)
void mxmlDelete ( mxml_node_t node  ) 
const char* mxmlElementGetAttr ( mxml_node_t node,
const char *  name 
)
void mxmlElementSetAttr ( mxml_node_t node,
const char *  name,
const char *  value 
)
int mxmlEntityAddCallback ( int(*)(const char *name)  cb  ) 

Definition at line 69 of file mxml-entity.c.

References callbacks, mxml_error(), and num_callbacks.

const char* mxmlEntityGetName ( int  val  ) 

Definition at line 95 of file mxml-entity.c.

Referenced by mxml_write_name(), and mxml_write_string().

int mxmlEntityGetValue ( const char *  name  ) 

Definition at line 125 of file mxml-entity.c.

References callbacks, and num_callbacks.

Referenced by mxml_get_entity().

void mxmlEntityRemoveCallback ( int(*)(const char *name)  cb  ) 

Definition at line 144 of file mxml-entity.c.

References callbacks, and num_callbacks.

mxml_node_t* mxmlFindElement ( mxml_node_t node,
mxml_node_t top,
const char *  name,
const char *  attr,
const char *  value,
int  descend 
)
void mxmlIndexDelete ( mxml_index_t ind  ) 

Definition at line 62 of file mxml-index.c.

References mxml_index_s::alloc_nodes, mxml_index_s::attr, and mxml_index_s::nodes.

Referenced by main(), and mxmlIndexNew().

mxml_node_t* mxmlIndexEnum ( mxml_index_t ind  ) 

Definition at line 92 of file mxml-index.c.

References mxml_index_s::cur_node, mxml_index_s::nodes, and mxml_index_s::num_nodes.

Referenced by main(), and mxmlIndexFind().

mxml_node_t* mxmlIndexFind ( mxml_index_t ind,
const char *  element,
const char *  value 
)
mxml_index_t* mxmlIndexNew ( mxml_node_t node,
const char *  element,
const char *  attr 
)
mxml_node_t* mxmlIndexReset ( mxml_index_t ind  ) 

Definition at line 463 of file mxml-index.c.

References mxml_index_s::cur_node, mxml_index_s::nodes, and mxml_index_s::num_nodes.

Referenced by main().

mxml_node_t* mxmlLoadFd ( mxml_node_t top,
int  fd,
mxml_type_t(*)(mxml_node_t *)  cb 
)
mxml_node_t* mxmlLoadFile ( mxml_node_t top,
FILE *  fp,
mxml_type_t(*)(mxml_node_t *)  cb 
)
mxml_node_t* mxmlLoadString ( mxml_node_t top,
const char *  s,
mxml_type_t(*)(mxml_node_t *)  cb 
)
mxml_node_t* mxmlNewCustom ( mxml_node_t parent,
void *  data,
void(*)(void *)  destroy 
)
mxml_node_t* mxmlNewElement ( mxml_node_t parent,
const char *  name 
)
mxml_node_t* mxmlNewInteger ( mxml_node_t parent,
int  integer 
)

Definition at line 365 of file mxml-node.c.

References mxml_value_u::integer, MXML_INTEGER, mxml_new(), node, and mxml_node_s::value.

Referenced by main(), and mxml_load_data().

mxml_node_t* mxmlNewOpaque ( mxml_node_t parent,
const char *  opaque 
)

Definition at line 396 of file mxml-node.c.

References mxml_new(), MXML_OPAQUE, node, mxml_value_u::opaque, strdup, and mxml_node_s::value.

Referenced by main(), and mxml_load_data().

mxml_node_t* mxmlNewReal ( mxml_node_t parent,
double  real 
)

Definition at line 434 of file mxml-node.c.

References mxml_new(), MXML_REAL, node, mxml_value_u::real, and mxml_node_s::value.

Referenced by main(), and mxml_load_data().

mxml_node_t* mxmlNewText ( mxml_node_t parent,
int  whitespace,
const char *  string 
)
mxml_node_t* mxmlNewTextf ( mxml_node_t parent,
int  whitespace,
const char *  format,
  ... 
)
void mxmlRemove ( mxml_node_t node  ) 
char* mxmlSaveAllocString ( mxml_node_t node,
const char *(*)(mxml_node_t *, int cb 
)
int mxmlSaveFd ( mxml_node_t node,
int  fd,
const char *(*)(mxml_node_t *, int cb 
)
int mxmlSaveFile ( mxml_node_t node,
FILE *  fp,
const char *(*)(mxml_node_t *, int cb 
)
int mxmlSaveString ( mxml_node_t node,
char *  buffer,
int  bufsize,
const char *(*)(mxml_node_t *, int cb 
)
int mxmlSetCustom ( mxml_node_t node,
void *  data,
void(*)(void *)  destroy 
)
void mxmlSetCustomHandlers ( mxml_custom_load_cb_t  load,
mxml_custom_save_cb_t  save 
)

Definition at line 457 of file mxml-file.c.

References mxml_custom_load_cb, and mxml_custom_save_cb.

int mxmlSetElement ( mxml_node_t node,
const char *  name 
)
void mxmlSetErrorCallback ( void(*)(const char *)  cb  ) 

Definition at line 472 of file mxml-file.c.

References mxml_error_cb.

int mxmlSetInteger ( mxml_node_t node,
int  integer 
)

Definition at line 113 of file mxml-set.c.

References mxml_value_u::integer, MXML_INTEGER, mxml_node_s::type, and mxml_node_s::value.

int mxmlSetOpaque ( mxml_node_t node,
const char *  opaque 
)
int mxmlSetReal ( mxml_node_t node,
double  real 
)

Definition at line 170 of file mxml-set.c.

References MXML_REAL, mxml_value_u::real, mxml_node_s::type, and mxml_node_s::value.

int mxmlSetText ( mxml_node_t node,
int  whitespace,
const char *  string 
)
int mxmlSetTextf ( mxml_node_t node,
int  whitespace,
const char *  format,
  ... 
)
mxml_node_t* mxmlWalkNext ( mxml_node_t node,
mxml_node_t top,
int  descend 
)

Definition at line 137 of file mxml-search.c.

References mxml_node_s::child, mxml_node_s::next, and mxml_node_s::parent.

Referenced by mxmlFindElement(), and write_element().

mxml_node_t* mxmlWalkPrev ( mxml_node_t node,
mxml_node_t top,
int  descend 
)

Definition at line 173 of file mxml-search.c.

References mxml_node_s::last_child, mxml_node_s::parent, and mxml_node_s::prev.

Generated on Tue Dec 28 15:15:28 2010 for Mobile-C by  doxygen 1.6.3