Process Hacker
mxml.h File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <errno.h>
#include <windows.h>

Go to the source code of this file.

Data Structures

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

Macros

#define PHMXMLAPI
 
#define MXML_TAB   8 /* Tabs every N columns */
 
#define MXML_NO_CALLBACK   0 /* Don't use a type callback */
 
#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 /* Treat all data as text */
 
#define MXML_IGNORE_CALLBACK   mxml_ignore_cb
 
#define MXML_NO_PARENT   0 /* No parent for the node */
 
#define MXML_DESCEND   1 /* Descend when finding/walking */
 
#define MXML_NO_DESCEND   0 /* Don't descend when finding/walking */
 
#define MXML_DESCEND_FIRST   -1 /* Descend for first find */
 
#define MXML_WS_BEFORE_OPEN   0 /* Callback for before open tag */
 
#define MXML_WS_AFTER_OPEN   1 /* Callback for after open tag */
 
#define MXML_WS_BEFORE_CLOSE   2 /* Callback for before close tag */
 
#define MXML_WS_AFTER_CLOSE   3 /* Callback for after close tag */
 
#define MXML_ADD_BEFORE   0 /* Add node before specified node */
 
#define MXML_ADD_AFTER   1 /* Add node after specified node */
 
#define MXML_ADD_TO_PARENT   NULL /* Add node relative to parent */
 

Typedefs

typedef enum mxml_sax_event_e mxml_sax_event_t
 
typedef enum mxml_type_e mxml_type_t
 
typedef void(* mxml_custom_destroy_cb_t )(void *)
 
typedef void(* mxml_error_cb_t )(const char *)
 
typedef struct mxml_attr_s mxml_attr_t
 
typedef struct mxml_element_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 *)
 
typedef int(* mxml_entity_cb_t )(const char *)
 
typedef mxml_type_t(* mxml_load_cb_t )(mxml_node_t *)
 
typedef const char *(* mxml_save_cb_t )(mxml_node_t *, int)
 
typedef void(* mxml_sax_cb_t )(mxml_node_t *, mxml_sax_event_t, void *)
 

Enumerations

enum  mxml_sax_event_e {
  MXML_SAX_CDATA, MXML_SAX_COMMENT, MXML_SAX_DATA, MXML_SAX_DIRECTIVE,
  MXML_SAX_ELEMENT_CLOSE, MXML_SAX_ELEMENT_OPEN
}
 
enum  mxml_type_e {
  MXML_IGNORE = -1, MXML_ELEMENT, MXML_INTEGER, MXML_OPAQUE,
  MXML_REAL, MXML_TEXT, MXML_CUSTOM
}
 

Functions

PHMXMLAPI void mxmlAdd (mxml_node_t *parent, int where, mxml_node_t *child, mxml_node_t *node)
 
PHMXMLAPI void mxmlDelete (mxml_node_t *node)
 
PHMXMLAPI void mxmlElementDeleteAttr (mxml_node_t *node, const char *name)
 
PHMXMLAPI const char * mxmlElementGetAttr (mxml_node_t *node, const char *name)
 
PHMXMLAPI void mxmlElementSetAttr (mxml_node_t *node, const char *name, const char *value)
 
void mxmlElementSetAttrf (mxml_node_t *node, const char *name, const char *format,...)
 
int mxmlEntityAddCallback (mxml_entity_cb_t cb)
 
const char * mxmlEntityGetName (int val)
 
int mxmlEntityGetValue (const char *name)
 
void mxmlEntityRemoveCallback (mxml_entity_cb_t cb)
 
PHMXMLAPI 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)
 
PHMXMLAPI mxml_node_tmxmlLoadFd (mxml_node_t *top, HANDLE fd, mxml_type_t(*cb)(mxml_node_t *))
 
mxml_node_tmxmlLoadFile (mxml_node_t *top, FILE *fp, mxml_type_t(*cb)(mxml_node_t *))
 
PHMXMLAPI mxml_node_tmxmlLoadString (mxml_node_t *top, const char *s, mxml_type_t(*cb)(mxml_node_t *))
 
PHMXMLAPI mxml_node_tmxmlNewCDATA (mxml_node_t *parent, const char *string)
 
PHMXMLAPI mxml_node_tmxmlNewCustom (mxml_node_t *parent, void *data, mxml_custom_destroy_cb_t destroy)
 
PHMXMLAPI mxml_node_tmxmlNewElement (mxml_node_t *parent, const char *name)
 
mxml_node_tmxmlNewInteger (mxml_node_t *parent, int integer)
 
