<libroxml
version="2.3.0"
/>
|
source for libroxml.so More...
Go to the source code of this file.
Functions | |
void ROXML_INT * | roxml_malloc (int size, int num, int type) |
alloc memory function More... | |
int ROXML_INT | roxml_read (int pos, int size, char *buffer, node_t *node) |
read xml doc function More... | |
node_t ROXML_INT * | roxml_create_node (int pos, void *src, int type) |
internal function More... | |
void ROXML_INT | roxml_close_node (node_t *n, node_t *close) |
internal function More... | |
void ROXML_INT | roxml_free_node (node_t *n) |
internal function More... | |
void ROXML_INT | roxml_del_tree (node_t *n) |
internal function More... | |
int | roxml_is_number (char *input) |
number tester More... | |
int ROXML_INT | roxml_is_separator (char sep) |
separator tester More... | |
void ROXML_INT | roxml_process_unaliased_ns (roxml_load_ctx_t *context) |
namespace without alias name creation during parsing More... | |
void ROXML_INT | roxml_process_begin_node (roxml_load_ctx_t *context, int position) |
node creation during parsing More... | |
node_t ROXML_INT * | roxml_load (node_t *current_node, FILE *file, char *buffer) |
generic load function More... | |
node_t ROXML_INT * | roxml_lookup_nsdef (node_t *nsdef, char *ns) |
name space lookup in list More... | |
void ROXML_INT | roxml_set_type (node_t *n, int type) |
node type setter function More... | |
xpath_node_t ROXML_INT * | roxml_set_axes (xpath_node_t *node, char *axes, int *offset) |
axes setter function More... | |
int ROXML_INT | roxml_get_node_internal_position (node_t *n) |
node absolute position get More... | |
int ROXML_INT | roxml_parse_xpath (char *path, xpath_node_t **xpath, int context) |
xpath parsing function More... | |
void ROXML_INT | roxml_free_xcond (xpath_cond_t *xcond) |
xpath condition free function More... | |
void ROXML_INT | roxml_free_xpath (xpath_node_t *xpath, int nb) |
xpath free function More... | |
double ROXML_INT | roxml_double_oper (double a, double b, int op) |
double operation function More... | |
int ROXML_INT | roxml_double_cmp (double a, double b, int op) |
double comparison function More... | |
int ROXML_INT | roxml_string_cmp (char *sa, char *sb, int op) |
string comparison function More... | |
int ROXML_INT | roxml_validate_predicat (xpath_node_t *xn, node_t *candidat) |
predicat validation function More... | |
int ROXML_INT | roxml_request_id (node_t *root) |
id reservation function More... | |
int ROXML_INT | roxml_in_pool (node_t *root, node_t *n, int req_id) |
node pool presence tester function More... | |
void ROXML_INT | roxml_release_id (node_t *root, node_t **pool, int pool_len, int req_id) |
release id function More... | |
void | roxml_del_from_pool (node_t *root, node_t *n, int req_id) |
pool node delete function More... | |
int ROXML_INT | roxml_add_to_pool (node_t *root, node_t *n, int req_id) |
add a token top node function More... | |
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 More... | |
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 More... | |
void | roxml_compute_and (node_t *root, node_t **node_set, int *count, int cur_req_id, int prev_req_id) |
node set and function More... | |
void | roxml_compute_or (node_t *root, node_t **node_set, int *count, int req_id, int glob_id) |
node set or function More... | |
node_t ** | roxml_exec_xpath (node_t *root, node_t *n, xpath_node_t *xpath, int index, int *count) |
real xpath execution More... | |
node_t ROXML_INT * | roxml_append_node (node_t *parent, node_t *n) |
node append function More... | |
node_t ROXML_INT * | roxml_parent_node (node_t *parent, node_t *n, int position) |
node relocate function More... | |
void ROXML_INT | roxml_print_space (FILE *f, char **buf, int *offset, int *len, int lvl) |
space printing function More... | |
void ROXML_INT | roxml_write_string (char **buf, FILE *f, char *str, int *offset, int *len) |
string writter function More... | |
void ROXML_INT | roxml_write_node (node_t *n, FILE *f, char **buf, int human, int lvl, int *offset, int *len) |
tree write function More... | |
void ROXML_INT | roxml_reset_ns (node_t *n, node_t *ns) |
internal function More... | |
void ROXML_INT | roxml_del_arg_node (node_t *n) |
attribute node deletion function More... | |
void ROXML_INT | roxml_del_txt_node (node_t *n) |
text node deletion function More... | |
void ROXML_INT | roxml_del_std_node (node_t *n) |
node deletion function More... | |
Variables | |
memory_cell_t | head_cell = { PTR_NONE, 0, NULL, 0, NULL, NULL } |
head of memory manager | |
source for libroxml.so
This is the source file for lib libroxml.so internal functions
Copyright (C) 2010 blunderer
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The author added a static linking exception, see License.txt.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Definition in file roxml-internal.c.
add a token top node function
this function add a token to target node. This token is used to garanty unicity in xpath results
root | the root node |
n | the node to mark |
req_id | the id to use |
Definition at line 849 of file roxml-internal.c.
node append function
this function add a given node as the last child of another node
parent | the parent node |
n | the node to parent |
Definition at line 1323 of file roxml-internal.c.
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
this function perform the xpath test on a tree
xp | the xpath nodes to test |
root | the root node |
context | the current context node |
ans | the pointer to answers pool |
nb | the number of answers in pool |
max | the current size of the pool |
ignore | a flag for some axes that are going thru all document |
req_id | the pool id |
Definition at line 1019 of file roxml-internal.c.
internal function
This function close the node (add the end offset) and parent the node
n | is the node to close |
close | is the node that close node n |
Definition at line 90 of file roxml-internal.c.
void roxml_compute_and | ( | node_t * | root, |
node_t ** | node_set, | ||
int * | count, | ||
int | cur_req_id, | ||
int | prev_req_id | ||
) |
node set and function
this function computes the AND of two node pools. The resulting pool will have the same ID as cur_req_id.
root | the root of the tree |
node_set | the node set containing the 2 pools |
count | number of node in the node set |
cur_req_id | the id of the first group |
prev_req_id | the id of the second group |
Definition at line 1208 of file roxml-internal.c.
node set or function
this function computes the OR of two node pools. The resulting pool will have the same ID as glob_id.
root | the root of the tree |
node_set | the node set containing the 2 pools |
count | number of node in the node set |
req_id | the id of the first group |
glob_id | the id of the second group |
Definition at line 1234 of file roxml-internal.c.
internal function
This function allocate a new node
pos | is the beginning offset of the node in the file |
src | is the pointer to the buffer or file |
type | is the type of node between arg and val |
Definition at line 79 of file roxml-internal.c.
attribute node deletion function
this function delete an attribute node
n | the node to delete |
Definition at line 1680 of file roxml-internal.c.
pool node delete function
this function remove one node from a pool
root | the root of the tree |
n | the node to remove |
req_id | the pool id |
Definition at line 817 of file roxml-internal.c.
node deletion function
this function delete a standard node
n | the node to delete |
Definition at line 1735 of file roxml-internal.c.
internal function
This function delete a tree recursively
n | is one node of the tree |
Definition at line 141 of file roxml-internal.c.
text node deletion function
this function delete a text node
n | the node to delete |
Definition at line 1715 of file roxml-internal.c.
int ROXML_INT roxml_double_cmp | ( | double | a, |
double | b, | ||
int | op | ||
) |
double comparison function
this function compare two doubles using one defined operator
a | first operand |
b | second operand |
op | the operator to use |
Definition at line 567 of file roxml-internal.c.
double ROXML_INT roxml_double_oper | ( | double | a, |
double | b, | ||
int | op | ||
) |
double operation function
this function compare two doubles using one defined operator
a | first operand |
b | second operand |
op | the operator to use |
Definition at line 553 of file roxml-internal.c.
node_t** roxml_exec_xpath | ( | node_t * | root, |
node_t * | n, | ||
xpath_node_t * | xpath, | ||
int | index, | ||
int * | count | ||
) |
real xpath execution
this function exec a decoded xpath strcuture
root | the root of the tree |
n | the context node |
xpath | the xpath structure |
index | the number of xpath condition in string |
count | the pointer to a variable that is filled with the resulting node number |
Definition at line 1245 of file roxml-internal.c.
internal function
This function delete a node without handling its tree
n | is one node of the tree |
Definition at line 107 of file roxml-internal.c.
void ROXML_INT roxml_free_xcond | ( | xpath_cond_t * | xcond | ) |
xpath condition free function
this function frees an xpath_cond_t cell
xcond | the xcond to free |
Definition at line 527 of file roxml-internal.c.
void ROXML_INT roxml_free_xpath | ( | xpath_node_t * | xpath, |
int | nb | ||
) |
xpath free function
this function frees the parsed xpath structure
xpath | the xpath to free |
nb | the number of xpath structures in the table |
Definition at line 538 of file roxml-internal.c.
node absolute position get
this function returns the absolute position of the node between siblings
n | the node |
Definition at line 431 of file roxml-internal.c.
node pool presence tester function
this function test is a node is in a pool
root | the root of the tree |
n | the node to test |
req_id | the pool id |
Definition at line 768 of file roxml-internal.c.
int roxml_is_number | ( | char * | input | ) |
number tester
This function tells if a string is a number
input | string to test |
Definition at line 152 of file roxml-internal.c.
int ROXML_INT roxml_is_separator | ( | char | sep | ) |
separator tester
This function tells if a char is a string separator
sep | char to test |
Definition at line 171 of file roxml-internal.c.
generic load function
This function load a document and all the corresponding nodes file and buffer params are exclusive. You usualy want to load either a file OR a buffer
current_node | the XML root |
file | file descriptor of document |
buffer | address of buffer that contains xml |
Definition at line 228 of file roxml-internal.c.
name space lookup in list
this function look for requested name space in nsdef list
nsdef | the nsdef list |
ns | the namespace to find |
Definition at line 327 of file roxml-internal.c.
void ROXML_INT* roxml_malloc | ( | int | size, |
int | num, | ||
int | type | ||
) |
alloc memory function
this function allocate some memory that will be reachable at any time by libroxml memory manager
size | the size of memory to allocate for each elem |
num | the number of element |
type | the kind of pointer |
Definition at line 38 of file roxml-internal.c.
node relocate function
this function change the position of a node in its parent list
parent | the parent node |
n | the node to parent |
position | the position, 0 means or > nb children means at the end |
Definition at line 1360 of file roxml-internal.c.
int ROXML_INT roxml_parse_xpath | ( | char * | path, |
xpath_node_t ** | xpath, | ||
int | context | ||
) |
xpath parsing function
this function convert an xpath string to a table of list of xpath_node_t
path | the xpath string |
xpath | the parsed xpath |
context | 0 for a real xpath, 1 for a xpath in predicat |
Definition at line 455 of file roxml-internal.c.
void ROXML_INT roxml_print_space | ( | FILE * | f, |
char ** | buf, | ||
int * | offset, | ||
int * | len, | ||
int | lvl | ||
) |
space printing function
this function add some space to output when committing change in human format
f | the file pointer if any |
buf | the pointer to string if any |
offset | the current offset in stream |
len | the total len of buffer if any |
lvl | the level in the tree |
Definition at line 1423 of file roxml-internal.c.
void ROXML_INT roxml_process_begin_node | ( | roxml_load_ctx_t * | context, |
int | position | ||
) |
node creation during parsing
this function create a new node upon finding new opening sign. It closes previous node if necessary
context | the parsing context |
position | the position in the file |
Definition at line 207 of file roxml-internal.c.
void ROXML_INT roxml_process_unaliased_ns | ( | roxml_load_ctx_t * | context | ) |
namespace without alias name creation during parsing
this function create a new namespace without alias (default ns or remove ns)
context | the parsing context |
Definition at line 184 of file roxml-internal.c.
read xml doc function
this function read inside a xml doc (file or buffer) and fill the given buffer
pos | the pos in the xml document |
size | the size of the data to read |
buffer | the destination buffer |
node | the node that belong to the tree we want to read to |
Definition at line 59 of file roxml-internal.c.
release id function
this function release a previously required id and remove all id token from the pool
root | the root of the tree that was used for id request |
pool | the result from xpath search using this id |
pool_len | the number of node in pool |
req_id | the id to release |
Definition at line 798 of file roxml-internal.c.
id reservation function
this function request an available id for a new xpath search on the tree
root | the root of the tree where id table is stored |
Definition at line 745 of file roxml-internal.c.
internal function
This function remove the namespace of a node if it is the one specified as argument, and replace it with its parent one
n | is one node of the tree |
ns | is one nsdef of the tree |
Definition at line 1646 of file roxml-internal.c.
xpath_node_t ROXML_INT* roxml_set_axes | ( | xpath_node_t * | node, |
char * | axes, | ||
int * | offset | ||
) |
axes setter function
this function set the axe to a xpath node from xpath string
node | the xpath node to fill |
axes | the string where axe is extracted from |
offset | the detected offset in axe string |
Definition at line 352 of file roxml-internal.c.
node type setter function
this function change the type of a node
n | the node to modify |
type | the new type to set |
Definition at line 346 of file roxml-internal.c.
int ROXML_INT roxml_string_cmp | ( | char * | sa, |
char * | sb, | ||
int | op | ||
) |
string comparison function
this function compare two strings using one defined operator
sa | first operand |
sb | second operand |
op | the operator to use |
Definition at line 585 of file roxml-internal.c.
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
this function validate if an axe is matching the current node
root | the root node |
candidat | the node to test |
ans | the pointer to answers pool |
nb | the number of answers in pool |
max | the current size of the pool |
xn | the xpath node to test |
req_id | the pool id |
Definition at line 888 of file roxml-internal.c.
int ROXML_INT roxml_validate_predicat | ( | xpath_node_t * | xn, |
node_t * | candidat | ||
) |
predicat validation function
this function check for predicat validity. predicat is part between brackets
xn | the xpath node containing the predicat to test |
candidat | the node to test |
Definition at line 607 of file roxml-internal.c.
void ROXML_INT roxml_write_node | ( | node_t * | n, |
FILE * | f, | ||
char ** | buf, | ||
int | human, | ||
int | lvl, | ||
int * | offset, | ||
int * | len | ||
) |
tree write function
this function write each node of the tree to output
n | the node to write |
f | the file pointer if any |
buf | the pointer to the buffer string if any |
human | 1 to use the human format else 0 |
lvl | the current level in tree |
offset | the current offset in stream |
len | the total len of buffer if any |
Definition at line 1468 of file roxml-internal.c.
void ROXML_INT roxml_write_string | ( | char ** | buf, |
FILE * | f, | ||
char * | str, | ||
int * | offset, | ||
int * | len | ||
) |
string writter function
this function write a string to output when committing change
f | the file pointer if any |
buf | the pointer to string if any |
str | the string to write |
offset | the current offset in stream |
len | the total len of buffer if any |
Definition at line 1448 of file roxml-internal.c.