<libroxml  version="3.0.1" />
contact: tristan.lelong@libroxml.net
roxml.h
Go to the documentation of this file.
1 
12 #ifndef ROXML_H
13 #define ROXML_H
14 
15 #ifdef __cplusplus
16 extern "C" {
17 #endif
18 
24 #define ROXML_API
25 
26 #ifndef ROXML_INT
27 
35 typedef struct node node_t;
36 #endif
37 
43 #define ROXML_INVALID_NODE 0x000
44 
51 #define ROXML_ATTR_NODE 0x008
52 
62 #define ROXML_STD_NODE 0x010
63 
70 #define ROXML_ELM_NODE 0x010
71 
78 #define ROXML_TXT_NODE 0x020
79 
86 #define ROXML_CMT_NODE 0x040
87 
94 #define ROXML_PI_NODE 0x080
95 
102 #define ROXML_NS_NODE 0x100
103 
110 #define ROXML_NSDEF_NODE (ROXML_NS_NODE | ROXML_ATTR_NODE)
111 
118 #define ROXML_CDATA_NODE (ROXML_TXT_NODE | 0x200)
119 
126 #define ROXML_DOCTYPE_NODE 0x400
127 
134 #define ROXML_ALL_NODES (ROXML_PI_NODE | ROXML_CMT_NODE | ROXML_TXT_NODE | ROXML_ATTR_NODE | ROXML_ELM_NODE)
135 
142 #define ROXML_ALL_NODE ROXML_ALL_NODES
143 
150 #define ROXML_NODE_TYPES 0x05f8
151 
158 #define RELEASE_ALL (void*)-1
159 
188 #define RELEASE_LAST (void*)-2
189 
195 #define ROXML_INVALID_DOC (node_t*)0
196 
209 ROXML_API node_t * roxml_load_buf(char *buffer);
210 
222 ROXML_API node_t * roxml_load_doc(char *filename);
223 
234 ROXML_API node_t * roxml_load_fd(int fd);
235 
248 ROXML_API void roxml_close(node_t *n);
249 
258 
267 
276 
320 
374 
393 
442 ROXML_API node_t * roxml_get_cmt(node_t *n, int nth);
443 
454 
496 ROXML_API node_t * roxml_get_chld(node_t *n, char *name, int nth);
497 
506 
555 ROXML_API node_t * roxml_get_pi(node_t *n, int nth);
556 
567 
590 ROXML_API char * roxml_get_name(node_t *n, char *buffer, int size);
591 
616 ROXML_API char * roxml_get_content(node_t *n, char *buffer, int bufsize, int *size);
617 
679 ROXML_API int roxml_get_nodes_nb(node_t *n, int type);
680 
700 ROXML_API node_t * roxml_get_nodes(node_t *n, int type, char *name, int nth);
701 
711 
751 ROXML_API node_t * roxml_get_attr(node_t *n, char *name, int nth);
752 
765 ROXML_API node_t ** roxml_xpath(node_t *n, char *path, int *nb_ans);
766 
776 
785 
801 ROXML_API void roxml_release(void *data);
802 
907 ROXML_API node_t * roxml_add_node(node_t *parent, int position, int type, char *name, char *value);
908 
962 ROXML_API node_t * roxml_get_txt(node_t *n, int nth);
963 
974 
991 
1098 ROXML_API int roxml_commit_changes(node_t *n, char *dest, char **buffer, int human);
1099 
1165 ROXML_API int roxml_commit_file(node_t *n, char *dest, int human);
1166 
1233 ROXML_API int roxml_commit_buffer(node_t *n, char **buffer, int human);
1234 
1306 ROXML_API int roxml_commit_fd(node_t *n, int fd, int human);
1307 
1308 #ifdef __cplusplus
1309 }
1310 #endif
1311 
1312 #endif /* ROXML_H */
ROXML_API int roxml_get_chld_nb(node_t *n)
chlds number getter function
node_t structure
Definition: roxml_types.h:133
ROXML_API void roxml_release(void *data)
memory cleanning function
Definition: roxml_mem.c:109
ROXML_API int roxml_commit_buffer(node_t *n, char **buffer, int human)
sync to a memory buffer function
Definition: roxml_commit.c:296
ROXML_API node_t * roxml_load_doc(char *filename)
load function for files
Definition: roxml_file.c:90
ROXML_API int roxml_get_pi_nb(node_t *n)
process-instruction number getter function
ROXML_API node_t * roxml_get_pi(node_t *n, int nth)
process-instruction getter function
ROXML_API node_t * roxml_load_buf(char *buffer)
load function for buffers
Definition: roxml_buff.c:47
ROXML_API node_t * roxml_load_fd(int fd)
load function for file descriptors
Definition: roxml_file.c:73
ROXML_API int roxml_commit_fd(node_t *n, int fd, int human)
sync to file descriptor function
Definition: roxml_commit.c:317
#define ROXML_API
Definition: roxml.h:24
ROXML_API char * roxml_get_name(node_t *n, char *buffer, int size)
name getter function
ROXML_API node_t ** roxml_xpath(node_t *n, char *path, int *nb_ans)
exec path function
Definition: roxml_stub.c:167
ROXML_API int roxml_commit_file(node_t *n, char *dest, int human)
sync to named file function
Definition: roxml_commit.c:272
ROXML_API node_t * roxml_get_txt(node_t *n, int nth)
text node getter function
ROXML_API node_t * roxml_add_node(node_t *parent, int position, int type, char *name, char *value)
add a node to the tree
Definition: roxml_edit.c:351
ROXML_API int roxml_get_node_position(node_t *n)
node get position function
ROXML_API node_t * roxml_get_ns(node_t *n)
namespace getter function
ROXML_API int roxml_get_cmt_nb(node_t *n)
comments number getter function
ROXML_API node_t * roxml_set_ns(node_t *n, node_t *ns)
namespace setter function
Definition: roxml_edit.c:383
ROXML_API int roxml_commit_changes(node_t *n, char *dest, char **buffer, int human)
sync function
Definition: roxml_commit.c:357
ROXML_API void roxml_close(node_t *n)
unload function
Definition: roxml_core.c:25
ROXML_API int roxml_get_type(node_t *n)
node type function
ROXML_API node_t * roxml_get_attr(node_t *n, char *name, int nth)
attribute getter function
ROXML_API int roxml_get_txt_nb(node_t *n)
text node number getter function
ROXML_API node_t * roxml_get_parent(node_t *n)
parent getter function
Definition: roxml_nav.c:45
ROXML_API node_t * roxml_get_root(node_t *n)
root getter function
Definition: roxml_nav.c:55
ROXML_API node_t * roxml_get_chld(node_t *n, char *name, int nth)
chld getter function
ROXML_API int roxml_get_attr_nb(node_t *n)
number of attribute getter function
ROXML_API node_t * roxml_get_cmt(node_t *n, int nth)
comment getter function
ROXML_API node_t * roxml_get_nodes(node_t *n, int type, char *name, int nth)
nodes getter function
ROXML_API char * roxml_get_content(node_t *n, char *buffer, int bufsize, int *size)
content getter function
ROXML_API void roxml_del_node(node_t *n)
node deletion function
Definition: roxml_edit.c:203
ROXML_API node_t * roxml_get_next_sibling(node_t *n)
next sibling getter function
Definition: roxml_nav.c:34
ROXML_API int roxml_get_nodes_nb(node_t *n, int type)
number of nodes getter function
ROXML_API node_t * roxml_get_prev_sibling(node_t *n)
prev sibling getter function
Definition: roxml_nav.c:14