libgimpprint API Reference: mxml.h File Reference

Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

# include/gimp-print/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 | stp_mxml_attr_s
struct | stp_mxml_value_s
struct | stp_mxml_text_s
union | stp_mxml_value_u
struct | stp_mxml_node_s
## Defines
#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 stp_mxml_attr_s | stp_mxml_attr_t
typedef stp_mxml_value_s | stp_mxml_element_t
typedef stp_mxml_text_s | stp_mxml_text_t
typedef stp_mxml_value_u | stp_mxml_value_t
typedef 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_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_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)

## Define Documentation

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

| Definition at line 69 of file mxml.h. Referenced by mxml_new(), stp_mxmlAdd(), stp_xmltree_create_from_array(), stp_xmltree_create_from_curve(), and xmldoc_create_from_curve().

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

| Definition at line 67 of file mxml.h. Referenced by stp_mxmlAdd().

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

| Definition at line 71 of file mxml.h. Referenced by mxml_new().

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

| Definition at line 51 of file mxml.h. Referenced by stp_array_create_from_xmltree(), stp_curve_create_from_xmltree(), stp_mxmlFindElement(), stp_xml_get_node(), and stpi_dither_array_create_from_xmltree().

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

| Definition at line 55 of file mxml.h.

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

| Definition at line 46 of file mxml.h. Referenced by stp_curve_create_from_file(), stp_curve_create_from_stream(), stp_curve_create_from_string(), stp_xml_parse_file(), and stpi_dither_array_create_from_file().

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

| Definition at line 53 of file mxml.h.

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

| Definition at line 48 of file mxml.h.

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

| Definition at line 43 of file mxml.h. Referenced by mxml_write_ws().

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

| Definition at line 41 of file mxml.h. Referenced by mxml_write_node().

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

| Definition at line 64 of file mxml.h. Referenced by curve_whitespace_callback(), and mxml_write_node().

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

| Definition at line 60 of file mxml.h. Referenced by curve_whitespace_callback(), and mxml_write_node().

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

| Definition at line 62 of file mxml.h. Referenced by curve_whitespace_callback(), and mxml_write_node().

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

| Definition at line 58 of file mxml.h. Referenced by curve_whitespace_callback(), and mxml_write_node().

## Typedef Documentation

typedef struct stp_mxml_attr_s stp_mxml_attr_t

| Referenced by mxml_write_node(), stp_mxmlElementGetAttr(), and stp_mxmlElementSetAttr().

typedef struct stp_mxml_value_s stp_mxml_element_t

typedef struct stp_mxml_node_s stp_mxml_node_t

| Definition at line 116 of file mxml.h. Referenced by curve_whitespace_callback(), mxml_load_data(), mxml_new(), stp_array_create_from_xmltree(), stp_curve_create_from_file(), stp_curve_create_from_stream(), stp_curve_create_from_string(), stp_curve_create_from_xmltree(), stp_curve_write(), stp_curve_write_string(), stp_mxmlAdd(), stp_mxmlDelete(), stp_mxmlElementGetAttr(), stp_mxmlElementSetAttr(), stp_mxmlFindElement(), stp_mxmlNewElement(), stp_mxmlNewInteger(), stp_mxmlNewOpaque(), stp_mxmlNewReal(), stp_mxmlNewText(), stp_mxmlRemove(), stp_mxmlWalkNext(), stp_mxmlWalkPrev(), stp_printer_create_from_xmltree(), stp_sequence_create_from_xmltree(), stp_xml_get_node(), stp_xml_parse_file(), stp_xml_process_dither_matrix(), stp_xml_process_paper(), stp_xml_process_paperdef(), stp_xmldoc_create_generic(), stp_xmltree_create_from_array(), stp_xmltree_create_from_curve(), stp_xmltree_create_from_sequence(), stpi_dither_array_create_from_file(), stpi_dither_array_create_from_xmltree(), stpi_xml_process_family(), stpi_xml_process_gimpprint(), stpi_xml_process_node(), stpi_xml_process_printdef(), xml_doc_get_curve(), xml_doc_get_dither_array(), and xmldoc_create_from_curve().

typedef struct stp_mxml_text_s stp_mxml_text_t

typedef enum stp_mxml_type_e stp_mxml_type_t

| Referenced by mxml_load_data(), mxml_new(), stp_mxmlLoadFile(), and stp_mxmlLoadString().

typedef union stp_mxml_value_u stp_mxml_value_t

## Enumeration Type Documentation

enum stp_mxml_type_e

  | Enumeration values:
  STP_MXML_ELEMENT |
  STP_MXML_INTEGER |
  STP_MXML_OPAQUE |
  STP_MXML_REAL |
  STP_MXML_TEXT |
Definition at line 79 of file mxml.h.

## Function Documentation

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

| Definition at line 58 of file mxml-node.c. References stp_mxml_node_s::child, stp_mxml_node_s::last_child, stp_mxml_node_s::next, stp_mxml_node_s::parent, stp_mxml_node_s::prev, STP_MXML_ADD_AFTER, STP_MXML_ADD_BEFORE, stp_mxml_node_t, and stp_mxmlRemove(). Referenced by mxml_new(), stp_xmltree_create_from_array(), stp_xmltree_create_from_curve(), and xmldoc_create_from_curve().

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

