libgutenprint API Reference: include/gutenprint/mxml.h File Reference

libgutenprint API Reference 5.2.11

- Main Page
- Related Pages
- Modules
- Data Structures
- Files

- File List
- Globals

Data Structures | Macros | Typedefs | Enumerations | Functions
mxml.h File Reference

Mini-XML XML parsing functions. More...

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

## Data Structures
struct | stp_mxml_attr_s
struct | stp_mxml_value_s
struct | stp_mxml_text_s
union | stp_mxml_value_u
struct | stp_mxml_node_s

## Macros
#define | STP_MXML_WRAP 70 /* Wrap XML output at this column position */
#define | STP_MXML_TAB 8 /* Tabs every N columns */
#define | STP_MXML_NO_CALLBACK 0 /* Don't use a type callback */
#define | STP_MXML_NO_PARENT 0 /* No parent for the node */
#define | STP_MXML_DESCEND 1 /* Descend when finding/walking */
#define | STP_MXML_NO_DESCEND 0 /* Don't descend when finding/walking */
#define | STP_MXML_DESCEND_FIRST -1 /* Descend for first find */
#define | STP_MXML_WS_BEFORE_OPEN 0 /* Callback for before open tag */
#define | STP_MXML_WS_AFTER_OPEN 1 /* Callback for after open tag */
#define | STP_MXML_WS_BEFORE_CLOSE 2 /* Callback for before close tag */
#define | STP_MXML_WS_AFTER_CLOSE 3 /* Callback for after close tag */
#define | STP_MXML_ADD_BEFORE 0 /* Add node before specified node */
#define | STP_MXML_ADD_AFTER 1 /* Add node after specified node */
#define | STP_MXML_ADD_TO_PARENT NULL /* Add node relative to parent */

## Typedefs
typedef enum stp_mxml_type_e | stp_mxml_type_t
typedef struct stp_mxml_attr_s | stp_mxml_attr_t
typedef struct stp_mxml_value_s | stp_mxml_element_t
typedef struct stp_mxml_text_s | stp_mxml_text_t
typedef union stp_mxml_value_u | stp_mxml_value_t
typedef struct stp_mxml_node_s | stp_mxml_node_t

## Enumerations
enum | stp_mxml_type_e { STP_MXML_ELEMENT, STP_MXML_INTEGER, STP_MXML_OPAQUE, STP_MXML_REAL, STP_MXML_TEXT }

## Functions
void | stp_mxmlAdd (stp_mxml_node_t *parent, int where, stp_mxml_node_t *child, stp_mxml_node_t *node)
void | stp_mxmlDelete (stp_mxml_node_t *node)
const char * | stp_mxmlElementGetAttr (stp_mxml_node_t *node, const char *name)
void | stp_mxmlElementSetAttr (stp_mxml_node_t *node, const char *name, const char *value)
stp_mxml_node_t * | stp_mxmlFindElement (stp_mxml_node_t *node, stp_mxml_node_t *top, const char *name, const char *attr, const char *value, int descend)
stp_mxml_node_t * | stp_mxmlLoadFile (stp_mxml_node_t *top, FILE *fp, stp_mxml_type_t(*cb)(stp_mxml_node_t *))
stp_mxml_node_t * | stp_mxmlLoadFromFile (stp_mxml_node_t *top, const char *file, stp_mxml_type_t(*cb)(stp_mxml_node_t *))
stp_mxml_node_t * | stp_mxmlLoadString (stp_mxml_node_t *top, const char *s, stp_mxml_type_t(*cb)(stp_mxml_node_t *))
stp_mxml_node_t * | stp_mxmlNewElement (stp_mxml_node_t *parent, const char *name)
stp_mxml_node_t * | stp_mxmlNewInteger (stp_mxml_node_t *parent, int integer)
stp_mxml_node_t * | stp_mxmlNewOpaque (stp_mxml_node_t *parent, const char *opaque)
stp_mxml_node_t * | stp_mxmlNewReal (stp_mxml_node_t *parent, double real)
stp_mxml_node_t * | stp_mxmlNewText (stp_mxml_node_t *parent, int whitespace, const char *string)
void | stp_mxmlRemove (stp_mxml_node_t *node)
char * | stp_mxmlSaveAllocString (stp_mxml_node_t *node, int(*cb)(stp_mxml_node_t *, int))
int | stp_mxmlSaveFile (stp_mxml_node_t *node, FILE *fp, int(*cb)(stp_mxml_node_t *, int))
int | stp_mxmlSaveToFile (stp_mxml_node_t *node, const char *fp, int(*cb)(stp_mxml_node_t *, int))
int | stp_mxmlSaveString (stp_mxml_node_t *node, char *buffer, int bufsize, int(*cb)(stp_mxml_node_t *, int))
stp_mxml_node_t * | stp_mxmlWalkNext (stp_mxml_node_t *node, stp_mxml_node_t *top, int descend)
stp_mxml_node_t * | stp_mxmlWalkPrev (stp_mxml_node_t *node, stp_mxml_node_t *top, int descend)

