27 #include "roxml-parse-engine.h"
30 unsigned int _nb_node = 0;
31 unsigned int _nb_attr = 0;
32 unsigned int _nb_text = 0;
41 while (cell->
next != NULL) {
48 cell->
next->next = NULL;
49 cell->
next->prev = cell;
52 cell->
id = pthread_self();
54 cell->
ptr = calloc(num, size);
55 head_cell.
prev = cell;
63 if (size > 0 && buffer) {
65 if (fseek(node->
src.fil, pos, SEEK_SET) == 0) {
66 ret_len = fread(buffer, 1, size, node->
src.fil);
70 char const *r2 = node->
src.buf + pos;
72 while (size-- && (*r1++ = *r2++)) ;
73 ret_len = r1 - buffer;
120 unsigned char id = *(
unsigned char *)n->
priv;
122 if (
id == ROXML_REQTABLE_ID) {
126 pthread_mutex_destroy(&table->
mut);
133 }
else if (
id == ROXML_NS_ID) {
164 if ((end == NULL) || (
roxml_is_separator(end[0])) || (end[0] ==
'"') || (end[0] ==
'\'') || (end[0] ==
'\0')) {
174 char separators[32] =
"\r\t\n ";
175 while (separators[i] != 0) {
176 if (sep == separators[i]) {
186 if (context->
nsdef) {
195 ns->
id = ROXML_NS_ID;
210 #ifdef IGNORE_EMPTY_TEXT_NODES
218 #ifdef IGNORE_EMPTY_TEXT_NODES
239 parser = roxml_append_parser_item(parser,
" ", _func_load_white);
240 parser = roxml_append_parser_item(parser,
"<", _func_load_open_node);
241 parser = roxml_append_parser_item(parser,
">", _func_load_close_node);
242 parser = roxml_append_parser_item(parser,
"/", _func_load_end_node);
243 parser = roxml_append_parser_item(parser,
"'", _func_load_quoted);
244 parser = roxml_append_parser_item(parser,
"\"", _func_load_dquoted);
245 parser = roxml_append_parser_item(parser,
"\t", _func_load_white);
246 parser = roxml_append_parser_item(parser,
"\n", _func_load_white);
247 parser = roxml_append_parser_item(parser,
"\r", _func_load_white);
248 parser = roxml_append_parser_item(parser,
"!", _func_load_open_spec_node);
249 parser = roxml_append_parser_item(parser,
"]", _func_load_close_cdata);
250 parser = roxml_append_parser_item(parser,
"-", _func_load_close_comment);
251 parser = roxml_append_parser_item(parser,
"?", _func_load_close_pi);
252 parser = roxml_append_parser_item(parser,
":", _func_load_colon);
253 parser = roxml_append_parser_item(parser, NULL, _func_load_default);
255 parser = roxml_parser_prepare(parser);
263 context.
src = (
void *)file;
271 int_len = fread(int_buffer + circle, 1,
ROXML_BULK_READ - circle, file) + circle;
272 int_buffer[int_len] =
'\0';
280 ret = roxml_parse_line(parser, int_buffer, chunk_len, &context);
281 circle = int_len - ret;
282 if ((ret < 0) || (circle < 0)) {
286 memmove(int_buffer, int_buffer + ret, circle);
293 context.
src = (
void *)buffer;
294 ret = roxml_parse_line(parser, buffer, 0, &context);
300 roxml_parser_free(parser);
309 virtroot = current_node;
310 while (virtroot->
prnt) {
311 virtroot = virtroot->
prnt;
314 table->
id = ROXML_REQTABLE_ID;
315 table->
ids[ROXML_REQTABLE_ID] = 1;
316 pthread_mutex_init(&table->
mut, NULL);
317 virtroot->
priv = (
void *)table;
332 for (len = 0; ns[len] !=
'\0' && ns[len] !=
':'; len++) {
333 namespace[len] = ns[len];
335 namespace[len] =
'\0';
359 struct _xpath_axes xpath_axes[14] = {
360 {ROXML_ID_PARENT, ROXML_L_PARENT},
361 {ROXML_ID_PARENT, ROXML_S_PARENT},
362 {ROXML_ID_SELF, ROXML_L_SELF},
363 {ROXML_ID_SELF, ROXML_S_SELF},
364 {ROXML_ID_ATTR, ROXML_L_ATTR},
365 {ROXML_ID_ATTR, ROXML_S_ATTR},
366 {ROXML_ID_ANC, ROXML_L_ANC},
367 {ROXML_ID_ANC_O_SELF, ROXML_L_ANC_O_SELF},
368 {ROXML_ID_NEXT_SIBL, ROXML_L_NEXT_SIBL},
369 {ROXML_ID_PREV_SIBL, ROXML_L_PREV_SIBL},
370 {ROXML_ID_NEXT, ROXML_L_NEXT},
371 {ROXML_ID_PREV, ROXML_L_PREV},
372 {ROXML_ID_NS, ROXML_L_NS},
373 {ROXML_ID_CHILD, ROXML_L_CHILD},
377 if (axes[0] ==
'/') {
382 if (axes[0] ==
'/') {
384 node->
axes = ROXML_ID_DESC_O_SELF;
385 node->
name = axes + 1;
387 tmp_node->
axes = ROXML_ID_CHILD;
388 node->
next = tmp_node;
389 if (strlen(node->
name) > 0) {
391 node->
next->next = tmp_node;
394 }
else if (strncmp(ROXML_L_DESC_O_SELF, axes, strlen(ROXML_L_DESC_O_SELF)) == 0) {
396 node->
axes = ROXML_ID_DESC_O_SELF;
397 node->
name = axes + strlen(ROXML_L_DESC_O_SELF);
398 *offset += strlen(ROXML_L_DESC_O_SELF);
400 tmp_node->
axes = ROXML_ID_CHILD;
401 node->
next = tmp_node;
402 node =
roxml_set_axes(tmp_node, axes + strlen(ROXML_L_DESC_O_SELF), offset);
403 }
else if (strncmp(ROXML_L_DESC, axes, strlen(ROXML_L_DESC)) == 0) {
405 node->
axes = ROXML_ID_DESC;
406 node->
name = axes + strlen(ROXML_L_DESC);
407 *offset += strlen(ROXML_L_DESC);
409 tmp_node->
axes = ROXML_ID_CHILD;
410 node->
next = tmp_node;
411 node =
roxml_set_axes(tmp_node, axes + strlen(ROXML_L_DESC), offset);
416 node->
axes = ROXML_ID_CHILD;
419 for (i = 0; i < 14; i++) {
420 int len = strlen(xpath_axes[i].name);
421 if (strncmp(xpath_axes[i].name, axes, len) == 0) {
422 node->
axes = xpath_axes[i].id;
423 node->
name = axes + len;
446 while ((first) && (first != n)) {
454 #if(CONFIG_XML_XPATH_ENGINE==1)
476 parser = roxml_append_parser_item(parser,
" ", _func_xpath_ignore);
477 parser = roxml_append_parser_item(parser,
"\t", _func_xpath_ignore);
478 parser = roxml_append_parser_item(parser,
"\n", _func_xpath_ignore);
479 parser = roxml_append_parser_item(parser,
"\r", _func_xpath_ignore);
480 parser = roxml_append_parser_item(parser,
"\"", _func_xpath_dquote);
481 parser = roxml_append_parser_item(parser,
"\'", _func_xpath_quote);
482 parser = roxml_append_parser_item(parser,
"/", _func_xpath_new_node);
483 parser = roxml_append_parser_item(parser,
"(", _func_xpath_open_parenthesys);
484 parser = roxml_append_parser_item(parser,
")", _func_xpath_close_parenthesys);
485 parser = roxml_append_parser_item(parser,
"[", _func_xpath_open_brackets);
486 parser = roxml_append_parser_item(parser,
"]", _func_xpath_close_brackets);
487 parser = roxml_append_parser_item(parser,
"=", _func_xpath_operator_equal);
488 parser = roxml_append_parser_item(parser,
">", _func_xpath_operator_sup);
489 parser = roxml_append_parser_item(parser,
"<", _func_xpath_operator_inf);
490 parser = roxml_append_parser_item(parser,
"!", _func_xpath_operator_diff);
491 parser = roxml_append_parser_item(parser,
"0", _func_xpath_number);
492 parser = roxml_append_parser_item(parser,
"1", _func_xpath_number);
493 parser = roxml_append_parser_item(parser,
"2", _func_xpath_number);
494 parser = roxml_append_parser_item(parser,
"3", _func_xpath_number);
495 parser = roxml_append_parser_item(parser,
"4", _func_xpath_number);
496 parser = roxml_append_parser_item(parser,
"5", _func_xpath_number);
497 parser = roxml_append_parser_item(parser,
"6", _func_xpath_number);
498 parser = roxml_append_parser_item(parser,
"7", _func_xpath_number);
499 parser = roxml_append_parser_item(parser,
"8", _func_xpath_number);
500 parser = roxml_append_parser_item(parser,
"9", _func_xpath_number);
501 parser = roxml_append_parser_item(parser,
"+", _func_xpath_operator_add);
502 parser = roxml_append_parser_item(parser,
"-", _func_xpath_operator_subs);
503 parser = roxml_append_parser_item(parser, ROXML_PATH_OR, _func_xpath_path_or);
504 parser = roxml_append_parser_item(parser, ROXML_COND_OR, _func_xpath_condition_or);
505 parser = roxml_append_parser_item(parser, ROXML_COND_AND, _func_xpath_condition_and);
506 parser = roxml_append_parser_item(parser, ROXML_FUNC_POS_STR, _func_xpath_position);
507 parser = roxml_append_parser_item(parser, ROXML_FUNC_FIRST_STR, _func_xpath_first);
508 parser = roxml_append_parser_item(parser, ROXML_FUNC_LAST_STR, _func_xpath_last);
509 parser = roxml_append_parser_item(parser, ROXML_FUNC_NSURI_STR, _func_xpath_nsuri);
510 parser = roxml_append_parser_item(parser, NULL, _func_xpath_default);
512 parser = roxml_parser_prepare(parser);
513 ret = roxml_parse_line(parser, path, 0, &ctx);
514 roxml_parser_free(parser);
541 for (i = 0; i < nb; i++) {
548 free(xpath[i].xp_cond);
555 if (op == ROXML_OPERATOR_ADD) {
557 }
else if (op == ROXML_OPERATOR_SUB) {
559 }
else if (op == ROXML_OPERATOR_MUL) {
561 }
else if (op == ROXML_OPERATOR_DIV) {
569 if (op == ROXML_OPERATOR_DIFF) {
571 }
else if (op == ROXML_OPERATOR_EINF) {
573 }
else if (op == ROXML_OPERATOR_INF) {
575 }
else if (op == ROXML_OPERATOR_ESUP) {
577 }
else if (op == ROXML_OPERATOR_SUP) {
579 }
else if (op == ROXML_OPERATOR_EQU) {
589 result = strcmp(sa, sb);
591 if (op == ROXML_OPERATOR_DIFF) {
592 return (result != 0);
593 }
else if (op == ROXML_OPERATOR_EINF) {
594 return (result <= 0);
595 }
else if (op == ROXML_OPERATOR_INF) {
597 }
else if (op == ROXML_OPERATOR_ESUP) {
598 return (result >= 0);
599 }
else if (op == ROXML_OPERATOR_SUP) {
601 }
else if (op == ROXML_OPERATOR_EQU) {
602 return (result == 0);
617 condition = xn->
cond;
630 if (condition->
func == ROXML_FUNC_POS) {
632 iarg2 = atof(condition->
arg2);
633 if (xn->
name[0] ==
'*') {
639 }
else if (condition->
func == ROXML_FUNC_LAST) {
642 if (xn->
name[0] ==
'*') {
647 if (condition->
op > 0) {
649 operand = atof(condition->
arg2);
653 }
else if (condition->
func == ROXML_FUNC_FIRST) {
656 if (xn->
name[0] ==
'*') {
661 if (condition->
op > 0) {
663 operand = atof(condition->
arg2);
667 }
else if (condition->
func == ROXML_FUNC_INTCOMP) {
671 ROXML_GET_BASE_BUFFER(strval);
677 iarg2 = atof(condition->
arg2);
679 ROXML_PUT_BASE_BUFFER(strval);
681 }
else if (condition->
func == ROXML_FUNC_NSURI) {
685 ROXML_GET_BASE_BUFFER(strval);
690 sarg2 = condition->
arg2;
693 ROXML_PUT_BASE_BUFFER(strval);
695 sarg2 = condition->
arg2;
698 }
else if (condition->
func == ROXML_FUNC_STRCOMP) {
702 ROXML_GET_BASE_BUFFER(strval);
707 sarg2 = condition->
arg2;
710 ROXML_PUT_BASE_BUFFER(strval);
712 }
else if (condition->
func == ROXML_FUNC_XPATH) {
713 int index = condition->
func2;
733 if (condition->
rel == ROXML_OPERATOR_OR) {
734 valid = valid || status;
735 }
else if (condition->
rel == ROXML_OPERATOR_AND) {
736 valid = valid && status;
739 condition = condition->
next;
756 pthread_mutex_lock(&table->
mut);
757 for (i = ROXML_XPATH_FIRST_ID; i < 255; i++) {
758 if (table->
ids[i] == 0) {
760 pthread_mutex_unlock(&table->
mut);
764 pthread_mutex_unlock(&table->
mut);
778 pthread_mutex_lock(&table->
mut);
781 if (tok->
id == req_id) {
782 pthread_mutex_unlock(&table->
mut);
786 if (tok->
id == req_id) {
787 pthread_mutex_unlock(&table->
mut);
794 pthread_mutex_unlock(&table->
mut);
809 for (i = 0; i < pool_len; i++) {
812 pthread_mutex_lock(&table->
mut);
813 table->
ids[req_id] = 0;
814 pthread_mutex_unlock(&table->
mut);
827 pthread_mutex_lock(&table->
mut);
831 if (tok->id == req_id) {
832 n->
priv = (
void *)tok->next;
836 if (tok->id == req_id) {
837 prev->
next = tok->next;
846 pthread_mutex_unlock(&table->
mut);
864 pthread_mutex_lock(&table->
mut);
868 if (tok->
id == req_id) {
869 pthread_mutex_unlock(&table->
mut);
875 if (last_tok == NULL) {
880 last_tok = last_tok->
next;
882 last_tok->
id = req_id;
883 pthread_mutex_unlock(&table->
mut);
902 if ((axes == NULL) || (strcmp(
"node()", axes) == 0)) {
904 }
else if (strcmp(
"*", axes) == 0) {
911 }
else if (strcmp(
"comment()", axes) == 0) {
915 }
else if (strcmp(
"processing-instruction()", axes) == 0) {
919 }
else if (strcmp(
"text()", axes) == 0) {
923 }
else if (strcmp(
"", axes) == 0) {
937 if (xn->
next == NULL) {
940 if ((xn->
axes == ROXML_ID_SELF) || (xn->
axes == ROXML_ID_PARENT)) {
946 ROXML_GET_BASE_BUFFER(intern_buff);
948 char *name = intern_buff;
951 ns_len = strlen(name);
958 if (name && strcmp(name, axes) == 0) {
961 ROXML_PUT_BASE_BUFFER(intern_buff);
968 if ((valid) && (xn) && (xn->
xp_cond)) {
972 if (condition->
func == ROXML_FUNC_STRCOMP) {
975 ROXML_GET_BASE_BUFFER(strval);
980 sarg2 = condition->
arg2;
983 ROXML_PUT_BASE_BUFFER(strval);
984 }
else if (condition->
func == ROXML_FUNC_INTCOMP) {
987 ROXML_GET_BASE_BUFFER(strval);
993 iarg2 = atof(condition->
arg2);
995 ROXML_PUT_BASE_BUFFER(strval);
999 if ((valid) && (path_end)) {
1002 if ((*nb) >= (*max)) {
1003 int new_max = (*max) * 2;
1005 memcpy(new_ans, (*ans), *(max) *
sizeof(
node_t *));
1010 (*ans)[*nb] = candidat;
1020 int ignore,
int req_id)
1022 int validate_node = 0;
1024 if ((req_id == 0) && (*nb > 0)) {
1032 if (ignore == ROXML_DESC_ONLY) {
1036 current = current->
sibl;
1041 case ROXML_ID_CHILD:{
1045 if (validate_node) {
1048 current = current->
sibl;
1050 if ((xp->
name == NULL) || (strcmp(xp->
name,
"text()") == 0)
1051 || (strcmp(xp->
name,
"node()") == 0)) {
1055 current = current->
sibl;
1058 if ((xp->
name == NULL) || (strcmp(xp->
name,
"node()") == 0)) {
1062 current = current->
sibl;
1067 case ROXML_ID_DESC:{
1069 roxml_check_node(xp, root, context, ans, nb, max, ROXML_DESC_ONLY, req_id);
1072 case ROXML_ID_DESC_O_SELF:{
1075 if (validate_node) {
1078 roxml_check_node(xp, root, context, ans, nb, max, ROXML_DESC_ONLY, req_id);
1081 case ROXML_ID_SELF:{
1086 case ROXML_ID_PARENT:{
1087 if (context->
prnt) {
1095 case ROXML_ID_ATTR:{
1099 if (validate_node) {
1102 attribute = attribute->
sibl;
1110 if (validate_node) {
1113 current = current->
prnt;
1117 case ROXML_ID_NEXT_SIBL:{
1121 if (validate_node) {
1124 current = current->
sibl;
1128 case ROXML_ID_PREV_SIBL:{
1130 while (current != context) {
1132 if (validate_node) {
1135 current = current->
sibl;
1139 case ROXML_ID_NEXT:{
1140 node_t *current = context;
1145 if (validate_node) {
1149 xp->
axes = ROXML_ID_CHILD;
1152 xp->
axes = ROXML_ID_NEXT;
1154 following = following->
sibl;
1156 following = current->
prnt->chld;
1157 while (following != current) {
1158 following = following->
sibl;
1160 current = following->
sibl;
1164 case ROXML_ID_PREV:{
1165 node_t *current = context;
1166 while (current && current->
prnt) {
1168 while (preceding != current) {
1170 if (validate_node) {
1174 xp->
axes = ROXML_ID_CHILD;
1177 xp->
axes = ROXML_ID_PREV;
1179 preceding = preceding->
sibl;
1181 current = current->
prnt;
1187 if (validate_node) {
1192 case ROXML_ID_ANC_O_SELF:{
1193 node_t *current = context;
1196 if (validate_node) {
1199 current = current->
prnt;
1212 int pool1 = 0, pool2 = 0;
1214 for (i = 0; i < limit; i++) {
1225 if (!pool1 || !pool2) {
1226 for (i = 0; i < limit; i++) {
1237 for (i = 0; i < *count; i++) {
1248 int max_answers = 1;
1250 int *req_ids = NULL;
1260 req_ids = calloc(index,
sizeof(
int));
1263 for (path_id = 0; path_id < index; path_id++) {
1266 cur_xpath = &xpath[path_id];
1267 if (path_id < index - 1) {
1268 next_xpath = &xpath[path_id + 1];
1271 if ((cur_xpath->
rel == ROXML_OPERATOR_AND) || ((next_xpath) && (next_xpath->
rel == ROXML_OPERATOR_AND))) {
1275 if (cur_xpath->
abs) {
1280 roxml_check_node(cur_xpath, root, orig, &node_set, count, &max_answers, ROXML_DIRECT, req_id);
1282 if (cur_xpath->
rel == ROXML_OPERATOR_AND) {
1285 req_ids[path_id] = req_id;
1290 for (path_id = 0; path_id < index; path_id++) {
1294 if (cur_xpath->
rel == ROXML_OPERATOR_OR) {
1295 if (req_ids[path_id] == 0) {
1296 if (cur_xpath->
abs) {
1301 roxml_check_node(cur_xpath, root, orig, &node_set, count, &max_answers, ROXML_DIRECT,
1311 for (path_id = 0; path_id < index; path_id++) {
1312 if (req_ids[path_id] != 0) {
1325 if (parent == NULL) {
1332 && parent->
ns->priv && ((
roxml_ns_t *) parent->
ns->priv)->alias[0] ==
'\0') {
1333 if (n->
ns == NULL) {
1341 while (attr->
sibl) {
1350 parent->
next->sibl = n;
1367 if (parent == NULL) {
1371 if (position == 0) {
1383 if (position > nb) {
1390 && ((
roxml_ns_t *) parent->
ns->priv)->alias[0] ==
'\0') {
1391 if (n->
ns == NULL) {
1396 if (position == 1) {
1410 next = parent->
attr;
1412 for (i = 1; i < position; i++) {
1422 #if(CONFIG_XML_COMMIT_XML_TREE==1)
1429 int pos = *offset + lvl;
1435 for (; i < lvl; i++) {
1441 for (; i < lvl; i++) {
1442 fwrite(
" ", 1, 1, f);
1450 int min_len = strlen(str);
1451 int pos = *offset + min_len;
1454 if ((pos >= *len) && (buf) && (*buf)) {
1455 *buf = realloc(*buf, *len + appended_space);
1456 memset(*buf + *len, 0, appended_space);
1457 *len += appended_space;
1460 fprintf(f,
"%s", str);
1463 strcat(*buf + (*offset), str);
1470 ROXML_GET_BASE_BUFFER(name);
1477 ROXML_GET_BASE_BUFFER(ns);
1483 if (ns[0] !=
'\0') {
1504 if (arg[0] !=
'\0') {
1509 ROXML_GET_BASE_BUFFER(arg_ns);
1511 if (arg_ns[0] !=
'\0') {
1515 ROXML_PUT_BASE_BUFFER(arg_ns);
1534 ROXML_GET_BASE_BUFFER(val);
1549 char *end = value + status - 2;
1550 char *strip = value;
1566 ROXML_PUT_BASE_BUFFER(val);
1578 if (ns[0] !=
'\0') {
1595 ROXML_PUT_BASE_BUFFER(ns);
1602 ROXML_GET_BASE_BUFFER(val);
1605 strcpy(head,
"<!--");
1606 strcpy(tail,
"-->");
1628 if (name[0] && value && value[0]) {
1639 ROXML_PUT_BASE_BUFFER(val);
1641 ROXML_PUT_BASE_BUFFER(name);
1645 #if(CONFIG_XML_READ_WRITE==1)
1672 if (attr->
ns == ns) {
1673 attr->
ns = attr->
prnt->ns;
1690 }
else if (current) {
1691 while (current->
sibl && current->
sibl != n) {
1692 current = current->
sibl;
1707 while (current != n) {
1709 current = current->
sibl;
1719 current = current->
sibl;
1721 if (n->
prnt && n->
prnt->next == n) {
1722 n->
prnt->next = roxml_get_real_prev_sibling(n);
1726 }
else if (current) {
1727 while (current->
sibl && current->
sibl != n) {
1728 current = current->
sibl;
1738 if (n->
prnt && n->
prnt->next == n) {
1739 n->
prnt->next = roxml_get_real_prev_sibling(n);
1743 }
else if (current) {
1744 while (current->
sibl && current->
sibl != n) {
1745 current = current->
sibl;
int ROXML_INT roxml_read(int pos, int size, char *buffer, node_t *node)
read xml doc function
void ROXML_INT roxml_free_xpath(xpath_node_t *xpath, int nb)
xpath free function
void ROXML_INT roxml_close_node(node_t *n, node_t *close)
internal function
void ROXML_API roxml_close(node_t *n)
unload function
int ROXML_API roxml_get_nodes_nb(node_t *n, int type)
number of nodes getter function
node_t ROXML_API * roxml_get_txt(node_t *n, int nth)
text node getter function
struct _xpath_cond * next
int ROXML_INT roxml_double_cmp(double a, double b, int op)
double comparison function
node_t ROXML_API * roxml_get_ns(node_t *n)
namespace getter function
node_t ROXML_API * roxml_get_attr(node_t *n, char *name, int nth)
attribute getter function
node_t ROXML_INT ** roxml_exec_xpath(node_t *root, node_t *n, xpath_node_t *xpath, int index, int *count)
real xpath execution
void ROXML_INT roxml_compute_or(node_t *root, node_t **node_set, int *count, int req_id, int glob_id)
node set or function
int ROXML_API roxml_get_chld_nb(node_t *n)
chlds number getter function
int ROXML_API roxml_get_attr_nb(node_t *n)
number of attribute getter function
node_t ROXML_INT * roxml_lookup_nsdef(node_t *nsdef, char *ns)
name space lookup in list
int roxml_is_number(char *input)
number tester
xpath_node_t * first_node
xpath_node_t ROXML_INT * roxml_set_axes(xpath_node_t *node, char *axes, int *offset)
axes setter function
void ROXML_INT roxml_del_txt_node(node_t *n)
text node deletion function
int ROXML_INT roxml_parse_xpath(char *path, xpath_node_t **xpath, int context)
xpath parsing function
node_t ROXML_INT * roxml_load(node_t *current_node, FILE *file, char *buffer)
generic load function
#define ROXML_DOCTYPE_NODE
double ROXML_INT roxml_double_oper(double a, double b, int op)
double operation function
int ROXML_INT roxml_in_pool(node_t *root, node_t *n, int req_id)
node pool presence tester function
int ROXML_INT roxml_get_node_internal_position(node_t *n)
node absolute position get
void ROXML_INT roxml_compute_and(node_t *root, node_t **node_set, int *count, int cur_req_id, int prev_req_id)
node set and function
void ROXML_INT * roxml_malloc(int size, int num, int type)
alloc memory function
void ROXML_INT roxml_check_node(xpath_node_t *xp, node_t *root, node_t *context, node_t ***ans, int *nb, int *max, int ignore, int req_id)
real xpath validation function
void ROXML_INT roxml_release_id(node_t *root, node_t **pool, int pool_len, int req_id)
release id function
int ROXML_INT roxml_is_separator(char sep)
separator tester
int ROXML_API roxml_get_node_position(node_t *n)
node get position function
void ROXML_INT roxml_process_begin_node(roxml_load_ctx_t *context, int position)
node creation during parsing
int ROXML_INT roxml_request_id(node_t *root)
id reservation function
node_t ROXML_INT * roxml_create_node(int pos, void *src, int type)
internal function
char ROXML_API * roxml_get_content(node_t *n, char *buffer, int bufsize, int *size)
content getter function
void ROXML_INT roxml_reset_ns(node_t *n, node_t *ns)
internal function
void ROXML_API roxml_release(void *data)
memory cleanning function
void ROXML_INT roxml_process_unaliased_ns(roxml_load_ctx_t *context)
namespace without alias name creation during parsing
memory_cell_t head_cell
head of memory manager
node_t ROXML_INT * roxml_append_node(node_t *parent, node_t *n)
node append function
void ROXML_INT roxml_del_tree(node_t *n)
internal function
node_t ROXML_API * roxml_get_root(node_t *n)
root getter function
struct _xpath_cond * cond
struct memory_cell * prev
int ROXML_INT roxml_string_cmp(char *sa, char *sb, int op)
string comparison function
void ROXML_INT roxml_del_arg_node(node_t *n)
attribute node deletion function
void ROXML_INT roxml_free_node(node_t *n)
internal function
void ROXML_INT roxml_del_from_pool(node_t *root, node_t *n, int req_id)
pool node delete function
int ROXML_INT roxml_validate_predicat(xpath_node_t *xn, node_t *candidat)
predicat validation function
struct _xpath_cond * xp_cond
void ROXML_INT roxml_print_space(FILE *f, char **buf, int *offset, int *len, int lvl)
space printing function
char ROXML_API * roxml_get_name(node_t *n, char *buffer, int size)
name getter function
struct memory_cell * next
node_t ROXML_INT * roxml_parent_node(node_t *parent, node_t *n, int position)
node relocate function
void ROXML_INT roxml_write_string(char **buf, FILE *f, char *str, int *offset, int *len)
string writter function
void ROXML_INT roxml_set_type(node_t *n, int type)
node type setter function
int ROXML_INT roxml_add_to_pool(node_t *root, node_t *n, int req_id)
add a token top node function
void ROXML_INT roxml_free_xcond(xpath_cond_t *xcond)
xpath condition free function
int ROXML_INT roxml_validate_axes(node_t *root, node_t *candidat, node_t ***ans, int *nb, int *max, xpath_node_t *xn, int req_id)
axe validation function
void ROXML_INT roxml_write_node(node_t *n, FILE *f, char **buf, int human, int lvl, int *offset, int *len)
tree write function
struct _xpath_node * next
void ROXML_INT roxml_del_std_node(node_t *n)
node deletion function
internal header for libroxml.so