#include "config.h"
#include "mxml.h"
Go to the source code of this file.
Defines | |
#define | STATE_NONE 0 |
#define | STATE_PREPROCESSOR 1 |
#define | STATE_C_COMMENT 2 |
#define | STATE_CXX_COMMENT 3 |
#define | STATE_STRING 4 |
#define | STATE_CHARACTER 5 |
#define | STATE_IDENTIFIER 6 |
Functions | |
static mxml_node_t * | add_variable (mxml_node_t *parent, const char *name, mxml_node_t *type) |
static void | safe_strcpy (char *dst, const char *src) |
static int | scan_file (const char *filename, FILE *fp, mxml_node_t *doc) |
static void | sort_node (mxml_node_t *tree, mxml_node_t *func) |
static void | update_comment (mxml_node_t *parent, mxml_node_t *comment) |
static void | write_documentation (mxml_node_t *doc) |
static void | write_element (mxml_node_t *doc, mxml_node_t *element) |
static void | write_string (const char *s) |
static const char * | ws_cb (mxml_node_t *node, int where) |
int | main (int argc, char *argv[]) |
#define STATE_C_COMMENT 2 |
Definition at line 129 of file mxmldoc.c.
Referenced by scan_file().
#define STATE_CHARACTER 5 |
Definition at line 132 of file mxmldoc.c.
Referenced by scan_file().
#define STATE_CXX_COMMENT 3 |
Definition at line 130 of file mxmldoc.c.
Referenced by scan_file().
#define STATE_IDENTIFIER 6 |
Definition at line 133 of file mxmldoc.c.
Referenced by scan_file().
#define STATE_NONE 0 |
Definition at line 127 of file mxmldoc.c.
Referenced by scan_file().
#define STATE_PREPROCESSOR 1 |
Definition at line 128 of file mxmldoc.c.
Referenced by scan_file().
#define STATE_STRING 4 |
Definition at line 131 of file mxmldoc.c.
Referenced by scan_file().
static mxml_node_t * add_variable | ( | mxml_node_t * | parent, | |
const char * | name, | |||
mxml_node_t * | type | |||
) | [static] |
Definition at line 313 of file mxmldoc.c.
References mxml_node_s::child, mxml_node_s::last_child, MXML_ADD_AFTER, MXML_ADD_TO_PARENT, mxmlAdd(), mxmlDelete(), mxmlElementSetAttr(), mxmlNewElement(), mxml_node_s::next, node, mxml_text_s::string, mxml_value_u::text, mxml_node_s::value, and mxml_text_s::whitespace.
Referenced by scan_file().
Definition at line 159 of file mxmldoc.c.
References MXML_DESCEND, MXML_NO_CALLBACK, mxmlDelete(), mxmlElementSetAttr(), mxmlFindElement(), mxmlLoadFile(), mxmlNewElement(), mxmlSaveFile(), scan_file(), write_documentation(), and ws_cb().
static void safe_strcpy | ( | char * | dst, | |
const char * | src | |||
) | [static] |
Definition at line 427 of file mxmldoc.c.
Referenced by update_comment().
static int scan_file | ( | const char * | filename, | |
FILE * | fp, | |||
mxml_node_t * | doc | |||
) | [static] |
Definition at line 442 of file mxmldoc.c.
References add_variable(), mxml_node_s::child, mxml_value_u::element, mxml_node_s::last_child, MXML_ADD_AFTER, MXML_ADD_BEFORE, MXML_ADD_TO_PARENT, MXML_DESCEND_FIRST, MXML_NO_PARENT, mxmlAdd(), mxmlDelete(), mxmlElementGetAttr(), mxmlElementSetAttr(), mxmlFindElement(), mxmlNewElement(), mxmlNewText(), mxml_value_s::name, mxml_node_s::next, node, sort_node(), STATE_C_COMMENT, STATE_CHARACTER, STATE_CXX_COMMENT, STATE_IDENTIFIER, STATE_NONE, STATE_PREPROCESSOR, STATE_STRING, mxml_text_s::string, mxml_value_u::text, update_comment(), mxml_node_s::value, and mxml_text_s::whitespace.
Referenced by main().
static void sort_node | ( | mxml_node_t * | tree, | |
mxml_node_t * | func | |||
) | [static] |
Definition at line 1617 of file mxmldoc.c.
References mxml_node_s::child, mxml_value_u::element, MXML_ADD_AFTER, MXML_ADD_BEFORE, MXML_ADD_TO_PARENT, MXML_DESCEND_FIRST, mxmlAdd(), mxmlDelete(), mxmlElementGetAttr(), mxmlElementSetAttr(), mxmlFindElement(), mxml_value_s::name, mxml_node_s::next, mxml_node_s::parent, and mxml_node_s::value.
Referenced by scan_file().
static void update_comment | ( | mxml_node_t * | parent, | |
mxml_node_t * | comment | |||
) | [static] |
Definition at line 1705 of file mxmldoc.c.
References mxml_value_u::element, mxmlElementSetAttr(), mxml_value_s::name, safe_strcpy(), mxml_text_s::string, mxml_value_u::text, and mxml_node_s::value.
Referenced by scan_file().
static void write_documentation | ( | mxml_node_t * | doc | ) | [static] |
Definition at line 1805 of file mxmldoc.c.
References mxml_node_s::child, MXML_DESCEND_FIRST, MXML_NO_DESCEND, MXML_VERSION, mxmlElementGetAttr(), mxmlFindElement(), and write_element().
Referenced by main().
static void write_element | ( | mxml_node_t * | doc, | |
mxml_node_t * | element | |||
) | [static] |
Definition at line 2615 of file mxmldoc.c.
References mxml_node_s::child, MXML_DESCEND, MXML_NO_DESCEND, MXML_TEXT, mxmlFindElement(), mxmlWalkNext(), node, mxml_text_s::string, mxml_value_u::text, mxml_node_s::type, mxml_node_s::value, mxml_text_s::whitespace, and write_string().
Referenced by write_documentation().
static void write_string | ( | const char * | s | ) | [static] |
Definition at line 2660 of file mxmldoc.c.
Referenced by write_element().
static const char * ws_cb | ( | mxml_node_t * | node, | |
int | where | |||
) | [static] |
Definition at line 2718 of file mxmldoc.c.
References mxml_value_u::element, MXML_WS_AFTER_CLOSE, MXML_WS_AFTER_OPEN, MXML_WS_BEFORE_CLOSE, MXML_WS_BEFORE_OPEN, mxml_value_s::name, mxml_node_s::parent, and mxml_node_s::value.
Referenced by main().