PHMXMLAPI mxml_node_tmxmlNewOpaque (mxml_node_t *parent, const char *opaque)
 
mxml_node_tmxmlNewReal (mxml_node_t *parent, double real)
 
PHMXMLAPI mxml_node_tmxmlNewText (mxml_node_t *parent, int whitespace, const char *string)
 
mxml_node_tmxmlNewTextf (mxml_node_t *parent, int whitespace, const char *format,...)
 
PHMXMLAPI mxml_node_tmxmlNewXML (const char *version)
 
PHMXMLAPI int mxmlRelease (mxml_node_t *node)
 
PHMXMLAPI void mxmlRemove (mxml_node_t *node)
 
PHMXMLAPI int mxmlRetain (mxml_node_t *node)
 
PHMXMLAPI char * mxmlSaveAllocString (mxml_node_t *node, mxml_save_cb_t cb)
 
PHMXMLAPI int mxmlSaveFd (mxml_node_t *node, HANDLE fd, mxml_save_cb_t cb)
 
int mxmlSaveFile (mxml_node_t *node, FILE *fp, mxml_save_cb_t cb)
 
PHMXMLAPI int mxmlSaveString (mxml_node_t *node, char *buffer, int bufsize, mxml_save_cb_t cb)
 
mxml_node_tmxmlSAXLoadFd (mxml_node_t *top, HANDLE fd, mxml_type_t(*cb)(mxml_node_t *), mxml_sax_cb_t sax, void *sax_data)
 
mxml_node_tmxmlSAXLoadFile (mxml_node_t *top, FILE *fp, mxml_type_t(*cb)(mxml_node_t *), mxml_sax_cb_t sax, void *sax_data)
 
mxml_node_tmxmlSAXLoadString (mxml_node_t *top, const char *s, mxml_type_t(*cb)(mxml_node_t *), mxml_sax_cb_t sax, void *sax_data)
 
PHMXMLAPI int mxmlSetCDATA (mxml_node_t *node, const char *data)
 
PHMXMLAPI int mxmlSetCustom (mxml_node_t *node, void *data, mxml_custom_destroy_cb_t destroy)
 
PHMXMLAPI void mxmlSetCustomHandlers (mxml_custom_load_cb_t load, mxml_custom_save_cb_t save)
 
PHMXMLAPI int mxmlSetElement (mxml_node_t *node, const char *name)
 
PHMXMLAPI void mxmlSetErrorCallback (mxml_error_cb_t cb)
 
int mxmlSetInteger (mxml_node_t *node, int integer)
 
PHMXMLAPI int mxmlSetOpaque (mxml_node_t *node, const char *opaque)
 
int mxmlSetReal (mxml_node_t *node, double real)
 
PHMXMLAPI int mxmlSetText (mxml_node_t *node, int whitespace, const char *string)
 
int mxmlSetTextf (mxml_node_t *node, int whitespace, const char *format,...)
 
void mxmlSetWrapMargin (int column)
 
PHMXMLAPI mxml_node_tmxmlWalkNext (mxml_node_t *node, mxml_node_t *top, int descend)
 
PHMXMLAPI mxml_node_tmxmlWalkPrev (mxml_node_t *node, mxml_node_t *top, int descend)
 
void mxml_error (const char *format,...)
 
mxml_type_t mxml_ignore_cb (mxml_node_t *node)
 
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)
 

Macro Definition Documentation

#define MXML_ADD_AFTER   1 /* Add node after specified node */

Definition at line 77 of file mxml.h.

#define MXML_ADD_BEFORE   0 /* Add node before specified node */

Definition at line 76 of file mxml.h.

#define MXML_ADD_TO_PARENT   NULL /* Add node relative to parent */

Definition at line 78 of file mxml.h.

#define MXML_DESCEND   1 /* Descend when finding/walking */

Definition at line 67 of file mxml.h.

#define MXML_DESCEND_FIRST   -1 /* Descend for first find */

Definition at line 69 of file mxml.h.

#define MXML_IGNORE_CALLBACK   mxml_ignore_cb

Definition at line 62 of file mxml.h.

#define MXML_INTEGER_CALLBACK   mxml_integer_cb

Definition at line 55 of file mxml.h.

#define MXML_NO_CALLBACK   0 /* Don't use a type callback */

Definition at line 54 of file mxml.h.

#define MXML_NO_DESCEND   0 /* Don't descend when finding/walking */

Definition at line 68 of file mxml.h.

#define MXML_NO_PARENT   0 /* No parent for the node */

Definition at line 65 of file mxml.h.

#define MXML_OPAQUE_CALLBACK   mxml_opaque_cb

