<libroxml  version="3.0.2" />
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
16extern "C" {
17#endif
18
24#define ROXML_API
25
26#ifndef ROXML_INT
35typedef 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_MOD 0x200
119
126#define ROXML_CDATA_NODE (ROXML_TXT_NODE | ROXML_CDATA_MOD)
127
134#define ROXML_DOCTYPE_NODE 0x400
135
142#define ROXML_ALL_NODES (ROXML_PI_NODE | ROXML_CMT_NODE | ROXML_TXT_NODE | ROXML_ATTR_NODE | ROXML_ELM_NODE)
143
150#define ROXML_ALL_NODE ROXML_ALL_NODES
151
158#define ROXML_NODE_TYPES 0x05f8
159
166#define ROXML_ESCAPED_MOD 0x800
167
174#define ROXML_NON_ESCAPABLE_NODES (ROXML_CMT_NODE | ROXML_PI_NODE | ROXML_NS_NODE | ROXML_CDATA_MOD | ROXML_DOCTYPE_NODE)
175
182#define ENCODE 0
183
190#define DECODE 1
191
198#define RELEASE_ALL (void*)-1
199
228#define RELEASE_LAST (void*)-2
229
235#define ROXML_INVALID_DOC (node_t*)0
236
249ROXML_API node_t * roxml_load_buf(char *buffer);
250
262ROXML_API node_t * roxml_load_doc(char *filename);
263
275
289
298
307
316
360
414
433
482ROXML_API node_t * roxml_get_cmt(node_t *n, int nth);
483
494
536ROXML_API node_t * roxml_get_chld(node_t *n, char *name, int nth);
537
546
595ROXML_API node_t * roxml_get_pi(node_t *n, int nth);
596
607
630ROXML_API char * roxml_get_name(node_t *n, char *buffer, int size);
631
656ROXML_API char * roxml_get_content(node_t *n, char *buffer, int bufsize, int *size);
657
670ROXML_API int roxml_escape(const char *buf, int decode, char *out);
671
733ROXML_API int roxml_get_nodes_nb(node_t *n, int type);
734
754ROXML_API node_t * roxml_get_nodes(node_t *n, int type, char *name, int nth);
755
765
805ROXML_API node_t * roxml_get_attr(node_t *n, char *name, int nth);
806
819ROXML_API node_t ** roxml_xpath(node_t *n, char *path, int *nb_ans);
820
830
839
855ROXML_API void roxml_release(void *data);
856
970ROXML_API node_t * roxml_add_node(node_t *parent, int position, int type, char *name, char *value);
971
1025ROXML_API node_t * roxml_get_txt(node_t *n, int nth);
1026
1037
1054
1161ROXML_API int roxml_commit_changes(node_t *n, char *dest, char **buffer, int human);
1162
1228ROXML_API int roxml_commit_file(node_t *n, char *dest, int human);
1229
1296ROXML_API int roxml_commit_buffer(node_t *n, char **buffer, int human);
1297
1369ROXML_API int roxml_commit_fd(node_t *n, int fd, int human);
1370
1371#ifdef __cplusplus
1372}
1373#endif
1374
1375#endif /* ROXML_H */
ROXML_API node_t * roxml_get_prev_sibling(node_t *n)
prev sibling getter function
Definition roxml_nav.c:14
ROXML_API node_t * roxml_load_doc(char *filename)
load function for files
Definition roxml_file.c:90
ROXML_API void roxml_del_node(node_t *n)
node deletion function
Definition roxml_edit.c:204
ROXML_API node_t * roxml_load_fd(int fd)
load function for file descriptors
Definition roxml_file.c:73
ROXML_API node_t * roxml_set_ns(node_t *n, node_t *ns)
namespace setter function
Definition roxml_edit.c:395
ROXML_API node_t ** roxml_xpath(node_t *n, char *path, int *nb_ans)
exec path function
Definition roxml_stub.c:167
ROXML_API node_t * roxml_get_nodes(node_t *n, int type, char *name, int nth)
nodes getter function
ROXML_API node_t * roxml_get_root(node_t *n)
root getter function
Definition roxml_nav.c:55
ROXML_API int roxml_get_txt_nb(node_t *n)
text node number getter function
ROXML_API int roxml_commit_fd(node_t *n, int fd, int human)
sync to file descriptor function
ROXML_API node_t * roxml_get_cmt(node_t *n, int nth)
comment getter function
ROXML_API void roxml_close(node_t *n)
unload function
Definition roxml_core.c:25
ROXML_API node_t * roxml_load_buf(char *buffer)
load function for buffers
Definition roxml_buff.c:47
ROXML_API int roxml_commit_file(node_t *n, char *dest, int human)
sync to named file function
ROXML_API node_t * roxml_get_next_sibling(node_t *n)
next sibling getter function
Definition roxml_nav.c:34
ROXML_API node_t * roxml_get_attr(node_t *n, char *name, int nth)
attribute getter function
ROXML_API int roxml_commit_buffer(node_t *n, char **buffer, int human)
sync to a memory buffer function
ROXML_API node_t * roxml_get_txt(node_t *n, int nth)
text node getter function
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 int roxml_get_chld_nb(node_t *n)
chlds number getter function
ROXML_API char * roxml_get_name(node_t *n, char *buffer, int size)
name getter function
ROXML_API void roxml_release(void *data)
memory cleanning function
Definition roxml_mem.c:109
ROXML_API int roxml_get_attr_nb(node_t *n)
number of attribute getter function
ROXML_API int roxml_get_type(node_t *n)
node type function
ROXML_API int roxml_get_node_position(node_t *n)
node get position function
ROXML_API int roxml_commit_changes(node_t *n, char *dest, char **buffer, int human)
sync function
ROXML_API int roxml_get_nodes_nb(node_t *n, int type)
number of nodes getter function
ROXML_API int roxml_get_cmt_nb(node_t *n)
comments number getter function
ROXML_API node_t * roxml_get_parent(node_t *n)
parent getter function
Definition roxml_nav.c:45
#define ROXML_API
Definition roxml.h:24
ROXML_API node_t * roxml_get_ns(node_t *n)
namespace 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:353
ROXML_API int roxml_escape(const char *buf, int decode, char *out)
XML encoding/decoding function.
ROXML_API node_t * roxml_get_chld(node_t *n, char *name, int nth)
chld getter function
ROXML_API char * roxml_get_content(node_t *n, char *buffer, int bufsize, int *size)
content getter function
node_t structure