ROOTANA
|
Go to the source code of this file.
Data Structures | |
struct | MXML_WRITER |
struct | mxml_struct |
Macros | |
#define | MXML_NAME_LENGTH 64 |
#define | ELEMENT_NODE 1 |
#define | TEXT_NODE 2 |
#define | PROCESSING_INSTRUCTION_NODE 3 |
#define | COMMENT_NODE 4 |
#define | DOCUMENT_NODE 5 |
#define | INTERNAL_ENTITY 0 |
#define | EXTERNAL_ENTITY 1 |
#define | MXML_MAX_ENTITY 50 |
#define | MXML_MAX_CONDITION 10 |
#define | DIR_SEPARATOR '/' |
#define | EXPRT |
Typedefs | |
typedef struct mxml_struct * | PMXML_NODE |
typedef struct mxml_struct | MXML_NODE |
Functions | |
void | mxml_suppress_date (int suppress) |
MXML_WRITER * | mxml_open_file (const char *file_name) |
MXML_WRITER * | mxml_open_buffer (void) |
int | mxml_set_translate (MXML_WRITER *writer, int flag) |
int | mxml_start_element (MXML_WRITER *writer, const char *name) |
int | mxml_start_element_noindent (MXML_WRITER *writer, const char *name) |
int | mxml_end_element (MXML_WRITER *writer) |
int | mxml_write_comment (MXML_WRITER *writer, const char *string) |
int | mxml_write_element (MXML_WRITER *writer, const char *name, const char *value) |
int | mxml_write_attribute (MXML_WRITER *writer, const char *name, const char *value) |
int | mxml_write_value (MXML_WRITER *writer, const char *value) |
int | mxml_write_empty_line (MXML_WRITER *writer) |
char * | mxml_close_buffer (MXML_WRITER *writer) |
int | mxml_close_file (MXML_WRITER *writer) |
int | mxml_get_number_of_children (PMXML_NODE pnode) |
PMXML_NODE | mxml_get_parent (PMXML_NODE pnode) |
PMXML_NODE | mxml_subnode (PMXML_NODE pnode, int idx) |
PMXML_NODE | mxml_find_node (PMXML_NODE tree, const char *xml_path) |
int | mxml_find_nodes (PMXML_NODE tree, const char *xml_path, PMXML_NODE **nodelist) |
char * | mxml_get_name (PMXML_NODE pnode) |
char * | mxml_get_value (PMXML_NODE pnode) |
int | mxml_get_line_number_start (PMXML_NODE pnode) |
int | mxml_get_line_number_end (PMXML_NODE pnode) |
PMXML_NODE | mxml_get_node_at_line (PMXML_NODE tree, int linenumber) |
char * | mxml_get_attribute (PMXML_NODE pnode, const char *name) |
int | mxml_add_attribute (PMXML_NODE pnode, const char *attrib_name, const char *attrib_value) |
PMXML_NODE | mxml_add_special_node (PMXML_NODE parent, int node_type, const char *node_name, const char *value) |
PMXML_NODE | mxml_add_special_node_at (PMXML_NODE parent, int node_type, const char *node_name, const char *value, int idx) |
PMXML_NODE | mxml_add_node (PMXML_NODE parent, const char *node_name, const char *value) |
PMXML_NODE | mxml_add_node_at (PMXML_NODE parent, const char *node_name, const char *value, int idx) |
PMXML_NODE | mxml_clone_tree (PMXML_NODE tree) |
int | mxml_add_tree (PMXML_NODE parent, PMXML_NODE tree) |
int | mxml_add_tree_at (PMXML_NODE parent, PMXML_NODE tree, int idx) |
int | mxml_replace_node_name (PMXML_NODE pnode, const char *new_name) |
int | mxml_replace_node_value (PMXML_NODE pnode, const char *value) |
int | mxml_replace_subvalue (PMXML_NODE pnode, const char *name, const char *value) |
int | mxml_replace_attribute_name (PMXML_NODE pnode, const char *old_name, const char *new_name) |
int | mxml_replace_attribute_value (PMXML_NODE pnode, const char *attrib_name, const char *attrib_value) |
int | mxml_delete_node (PMXML_NODE pnode) |
int | mxml_delete_attribute (PMXML_NODE, const char *attrib_name) |
PMXML_NODE | mxml_create_root_node (void) |
PMXML_NODE | mxml_parse_file (const char *file_name, char *error, int error_size, int *error_line) |
PMXML_NODE | mxml_parse_buffer (const char *buffer, char *error, int error_size, int *error_line) |
int | mxml_parse_entity (char **buf, const char *file_name, char *error, int error_size, int *error_line) |
int | mxml_print_tree (char *buffer, int *buffer_size, PMXML_NODE tree) |
void | mxml_debug_tree (PMXML_NODE tree, int level) |
void | mxml_free_tree (PMXML_NODE tree) |
int | mxml_write_tree (const char *file_name, PMXML_NODE tree) |
void | mxml_dirname (char *path) |
void | mxml_basename (char *path) |
typedef struct mxml_struct MXML_NODE |
typedef struct mxml_struct* PMXML_NODE |
int mxml_add_attribute | ( | PMXML_NODE | pnode, |
const char * | attrib_name, | ||
const char * | attrib_value | ||
) |
PMXML_NODE mxml_add_node | ( | PMXML_NODE | parent, |
const char * | node_name, | ||
const char * | value | ||
) |
PMXML_NODE mxml_add_node_at | ( | PMXML_NODE | parent, |
const char * | node_name, | ||
const char * | value, | ||
int | idx | ||
) |
PMXML_NODE mxml_add_special_node | ( | PMXML_NODE | parent, |
int | node_type, | ||
const char * | node_name, | ||
const char * | value | ||
) |
PMXML_NODE mxml_add_special_node_at | ( | PMXML_NODE | parent, |
int | node_type, | ||
const char * | node_name, | ||
const char * | value, | ||
int | idx | ||
) |
int mxml_add_tree | ( | PMXML_NODE | parent, |
PMXML_NODE | tree | ||
) |
int mxml_add_tree_at | ( | PMXML_NODE | parent, |
PMXML_NODE | tree, | ||
int | idx | ||
) |
void mxml_basename | ( | char * | path | ) |
mxml_basename deletes any prefix ending with the last slash '/' character present in path. mxml_dirname deletes the filename portion, beginning with the last slash '/' character to the end of path. Followings are examples from these functions
path dirname basename "/" "/" "" "." "." "." "" "" "" "/test.txt" "/" "test.txt" "path/to/test.txt" "path/to" "test.txt" "test.txt "." "test.txt"
Under Windows, '\' and ':' are recognized ad separator too.
PMXML_NODE mxml_clone_tree | ( | PMXML_NODE | tree | ) |
char * mxml_close_buffer | ( | MXML_WRITER * | writer | ) |
int mxml_close_file | ( | MXML_WRITER * | writer | ) |
PMXML_NODE mxml_create_root_node | ( | void | ) |
void mxml_debug_tree | ( | PMXML_NODE | tree, |
int | level | ||
) |
int mxml_delete_attribute | ( | PMXML_NODE | pnode, |
const char * | attrib_name | ||
) |
int mxml_delete_node | ( | PMXML_NODE | pnode | ) |
int mxml_end_element | ( | MXML_WRITER * | writer | ) |
PMXML_NODE mxml_find_node | ( | PMXML_NODE | tree, |
const char * | xml_path | ||
) |
Search for a specific XML node with a subset of XPATH specifications. Return first found node. For syntax see mxml_find_nodes()
Definition at line 1078 of file mxml.cxx.
int mxml_find_nodes | ( | PMXML_NODE | tree, |
const char * | xml_path, | ||
PMXML_NODE ** | nodelist | ||
) |
void mxml_free_tree | ( | PMXML_NODE | tree | ) |
free memory of XML tree, must be called after any mxml_create_root_node() or mxml_parse_file()
Definition at line 2305 of file mxml.cxx.
char * mxml_get_attribute | ( | PMXML_NODE | pnode, |
const char * | name | ||
) |
int mxml_get_line_number_end | ( | PMXML_NODE | pnode | ) |
int mxml_get_line_number_start | ( | PMXML_NODE | pnode | ) |
char * mxml_get_name | ( | PMXML_NODE | pnode | ) |
PMXML_NODE mxml_get_node_at_line | ( | PMXML_NODE | tree, |
int | line_number | ||
) |
int mxml_get_number_of_children | ( | PMXML_NODE | pnode | ) |
PMXML_NODE mxml_get_parent | ( | PMXML_NODE | pnode | ) |
char * mxml_get_value | ( | PMXML_NODE | pnode | ) |
MXML_WRITER * mxml_open_buffer | ( | void | ) |
MXML_WRITER * mxml_open_file | ( | const char * | file_name | ) |
PMXML_NODE mxml_parse_buffer | ( | const char * | buf, |
char * | error, | ||
int | error_size, | ||
int * | error_line | ||
) |
Parse a XML buffer and convert it into a tree of MXML_NODE's. Return NULL in case of an error, return error description. Optional file_name is used for error reporting if called from mxml_parse_file()
Definition at line 1355 of file mxml.cxx.
int mxml_parse_entity | ( | char ** | buf, |
const char * | file_name, | ||
char * | error, | ||
int | error_size, | ||
int * | error_line | ||
) |
parse !ENTYTY entries of XML files and replace with references. Return 0 in case of no errors, return error description. Optional file_name is used for error reporting if called from mxml_parse_file()
Definition at line 1673 of file mxml.cxx.
PMXML_NODE mxml_parse_file | ( | const char * | file_name, |
char * | error, | ||
int | error_size, | ||
int * | error_line | ||
) |
int mxml_print_tree | ( | char * | buffer, |
int * | buffer_size, | ||
PMXML_NODE | tree | ||
) |
int mxml_replace_attribute_name | ( | PMXML_NODE | pnode, |
const char * | old_name, | ||
const char * | new_name | ||
) |
int mxml_replace_attribute_value | ( | PMXML_NODE | pnode, |
const char * | attrib_name, | ||
const char * | attrib_value | ||
) |
int mxml_replace_node_name | ( | PMXML_NODE | pnode, |
const char * | new_name | ||
) |
int mxml_replace_node_value | ( | PMXML_NODE | pnode, |
const char * | value | ||
) |
int mxml_replace_subvalue | ( | PMXML_NODE | pnode, |
const char * | name, | ||
const char * | value | ||
) |
int mxml_set_translate | ( | MXML_WRITER * | writer, |
int | flag | ||
) |
int mxml_start_element | ( | MXML_WRITER * | writer, |
const char * | name | ||
) |
int mxml_start_element_noindent | ( | MXML_WRITER * | writer, |
const char * | name | ||
) |
PMXML_NODE mxml_subnode | ( | PMXML_NODE | pnode, |
int | idx | ||
) |
void mxml_suppress_date | ( | int | suppress | ) |
int mxml_write_attribute | ( | MXML_WRITER * | writer, |
const char * | name, | ||
const char * | value | ||
) |
int mxml_write_comment | ( | MXML_WRITER * | writer, |
const char * | string | ||
) |
int mxml_write_element | ( | MXML_WRITER * | writer, |
const char * | name, | ||
const char * | value | ||
) |
int mxml_write_empty_line | ( | MXML_WRITER * | writer | ) |
int mxml_write_tree | ( | const char * | file_name, |
PMXML_NODE | tree | ||
) |
int mxml_write_value | ( | MXML_WRITER * | writer, |
const char * | data | ||
) |