/home/dko/projects/mobilec/trunk/src/mxml-2.2.2/mxmldoc.c File Reference

#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_tadd_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 Documentation

#define STATE_C_COMMENT   2

Definition at line 122 of file mxmldoc.c.

Referenced by scan_file().

#define STATE_CHARACTER   5

Definition at line 125 of file mxmldoc.c.

Referenced by scan_file().

#define STATE_CXX_COMMENT   3

Definition at line 123 of file mxmldoc.c.

Referenced by scan_file().

#define STATE_IDENTIFIER   6

Definition at line 126 of file mxmldoc.c.

Referenced by scan_file().

#define STATE_NONE   0

Definition at line 120 of file mxmldoc.c.

Referenced by scan_file().

#define STATE_PREPROCESSOR   1

Definition at line 121 of file mxmldoc.c.

Referenced by scan_file().

#define STATE_STRING   4

Definition at line 124 of file mxmldoc.c.

Referenced by scan_file().


Function Documentation

static mxml_node_t * add_variable ( mxml_node_t parent,
const char *  name,
mxml_node_t type 
) [static]

Definition at line 306 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().

int main ( int  argc,
char *  argv[] 
)

Definition at line 152 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 420 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 435 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 1610 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 1698 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 1798 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 2608 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 2653 of file mxmldoc.c.

Referenced by write_element().

static const char * ws_cb ( mxml_node_t node,
int  where 
) [static]

Definition at line 2711 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().


Generated on Fri May 16 14:49:56 2008 for Mobile-C by  doxygen 1.5.4