## Detailed Description

Mini-XML XML parsing functions.

## Macro Definition Documentation

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

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

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

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

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

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

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

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

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

#define STP_MXML_WRAP 70 /* Wrap XML output at this column position */

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

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

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

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

## Typedef Documentation

typedef struct stp_mxml_attr_s stp_mxml_attr_t

typedef struct stp_mxml_value_s stp_mxml_element_t

typedef struct stp_mxml_node_s stp_mxml_node_t

typedef struct stp_mxml_text_s stp_mxml_text_t

typedef enum stp_mxml_type_e stp_mxml_type_t

typedef union stp_mxml_value_u stp_mxml_value_t

## Enumeration Type Documentation

enum stp_mxml_type_e

Enumerator
STP_MXML_ELEMENT |
STP_MXML_INTEGER |
STP_MXML_OPAQUE |
STP_MXML_REAL |
STP_MXML_TEXT |

## Function Documentation

void stp_mxmlAdd | ( | stp_mxml_node_t * | parent,
|  | int | where,
|  | stp_mxml_node_t * | child,
|  | stp_mxml_node_t * | node
| ) |  |

void stp_mxmlDelete | ( | stp_mxml_node_t * | node | ) |

const char* stp_mxmlElementGetAttr | ( | stp_mxml_node_t * | node,
|  | const char * | name
| ) |  |

void stp_mxmlElementSetAttr | ( | stp_mxml_node_t * | node,
|  | const char * | name,
|  | const char * | value
| ) |  |

stp_mxml_node_t* stp_mxmlFindElement | ( | stp_mxml_node_t * | node,
|  | stp_mxml_node_t * | top,
|  | const char * | name,
|  | const char * | attr,
|  | const char * | value,
|  | int | descend
| ) |  |

stp_mxml_node_t* stp_mxmlLoadFile | ( | stp_mxml_node_t * | top,
|  | FILE * | fp,
|  | stp_mxml_type_t(*)(stp_mxml_node_t *) | cb
| ) |  |

stp_mxml_node_t* stp_mxmlLoadFromFile | ( | stp_mxml_node_t * | top,
|  | const char * | file,
|  | stp_mxml_type_t(*)(stp_mxml_node_t *) | cb
| ) |  |

stp_mxml_node_t* stp_mxmlLoadString | ( | stp_mxml_node_t * | top,
|  | const char * | s,
|  | stp_mxml_type_t(*)(stp_mxml_node_t *) | cb
| ) |  |

stp_mxml_node_t* stp_mxmlNewElement | ( | stp_mxml_node_t * | parent,
|  | const char * | name
| ) |  |

stp_mxml_node_t* stp_mxmlNewInteger | ( | stp_mxml_node_t * | parent,
|  | int | integer
| ) |  |

stp_mxml_node_t* stp_mxmlNewOpaque | ( | stp_mxml_node_t * | parent,
|  | const char * | opaque
| ) |  |

stp_mxml_node_t* stp_mxmlNewReal | ( | stp_mxml_node_t * | parent,
|  | double | real
| ) |  |

stp_mxml_node_t* stp_mxmlNewText | ( | stp_mxml_node_t * | parent,
|  | int | whitespace,
|  | const char * | string
| ) |  |

void stp_mxmlRemove | ( | stp_mxml_node_t * | node | ) |

char* stp_mxmlSaveAllocString | ( | stp_mxml_node_t * | node,
|  | int(*)(stp_mxml_node_t *, int) | cb
| ) |  |

int stp_mxmlSaveFile | ( | stp_mxml_node_t * | node,
|  | FILE * | fp,
|  | int(*)(stp_mxml_node_t *, int) | cb
| ) |  |

int stp_mxmlSaveString | ( | stp_mxml_node_t * | node,
|  | char * | buffer,
|  | int | bufsize,
|  | int(*)(stp_mxml_node_t *, int) | cb
| ) |  |

int stp_mxmlSaveToFile | ( | stp_mxml_node_t * | node,
|  | const char * | fp,
|  | int(*)(stp_mxml_node_t *, int) | cb
| ) |  |

stp_mxml_node_t* stp_mxmlWalkNext | ( | stp_mxml_node_t * | node,
|  | stp_mxml_node_t * | top,
|  | int | descend
| ) |  |

stp_mxml_node_t* stp_mxmlWalkPrev | ( | stp_mxml_node_t * | node,
|  | stp_mxml_node_t * | top,
|  | int | descend
| ) |  |