Definition at line 57 of file mxml.h.

#define MXML_REAL_CALLBACK   mxml_real_cb

Definition at line 59 of file mxml.h.

#define MXML_TAB   8 /* Tabs every N columns */

Definition at line 52 of file mxml.h.

#define MXML_TEXT_CALLBACK   0 /* Treat all data as text */

Definition at line 61 of file mxml.h.

#define MXML_WS_AFTER_CLOSE   3 /* Callback for after close tag */

Definition at line 74 of file mxml.h.

#define MXML_WS_AFTER_OPEN   1 /* Callback for after open tag */

Definition at line 72 of file mxml.h.

#define MXML_WS_BEFORE_CLOSE   2 /* Callback for before close tag */

Definition at line 73 of file mxml.h.

#define MXML_WS_BEFORE_OPEN   0 /* Callback for before open tag */

Definition at line 71 of file mxml.h.

#define PHMXMLAPI

Definition at line 44 of file mxml.h.

Typedef Documentation

typedef struct mxml_attr_s mxml_attr_t
typedef void(* mxml_custom_destroy_cb_t)(void *)

Definition at line 106 of file mxml.h.

typedef int(* mxml_custom_load_cb_t)(mxml_node_t *, const char *)

Definition at line 169 of file mxml.h.

typedef char*(* mxml_custom_save_cb_t)(mxml_node_t *)

Definition at line 172 of file mxml.h.

typedef struct mxml_custom_s mxml_custom_t
typedef int(* mxml_entity_cb_t)(const char *)

Definition at line 175 of file mxml.h.

typedef void(* mxml_error_cb_t)(const char *)

Definition at line 109 of file mxml.h.

typedef struct mxml_index_s mxml_index_t
typedef mxml_type_t(* mxml_load_cb_t)(mxml_node_t *)

Definition at line 178 of file mxml.h.

typedef struct mxml_node_s mxml_node_t
typedef const char*(* mxml_save_cb_t)(mxml_node_t *, int)

Definition at line 181 of file mxml.h.

typedef void(* mxml_sax_cb_t)(mxml_node_t *, mxml_sax_event_t, void *)

Definition at line 184 of file mxml.h.

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_SAX_CDATA 
MXML_SAX_COMMENT 
MXML_SAX_DATA 
MXML_SAX_DIRECTIVE 
MXML_SAX_ELEMENT_CLOSE 
MXML_SAX_ELEMENT_OPEN 

Definition at line 85 of file mxml.h.

Enumerator:
MXML_IGNORE 
MXML_ELEMENT 
MXML_INTEGER 
MXML_OPAQUE 
MXML_REAL 
MXML_TEXT 
MXML_CUSTOM 

Definition at line 95 of file mxml.h.

Function Documentation

void mxml_error ( const char *  format,
  ... 
)

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

mxml_type_t mxml_ignore_cb ( mxml_node_t node)

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

mxml_type_t mxml_integer_cb ( mxml_node_t node)

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

mxml_type_t mxml_opaque_cb ( mxml_node_t node)

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

mxml_type_t mxml_real_cb ( mxml_node_t node)

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

PHMXMLAPI void mxmlAdd ( mxml_node_t parent,
int  where,
mxml_node_t child,
mxml_node_t node 
)

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

PHMXMLAPI void mxmlDelete ( mxml_node_t node)

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

PHMXMLAPI void mxmlElementDeleteAttr ( mxml_node_t node,
const char *  name 
)

Definition at line 51 of file mxml-attr.c.

PHMXMLAPI const char* mxmlElementGetAttr ( mxml_node_t node,
const char *  name 
)

Definition at line 110 of file mxml-attr.c.

PHMXMLAPI void mxmlElementSetAttr ( mxml_node_t node,
const char *  name,
const char *  value 
)

Definition at line 172 of file mxml-attr.c.

void mxmlElementSetAttrf ( mxml_node_t node,
const char *  name,
const char *  format,
  ... 
)

Definition at line 213 of file mxml-attr.c.

int mxmlEntityAddCallback ( mxml_entity_cb_t  cb)

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

const char* mxmlEntityGetName ( int  val)

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

int mxmlEntityGetValue ( const char *  name)

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

void mxmlEntityRemoveCallback ( mxml_entity_cb_t  cb)

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

PHMXMLAPI mxml_node_t* mxmlFindElement ( mxml_node_t node,
mxml_node_t top,
const char *  name,
const char *  attr,
const char *  value,
int  descend 
)

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

void mxmlIndexDelete ( mxml_index_t ind)

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