| Definition at line 168 of file mxml-node.c. References stp_mxml_value_s::attrs, stp_mxml_node_s::child, stp_mxml_value_u::element, stp_mxml_value_s::name, stp_mxml_attr_s::name, stp_mxml_value_s::num_attrs, stp_mxml_value_u::opaque, STP_MXML_ELEMENT, STP_MXML_INTEGER, stp_mxml_node_t, STP_MXML_OPAQUE, STP_MXML_REAL, STP_MXML_TEXT, stp_mxmlRemove(), stp_mxml_text_s::string, stp_mxml_value_u::text, stp_mxml_node_s::type, stp_mxml_node_s::value, and stp_mxml_attr_s::value. Referenced by stp_curve_create_from_file(), stp_curve_create_from_stream(), stp_curve_create_from_string(), stp_curve_write(), stp_curve_write_string(), stp_xml_parse_file(), stp_xmltree_create_from_array(), stp_xmltree_create_from_curve(), stp_xmltree_create_from_sequence(), stpi_dither_array_create_from_file(), and xmldoc_create_from_curve().

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

| Definition at line 40 of file mxml-attr.c. References stp_mxml_value_s::attrs, stp_mxml_value_u::element, stp_mxml_attr_s::name, stp_mxml_value_s::num_attrs, stp_mxml_attr_t, STP_MXML_ELEMENT, stp_mxml_node_t, stp_mxml_node_s::type, stp_mxml_node_s::value, and stp_mxml_attr_s::value. Referenced by curve_whitespace_callback(), stp_array_create_from_xmltree(), stp_curve_create_from_xmltree(), stp_mxmlFindElement(), stp_printer_create_from_xmltree(), stp_sequence_create_from_xmltree(), stp_xml_process_dither_matrix(), stp_xml_process_paper(), stpi_dither_array_create_from_xmltree(), and stpi_xml_process_family().

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

| Definition at line 82 of file mxml-attr.c. References stp_mxml_value_s::attrs, stp_mxml_value_u::element, stp_mxml_attr_s::name, stp_mxml_value_s::name, stp_mxml_value_s::num_attrs, stp_mxml_attr_t, STP_MXML_ELEMENT, stp_mxml_node_t, stp_mxml_node_s::type, stp_mxml_node_s::value, and stp_mxml_attr_s::value. Referenced by mxml_parse_element(), stp_xmldoc_create_generic(), stp_xmltree_create_from_array(), stp_xmltree_create_from_curve(), and stp_xmltree_create_from_sequence().

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
| ) |

| Definition at line 48 of file mxml-search.c. References stp_mxml_value_u::element, stp_mxml_value_s::name, stp_mxml_node_s::next, STP_MXML_DESCEND, STP_MXML_ELEMENT, stp_mxml_node_t, stp_mxmlElementGetAttr(), stp_mxmlWalkNext(), stp_mxml_node_s::type, and stp_mxml_node_s::value. Referenced by stp_array_create_from_xmltree(), stp_curve_create_from_xmltree(), stp_xml_get_node(), and stpi_dither_array_create_from_xmltree().

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

| Definition at line 81 of file mxml-file.c. References mxml_file_getc(), mxml_load_data(), and stp_mxml_type_t. Referenced by stp_curve_create_from_file(), stp_curve_create_from_stream(), stp_xml_parse_file(), and stpi_dither_array_create_from_file().

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

| Definition at line 102 of file mxml-file.c. References mxml_load_data(), mxml_string_getc(), and stp_mxml_type_t. Referenced by stp_curve_create_from_string().

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

| Definition at line 251 of file mxml-node.c. References stp_mxml_value_u::element, mxml_new(), stp_mxml_value_s::name, STP_MXML_ELEMENT, stp_mxml_node_t, and stp_mxml_node_s::value. Referenced by mxml_load_data(), stp_xmldoc_create_generic(), stp_xmltree_create_from_array(), stp_xmltree_create_from_curve(), and stp_xmltree_create_from_sequence().

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

| Definition at line 284 of file mxml-node.c. References stp_mxml_value_u::integer, mxml_new(), STP_MXML_INTEGER, stp_mxml_node_t, and stp_mxml_node_s::value. Referenced by mxml_load_data().

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

| Definition at line 318 of file mxml-node.c. References mxml_new(), stp_mxml_value_u::opaque, stp_mxml_node_t, STP_MXML_OPAQUE, and stp_mxml_node_s::value. Referenced by mxml_load_data().

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

| Definition at line 351 of file mxml-node.c. References mxml_new(), stp_mxml_value_u::real, stp_mxml_node_t, STP_MXML_REAL, and stp_mxml_node_s::value. Referenced by mxml_load_data().

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

| Definition at line 386 of file mxml-node.c. References mxml_new(), stp_mxml_node_t, STP_MXML_TEXT, stp_mxml_text_s::string, stp_mxml_value_u::text, stp_mxml_node_s::value, and stp_mxml_text_s::whitespace. Referenced by mxml_load_data(), and stp_xmltree_create_from_sequence().

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

| Definition at line 422 of file mxml-node.c. References stp_mxml_node_s::child, stp_mxml_node_s::last_child, stp_mxml_node_s::next, stp_mxml_node_s::parent, stp_mxml_node_s::prev, and stp_mxml_node_t. Referenced by stp_mxmlAdd(), and stp_mxmlDelete().

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

| Definition at line 122 of file mxml-file.c. References stp_mxmlSaveString(). Referenced by stp_curve_write_string().

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

| Definition at line 179 of file mxml-file.c. References mxml_file_putc(), and mxml_write_node(). Referenced by stp_curve_write().

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

| Definition at line 215 of file mxml-file.c. References mxml_string_putc(), and mxml_write_node(). Referenced by stp_mxmlSaveAllocString().

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

| Definition at line 130 of file mxml-search.c. References stp_mxml_node_s::child, stp_mxml_node_s::next, stp_mxml_node_s::parent, and stp_mxml_node_t. Referenced by stp_mxmlFindElement().

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

| Definition at line 166 of file mxml-search.c. References stp_mxml_node_s::last_child, stp_mxml_node_s::parent, stp_mxml_node_s::prev, and stp_mxml_node_t.