<libroxml  version="2.3.0" />
contact: tristan.lelong@libroxml.net
roxml.h
Go to the documentation of this file.
1 
27 #ifndef ROXML_H
28 #define ROXML_H
29 
30 #include <stdio.h>
31 #include <stdlib.h>
32 #include <string.h>
33 
39 #define ROXML_API
40 
41 #ifndef ROXML_INT
42 
50 typedef struct node node_t;
51 #endif
52 
59 #define ROXML_ATTR_NODE 0x008
60 
70 #define ROXML_STD_NODE 0x010
71 
78 #define ROXML_ELM_NODE 0x010
79 
86 #define ROXML_TXT_NODE 0x020
87 
94 #define ROXML_CMT_NODE 0x040
95 
102 #define ROXML_PI_NODE 0x080
103 
110 #define ROXML_NS_NODE 0x100
111 
118 #define ROXML_NSDEF_NODE (ROXML_NS_NODE | ROXML_ATTR_NODE)
119 
126 #define ROXML_CDATA_NODE (ROXML_TXT_NODE | 0x200)
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 RELEASE_ALL (void*)-1
167 
196 #define RELEASE_LAST (void*)-2
197 
210 node_t *ROXML_API roxml_load_buf(char *buffer);
211 
223 node_t *ROXML_API roxml_load_doc(char *filename);
224 
236 
249 void ROXML_API roxml_close(node_t *n);
250 
259 
268 
277 
321 
375 
394 
443 node_t *ROXML_API roxml_get_cmt(node_t *n, int nth);
444 
455 
497 node_t *ROXML_API roxml_get_chld(node_t *n, char *name, int nth);
498 
507 
556 node_t *ROXML_API roxml_get_pi(node_t *n, int nth);
557 
568 
591 char *ROXML_API roxml_get_name(node_t *n, char *buffer, int size);
592 
617 char *ROXML_API roxml_get_content(node_t *n, char *buffer, int bufsize, int *size);
618 
680 int ROXML_API roxml_get_nodes_nb(node_t *n, int type);
681 
701 node_t *ROXML_API roxml_get_nodes(node_t *n, int type, char *name, int nth);
702 
712 
752 node_t *ROXML_API roxml_get_attr(node_t *n, char *name, int nth);
753 
766 node_t **ROXML_API roxml_xpath(node_t *n, char *path, int *nb_ans);
767 
777 
786 
802 void ROXML_API roxml_release(void *data);
803 
906 node_t *ROXML_API roxml_add_node(node_t *parent, int position, int type, char *name, char *value);
907 
961 node_t *ROXML_API roxml_get_txt(node_t *n, int nth);
962 
973 
988 
1083 int ROXML_API roxml_commit_changes(node_t *n, char *dest, char **buffer, int human);
1084 
1085 #endif /* ROXML_H */
int ROXML_API roxml_get_txt_nb(node_t *n)
text node number getter function
Definition: roxml.c:519
void ROXML_API roxml_close(node_t *n)
unload function
Definition: roxml.c:341
node_t structure
Definition: roxml-types.h:152
int ROXML_API roxml_get_nodes_nb(node_t *n, int type)
number of nodes getter function
Definition: roxml.c:359
node_t ROXML_API * roxml_get_txt(node_t *n, int nth)
text node getter function
Definition: roxml.c:524
node_t ROXML_API * roxml_get_ns(node_t *n)
namespace getter function
Definition: roxml.c:494
node_t ROXML_API * roxml_get_parent(node_t *n)
parent getter function
Definition: roxml.c:577
node_t ROXML_API * roxml_get_attr(node_t *n, char *name, int nth)
attribute getter function
Definition: roxml.c:534
node_t ROXML_API * roxml_get_nodes(node_t *n, int type, char *name, int nth)
nodes getter function
Definition: roxml.c:385
int ROXML_API roxml_get_chld_nb(node_t *n)
chlds number getter function
Definition: roxml.c:539
int ROXML_API roxml_get_attr_nb(node_t *n)
number of attribute getter function
Definition: roxml.c:529
node_t ROXML_API * roxml_load_doc(char *filename)
load function for files
Definition: roxml.c:656
node_t ROXML_API * roxml_get_chld(node_t *n, char *name, int nth)
chld getter function
Definition: roxml.c:544
node_t ROXML_API * roxml_get_pi(node_t *n, int nth)
process-instruction getter function
Definition: roxml.c:504
node_t ROXML_API * roxml_get_prev_sibling(node_t *n)
prev sibling getter function
Definition: roxml.c:549
#define ROXML_API
Definition: roxml.h:39
void ROXML_API roxml_del_node(node_t *n)
node deletion function
Definition: roxml.c:723
node_t ROXML_API * roxml_add_node(node_t *parent, int position, int type, char *name, char *value)
add a node to the tree
Definition: roxml.c:791
int ROXML_API roxml_get_type(node_t *n)
node type function
Definition: roxml.c:601
int ROXML_API roxml_commit_changes(node_t *n, char *dest, char **buffer, int human)
sync function
Definition: roxml.c:741
node_t ROXML_API * roxml_load_fd(int fd)
load function for file descriptors
Definition: roxml.c:640
int ROXML_API roxml_get_node_position(node_t *n)
node get position function
Definition: roxml.c:609
char ROXML_API * roxml_get_content(node_t *n, char *buffer, int bufsize, int *size)
content getter function
Definition: roxml.c:123
node_t ROXML_API * roxml_set_ns(node_t *n, node_t *ns)
namespace setter function
Definition: roxml.c:457
void ROXML_API roxml_release(void *data)
memory cleanning function
Definition: roxml.c:28
node_t ROXML_API * roxml_load_buf(char *buffer)
load function for buffers
Definition: roxml.c:668
node_t ROXML_API * roxml_get_root(node_t *n)
root getter function
Definition: roxml.c:589
int ROXML_API roxml_get_cmt_nb(node_t *n)
comments number getter function
Definition: roxml.c:509
char ROXML_API * roxml_get_name(node_t *n, char *buffer, int size)
name getter function
Definition: roxml.c:228
node_t ROXML_API * roxml_get_cmt(node_t *n, int nth)
comment getter function
Definition: roxml.c:514
node_t ROXML_API ** roxml_xpath(node_t *n, char *path, int *nb_ans)
exec path function
Definition: roxml.c:679
int ROXML_API roxml_get_pi_nb(node_t *n)
process-instruction number getter function
Definition: roxml.c:499
node_t ROXML_API * roxml_get_next_sibling(node_t *n)
next sibling getter function
Definition: roxml.c:566