mxml_node_t* mxmlIndexEnum ( mxml_index_t ind)

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

mxml_node_t* mxmlIndexFind ( mxml_index_t ind,
const char *  element,
const char *  value 
)

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

mxml_index_t* mxmlIndexNew ( mxml_node_t node,
const char *  element,
const char *  attr 
)

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

mxml_node_t* mxmlIndexReset ( mxml_index_t ind)

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

PHMXMLAPI mxml_node_t* mxmlLoadFd ( mxml_node_t top,
HANDLE  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 
)
PHMXMLAPI mxml_node_t* mxmlLoadString ( mxml_node_t top,
const char *  s,
mxml_type_t(*)(mxml_node_t *)  cb 
)
PHMXMLAPI mxml_node_t* mxmlNewCDATA ( mxml_node_t parent,
const char *  string 
)

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

PHMXMLAPI mxml_node_t* mxmlNewCustom ( mxml_node_t parent,
void *  data,
mxml_custom_destroy_cb_t  destroy 
)

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

PHMXMLAPI mxml_node_t* mxmlNewElement ( mxml_node_t parent,
const char *  name 
)

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

mxml_node_t* mxmlNewInteger ( mxml_node_t parent,
int  integer 
)

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

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

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

mxml_node_t* mxmlNewReal ( mxml_node_t parent,
double  real 
)

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

PHMXMLAPI mxml_node_t* mxmlNewText ( mxml_node_t parent,
int  whitespace,
const char *  string 
)

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

mxml_node_t* mxmlNewTextf ( mxml_node_t parent,
int  whitespace,
const char *  format,
  ... 
)

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

PHMXMLAPI mxml_node_t* mxmlNewXML ( const char *  version)

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

PHMXMLAPI int mxmlRelease ( mxml_node_t node)

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

PHMXMLAPI void mxmlRemove ( mxml_node_t node)

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

PHMXMLAPI int mxmlRetain ( mxml_node_t node)

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

PHMXMLAPI char* mxmlSaveAllocString ( mxml_node_t node,
mxml_save_cb_t  cb 
)

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

PHMXMLAPI int mxmlSaveFd ( mxml_node_t node,
HANDLE  fd,
mxml_save_cb_t  cb 
)

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

int mxmlSaveFile ( mxml_node_t node,
FILE *  fp,
mxml_save_cb_t  cb 
)

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

PHMXMLAPI int mxmlSaveString ( mxml_node_t node,
char *  buffer,
int  bufsize,
mxml_save_cb_t  cb 
)

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

mxml_node_t* mxmlSAXLoadFd ( mxml_node_t top,
HANDLE  fd,
mxml_type_t(*)(mxml_node_t *)  cb,
mxml_sax_cb_t  sax,
void *  sax_data 
)
mxml_node_t* mxmlSAXLoadFile ( mxml_node_t top,
FILE *  fp,
mxml_type_t(*)(mxml_node_t *)  cb,
mxml_sax_cb_t  sax,
void *  sax_data 
)
mxml_node_t* mxmlSAXLoadString ( mxml_node_t top,
const char *  s,
mxml_type_t(*)(mxml_node_t *)  cb,
mxml_sax_cb_t  sax,
void *  sax_data 
)
PHMXMLAPI int mxmlSetCDATA ( mxml_node_t node,
const char *  data 
)

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

PHMXMLAPI int mxmlSetCustom ( mxml_node_t node,
void *  data,
mxml_custom_destroy_cb_t  destroy 
)

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

PHMXMLAPI void mxmlSetCustomHandlers ( mxml_custom_load_cb_t  load,
mxml_custom_save_cb_t  save 
)

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

PHMXMLAPI int mxmlSetElement ( mxml_node_t node,
const char *  name 
)

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

PHMXMLAPI void mxmlSetErrorCallback ( mxml_error_cb_t  cb)

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

int mxmlSetInteger ( mxml_node_t node,
int  integer 
)

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

PHMXMLAPI int mxmlSetOpaque ( mxml_node_t node,
const char *  opaque 
)

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

int mxmlSetReal ( mxml_node_t node,
double  real 
)

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

PHMXMLAPI int mxmlSetText ( mxml_node_t node,
int  whitespace,
const char *  string 
)

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

int mxmlSetTextf ( mxml_node_t node,
int  whitespace,
const char *  format,
  ... 
)

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

void mxmlSetWrapMargin ( int  column)

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

PHMXMLAPI mxml_node_t* mxmlWalkNext ( mxml_node_t node,
mxml_node_t top,
int  descend 
)

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

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

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