20unsigned int _nb_node = 0;
21unsigned int _nb_attr = 0;
22unsigned int _nb_text = 0;
32 while (root->
prnt != NULL)
92 unsigned char id = *(
unsigned char *)n->
priv;
94 if (
id == ROXML_REQTABLE_ID) {
98 roxml_lock_destroy(n);
107 }
else if (
id == ROXML_NS_ID) {
131 char separators[32] =
"\r\t\n ";
133 while (separators[i] != 0)
134 if (sep == separators[i++])
148 if (context->
nsdef) {
160 ns->
id = ROXML_NS_ID;
183#ifdef IGNORE_EMPTY_TEXT_NODES
191#ifdef IGNORE_EMPTY_TEXT_NODES
204 node_t *root = current_node;
260 table->
id = ROXML_REQTABLE_ID;
261 table->
ids[ROXML_REQTABLE_ID] = 1;
263 n->
priv = (
void *)table;
283 for (len = 0; ns[len] !=
'\0' && ns[len] !=
':' && len <
MAX_NAME_LEN; len++)
284 namespace[len] = ns[len];
289 namespace[len] =
'\0';
321 && parent->
ns->priv && ((
roxml_ns_t *)parent->
ns->priv)->alias[0] ==
'\0')
344 parent->
next->sibl = n;
358 roxml_append_attr(parent, n);
360 roxml_append_other(parent, n);
368 fprintf(stderr,
"calling func %s chunk %c\n", __func__, chunk[0]);
385 fprintf(stderr,
"calling func %s chunk %c\n", __func__, chunk[0]);
402 fprintf(stderr,
"calling func %s chunk %c\n", __func__, chunk[0]);
407 switch (context->
state) {
414 ROXML_PARSE_ERROR(
"unexpected '<' within node definition");
429 fprintf(stderr,
"calling func %s chunk %c\n", __func__, chunk[0]);
434 switch (context->
state) {
442 node_t *to_be_closed = NULL;
504#ifdef IGNORE_EMPTY_TEXT_NODES
505 while (chunk[cur] !=
'\0') {
506 if (chunk[cur] ==
'<') {
515 while ((chunk[cur] !=
'<') && (chunk[cur] !=
'\0'))
522ROXML_INT
int _func_load_open_spec_node(
roxml_parser_item_t *parser,
char *chunk,
void *data)
525 fprintf(stderr,
"calling func %s chunk %c\n", __func__, chunk[0]);
532 if (strncmp(chunk,
"!--", 3) == 0) {
537 while ((chunk[cur] !=
'-') && (chunk[cur] !=
'\0'))
539 }
else if (strncmp(chunk,
"![CDATA[", 8) == 0) {
543 while ((chunk[cur] !=
'[') && (chunk[cur] !=
'\0'))
560ROXML_INT
int _func_load_close_comment(
roxml_parser_item_t *parser,
char *chunk,
void *data)
563 fprintf(stderr,
"calling func %s chunk %c\n", __func__, chunk[0]);
569 if (chunk[1] ==
'-') {
583 fprintf(stderr,
"calling func %s chunk %c\n", __func__, chunk[0]);
589 if (chunk[1] ==
']') {
604 fprintf(stderr,
"calling func %s chunk %c\n", __func__, chunk[0]);
632 fprintf(stderr,
"calling func %s chunk %c\n", __func__, chunk[0]);
637 switch (context->
state) {
642 if (context->
lvl < 0)
643 ROXML_PARSE_ERROR(
"missing opening node");
652 node_t *to_be_closed = NULL;
679 fprintf(stderr,
"calling func %s chunk %c\n", __func__, chunk[0]);
684 switch (context->
state) {
695 node_t *to_be_closed = NULL;
722 fprintf(stderr,
"calling func %s chunk %c\n", __func__, chunk[0]);
761 fprintf(stderr,
"calling func %s chunk %c\n", __func__, chunk[0]);
764 switch (context->
state) {
769 if (context->
ns == 0) {
776 while (!
ROXML_WHITE(chunk[cur]) && (chunk[cur] !=
'>') && (chunk[cur] !=
'/') && (chunk[cur] !=
':')
777 && (chunk[cur] !=
'\0')) {
784 if (context->
nsdef) {
792 }
else if (context->
ns == 0) {
801 while ((chunk[cur] !=
'=') && (chunk[cur] !=
'>') && (chunk[cur] !=
':')
802 && (chunk[cur] !=
'\0')) {
806 if (context->
nsdef) {
808 ns->
id = ROXML_NS_ID;
#define ROXML_INVALID_DOC
#define ROXML_DOCTYPE_NODE
ROXML_INT void roxml_close_buff(node_t *n)
unload function
ROXML_INT int roxml_parse_buff(roxml_load_ctx_t *context, roxml_parser_item_t *parser, char *buffer)
generic load function
buffer XML document backend
ROXML_INT int roxml_is_separator(char sep)
separator tester
ROXML_STATIC ROXML_INT void roxml_process_begin_node(roxml_load_ctx_t *context, int position)
node creation during parsing
ROXML_INT node_t * roxml_create_node(int pos, void *src, int type)
internal function
ROXML_STATIC ROXML_INT void roxml_close_node(node_t *n, node_t *close)
internal function
ROXML_INT node_t * roxml_append_node(node_t *parent, node_t *n)
node append function
ROXML_INT node_t * roxml_create_root(node_t *n)
internal function
ROXML_STATIC ROXML_INT void roxml_set_type(node_t *n, int type)
node type setter function
ROXML_INT node_t * roxml_set_parent(node_t *parent, node_t *n)
node parenting function
ROXML_INT void roxml_del_tree(node_t *n)
internal function
ROXML_STATIC ROXML_INT node_t * roxml_lookup_nsdef(node_t *nsdef, char *ns)
name space lookup in list
ROXML_INT node_t * roxml_load(node_t *current_node, FILE *file, char *buffer)
generic load function
ROXML_INT void roxml_free_node(node_t *n)
internal function
ROXML_STATIC ROXML_INT void roxml_process_unaliased_ns(roxml_load_ctx_t *context)
namespace without alias name creation during parsing
ROXML_API void roxml_close(node_t *n)
unload function
#define STATE_NODE_SINGLE
#define STATE_NODE_COMMENT
#define MODE_COMMENT_DQUOTE
#define MODE_COMMENT_QUOTE
#define STATE_NODE_CONTENT
#define STATE_INSIDE_VAL_BEG
#define MODE_COMMENT_NONE
#define STATE_INSIDE_ARG_BEG
ROXML_INT int roxml_parse_file(roxml_load_ctx_t *context, roxml_parser_item_t *parser, FILE *file)
generic load function
ROXML_INT void roxml_close_file(node_t *root)
unload function
File XML document backend.
ROXML_INT roxml_parser_item_t * roxml_parser_prepare(roxml_parser_item_t *parser)
parser preparation function
ROXML_INT roxml_parser_item_t * roxml_append_parser_item(roxml_parser_item_t *parser, char *key, roxml_parse_func func)
parser item creation function
ROXML_INT void roxml_parser_free(roxml_parser_item_t *parser)
parser table deletion
char curr_name[MAX_NAME_LEN+1]