Contents

Classes

Enumerations


mxml_type_e

Node Type

Values

NameDescription
MXML_ELEMENTXML element with attributes
MXML_INTEGERInteger value
MXML_OPAQUEOpaque string
MXML_REALReal value
MXML_TEXTText fragment

Functions


mxmlAdd()

Local functions...

Syntax

void
mxmlAdd(
    mxml_node_t * parent,
    int where,
    mxml_node_t * child,
    mxml_node_t * node);

Arguments

NameDescription
parentParent node
whereWhere to add
childChild node for where
nodeNode to add

Returns

Nothing.


mxmlDelete()

Delete a node and all of its children.

Syntax

void
mxmlDelete(
    mxml_node_t * node);

Arguments

NameDescription
nodeNode

Returns

Nothing.


mxmlElementGetAttr()

Get an attribute.

Syntax

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

Arguments

NameDescription
nodeElement node
nameName of attribute

Returns

Attribute value or NULL


mxmlElementSetAttr()

Set an attribute.

Syntax

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

Arguments

NameDescription
nodeElement node
nameName of attribute
valueAttribute value

Returns

Nothing.


mxmlFindElement()

Find the named element.

Syntax

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

Arguments

NameDescription
nodeCurrent node
topTop node
nameElement name or NULL for any
attrAttribute name, or NULL for none
valueAttribute value, or NULL for any
descendDescend into tree?

Returns

Element node or NULL


mxmlLoadFile()

mxml_node_t *Top nodeFILE *File to read frommxml_type_tCallback functionNew nodemxml_node_t *Create a new element node.mxml_node_t *Parent nodeconst char *Name of elementNew nodemxml_node_t *Create a new integer node.mxml_node_t *Parent nodeintInteger valueNew nodemxml_node_t *Create a new opaque string.mxml_node_t *Parent nodeconst char *Opaque stringNew nodemxml_node_t *Create a new real number node.mxml_node_t *Parent nodedoubleReal number valueNew nodemxml_node_t *Create a new text fragment node.mxml_node_t *Parent nodeintLeading whitespace?const char *StringRemove a node from its parent.mxml_node_t *Node to remove0 on success, -1 on errorintSave an XML tree to a file.mxml_node_t *Node to writeFILE *File to write tointWhitespace callbackNext node or NULLmxml_node_t *Walk to the next logical node in the tree.mxml_node_t *Current nodemxml_node_t *Top nodeintDescend into tree?Previous node or NULLmxml_node_t *Walk to the previous logical node in the tree.mxml_node_t *Current nodemxml_node_t *Top nodeintDescend into tree?Data types...char *Attribute namechar *Attribute valuestruct mxml_attr_sstruct mxml_value_smxml_node_t *First child nodemxml_node_t *Last child nodemxml_node_t *Next node under same parentmxml_node_t *Parent nodemxml_node_t *Previous node under same parentmxml_type_tNode typemxml_value_tNode valuechar *Fragment stringintLeading whitespace?struct mxml_text_sNode TypeXML element with attributesInteger valueOpaque stringReal valueText fragmentAttribute ValueElement ValueText ValueNode ValueNodeC++ support...Prototypes...C++ support...End of "$Id: documentation.html,v 1.3 2003/06/07 21:27:05 mike Exp $".enum mxml_type_emxml_attr_t *Attributeschar *Name of elementintNumber of attributesunion mxml_value_umxml_element_tElementintInteger numberchar *Opaque stringdoubleReal numbermxml_text_tText fragmentmxml_node_t *Current nodemxml_node_t *Parent nodeNode typeconst char *String to writeFile to write toint(*cb)(mxml_node_t *int) intWhere valueCurrent column

Syntax

mxml_node_t *
mxmlLoadFile(
    mxml_node_t * top,
    FILE * fp,
    mxml_type_t (*cb)(mxml_node_t *));

Arguments

NameDescription
topTop node
fpFile to read from
(*cb)(mxml_node_t *)Callback function

Returns

Local functions...


mxmlNewElement()

Create a new element node.

Syntax

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

Arguments

NameDescription
parentParent node
nameName of element

Returns

New node


mxmlNewInteger()

Create a new integer node.

Syntax

mxml_node_t *
mxmlNewInteger(
    mxml_node_t * parent,
    int integer);

Arguments

NameDescription
parentParent node
integerInteger value

Returns

New node


mxmlNewOpaque()

Create a new opaque string.

Syntax

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

Arguments

NameDescription
parentParent node
opaqueOpaque string

Returns

New node


mxmlNewReal()

Create a new real number node.

Syntax

mxml_node_t *
mxmlNewReal(
    mxml_node_t * parent,
    double real);

Arguments

NameDescription
parentParent node
realReal number value

Returns

New node


mxmlNewText()

Create a new text fragment node.

Syntax

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

Arguments

NameDescription
parentParent node
whitespaceLeading whitespace?
stringString

Returns

New node


mxmlRemove()

Remove a node from its parent.

Syntax

void
mxmlRemove(
    mxml_node_t * node);

Arguments

NameDescription
nodeNode to remove

Returns

Nothing.


mxmlSaveFile()

Save an XML tree to a file.

Syntax

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

Arguments

NameDescription
nodeNode to write
fpFile to write to
(*cb)(mxml_node_t *int)Whitespace callback

Returns

0 on success, -1 on error


mxmlWalkNext()

Walk to the next logical node in the tree.

Syntax

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

Arguments

NameDescription
nodeCurrent node
topTop node
descendDescend into tree?

Returns

Next node or NULL


mxmlWalkPrev()

Walk to the previous logical node in the tree.

Syntax

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

Arguments

NameDescription
nodeCurrent node
topTop node
descendDescend into tree?

Returns

Previous node or NULL

Structures


mxml_attr_s

Data types...

Definition

struct mxml_attr_s
{
  char * name;
  char * value;
};

Members

NameDescription
nameAttribute name
valueAttribute value


mxml_node_s

mxml_node_t *First child nodemxml_node_t *Last child nodemxml_node_t *Next node under same parentmxml_node_t *Parent nodemxml_node_t *Previous node under same parentmxml_type_tNode typemxml_value_tNode valuechar *Fragment stringintLeading whitespace?struct mxml_text_sNode TypeXML element with attributesInteger valueOpaque stringReal valueText fragmentAttribute ValueElement ValueText ValueNode ValueNodeC++ support...Prototypes...C++ support...End of "$Id: documentation.html,v 1.3 2003/06/07 21:27:05 mike Exp $".enum mxml_type_emxml_attr_t *Attributeschar *Name of elementintNumber of attributesunion mxml_value_umxml_element_tElementintInteger numberchar *Opaque stringdoubleReal numbermxml_text_tText fragmentmxml_node_t *Current nodemxml_node_t *Parent nodeNode typeconst char *String to writeFile to write toint(*cb)(mxml_node_t *int) intWhere valueCurrent column

Definition

struct mxml_node_s
{
  mxml_node_t * child;
  mxml_node_t * last_child;
  mxml_node_t * next;
  mxml_node_t * parent;
  mxml_node_t * prev;
  mxml_type_t type;
  mxml_value_t value;
};

Members

NameDescription
childFirst child node
last_childLast child node
nextNext node under same parent
parentParent node
prevPrevious node under same parent
typeNode type
valueNode value


mxml_text_s

char *Fragment stringintLeading whitespace?struct mxml_text_sNode TypeXML element with attributesInteger valueOpaque stringReal valueText fragmentAttribute ValueElement ValueText ValueNode ValueNodeC++ support...Prototypes...C++ support...End of "$Id: documentation.html,v 1.3 2003/06/07 21:27:05 mike Exp $".enum mxml_type_emxml_attr_t *Attributeschar *Name of elementintNumber of attributesunion mxml_value_umxml_element_tElementintInteger numberchar *Opaque stringdoubleReal numbermxml_text_tText fragmentmxml_node_t *Current nodemxml_node_t *Parent nodeNode typeconst char *String to writeFile to write toint(*cb)(mxml_node_t *int) intWhere valueCurrent column

Definition

struct mxml_text_s
{
  char * string;
  int whitespace;
};

Members

NameDescription
stringFragment string
whitespaceLeading whitespace?


mxml_value_s

mxml_attr_t *Attributeschar *Name of elementintNumber of attributesunion mxml_value_umxml_element_tElementintInteger numberchar *Opaque stringdoubleReal numbermxml_text_tText fragmentmxml_node_t *Current nodemxml_node_t *Parent nodeNode typeconst char *String to writeFile to write toint(*cb)(mxml_node_t *int) intWhere valueCurrent column

Definition

struct mxml_value_s
{
  mxml_attr_t * attrs;
  char * name;
  int num_attrs;
};

Members

NameDescription
attrsAttributes
nameName of element
num_attrsNumber of attributes

Types


mxml_attr_t

Definition

typedef struct mxml_attr_s mxml_attr_t;

mxml_element_t

Definition

typedef struct mxml_value_s mxml_element_t;

mxml_text_t

Definition

typedef struct mxml_text_s mxml_text_t;

mxml_type_t

Definition

typedef enum mxml_type_e mxml_type_t;

mxml_value_t

Definition

typedef union mxml_value_u mxml_value_t;

Unions


mxml_value_u

mxml_element_tElementintInteger numberchar *Opaque stringdoubleReal numbermxml_text_tText fragmentmxml_node_t *Current nodemxml_node_t *Parent nodeNode typeconst char *String to writeFile to write toint(*cb)(mxml_node_t *int) intWhere valueCurrent column

Definition

struct mxml_value_u
{
  mxml_element_t element;
  int integer;
  char * opaque;
  double real;
  mxml_text_t text;
};

Members

NameDescription
elementElement
integerInteger number
opaqueOpaque string
realReal number
textText fragment