1 #ifndef ACL_XML_INCLUDE_H 2 #define ACL_XML_INCLUDE_H 8 #include "../stdlib/acl_array.h" 9 #include "../stdlib/acl_ring.h" 10 #include "../stdlib/acl_vstream.h" 11 #include "../stdlib/acl_htable.h" 12 #include "../stdlib/acl_vstring.h" 13 #include "../stdlib/acl_iterator.h" 14 #include "../stdlib/acl_dbuf_pool.h" 51 #define ACL_XML_F_META_QM (1 << 0) 52 #define ACL_XML_F_META_CM (1 << 1) 53 #define ACL_XML_F_META_EM (1 << 2) 54 #define ACL_XML_F_SELF_CL (1 << 3) 55 #define ACL_XML_F_LEAF (1 << 4) 56 #define ACL_XML_F_CDATA (1 << 5) 59 #define ACL_XML_F_META \ 60 (ACL_XML_F_META_QM | ACL_XML_F_META_CM | ACL_XML_F_META_EM) 62 #define ACL_XML_IS_COMMENT(x) (((x)->flag & ACL_XML_F_META_CM)) 64 #define ACL_XML_IS_CDATA(x) (((x)->flag & ACL_XML_F_CDATA)) 67 #define ACL_XML_S_NXT 0 68 #define ACL_XML_S_LLT 1 69 #define ACL_XML_S_LGT 2 70 #define ACL_XML_S_LCH 3 71 #define ACL_XML_S_LEM 4 72 #define ACL_XML_S_LTAG 5 73 #define ACL_XML_S_RLT 6 74 #define ACL_XML_S_RGT 7 75 #define ACL_XML_S_RTAG 8 76 #define ACL_XML_S_ATTR 9 77 #define ACL_XML_S_AVAL 10 78 #define ACL_XML_S_TXT 11 79 #define ACL_XML_S_MTAG 12 80 #define ACL_XML_S_MTXT 13 81 #define ACL_XML_S_MCMT 14 82 #define ACL_XML_S_MEND 15 83 #define ACL_XML_S_CDATA 16 116 #define ACL_XML_FLAG_MULTI_ROOT (1 << 0) 119 #define ACL_XML_FLAG_IGNORE_SLASH (1 << 1) 122 #define ACL_XML_FLAG_XML_DECODE (1 << 2) 125 #define ACL_XML_FLAG_XML_ENCODE (1 << 3) 258 #define acl_xml_parse acl_xml_update 308 ACL_XML *xml,
const char *tag);
318 ACL_XML *xml,
const char *tag);
351 const char *
name,
const char *value);
437 const char *
name,
const char *value);
448 const char* tagname,
const char* text);
461 const char *tag,
ACL_VSTREAM *in,
size_t off,
size_t len);
472 const char *
name,
const char *value);
ACL_API ACL_XML_ATTR * acl_xml_addElementAttr(ACL_XML_NODE *node, const char *name, const char *value)
ACL_API void acl_xml_decode_enable(ACL_XML *xml, int on)
ACL_API int acl_xml_removeElementAttr(ACL_XML_NODE *node, const char *name)
ACL_API void acl_xml_dump(ACL_XML *xml, ACL_VSTREAM *fp)
ACL_API void acl_xml_dump2(ACL_XML *xml, ACL_VSTRING *buf)
HTTP_API void const char * name
ACL_API ACL_XML_NODE * acl_xml_node_parent(ACL_XML_NODE *node)
ACL_API void acl_xml_tag_init(void)
ACL_API ACL_XML_ATTR * acl_xml_getElementAttr(ACL_XML_NODE *node, const char *name)
ACL_DBUF_POOL * dbuf_inner
ACL_API void acl_xml_encode_enable(ACL_XML *xml, int on)
ACL_API void acl_xml_node_add_attrs(ACL_XML_NODE *node,...)
ACL_API void acl_xml_free_array(ACL_ARRAY *a)
ACL_API ACL_XML_NODE * acl_xml_create_node(ACL_XML *xml, const char *tagname, const char *text)
ACL_API ACL_ARRAY * acl_xml_getElementsByName(ACL_XML *xml, const char *value)
ACL_API int acl_xml_is_complete(ACL_XML *xml, const char *tag)
ACL_API ACL_XML_NODE * acl_xml_getElementById(ACL_XML *xml, const char *id)
ACL_API void acl_xml_node_set_text(ACL_XML_NODE *node, const char *text)
ACL_API ACL_VSTRING * acl_xml_build(ACL_XML *xml, ACL_VSTRING *buf)
ACL_API size_t acl_xml_space(ACL_XML *xml)
ACL_API ACL_XML * acl_xml_alloc(void)
ACL_API void acl_xml_multi_root(ACL_XML *xml, int on)
ACL_API const char * acl_xml_update(ACL_XML *xml, const char *data)
ACL_API const char * acl_xml_getElementAttrVal(ACL_XML_NODE *node, const char *name)
ACL_API int acl_xml_is_closure(ACL_XML *xml)
ACL_API ACL_XML_NODE * acl_xml_getFirstElementByTagName(ACL_XML *xml, const char *tag)
ACL_API ACL_XML_NODE * acl_xml_getElementMeta(ACL_XML *xml, const char *tag)
ACL_API void acl_xml_node_add_text(ACL_XML_NODE *node, const char *text)
ACL_API ACL_ARRAY * acl_xml_getElementsByTags(ACL_XML *xml, const char *tags)
ACL_API ACL_XML_ATTR * acl_xml_node_add_attr(ACL_XML_NODE *node, const char *name, const char *value)
ACL_API int acl_xml_tag_selfclosed(const char *tag)
ACL_API ACL_XML_NODE * acl_xml_node_alloc(ACL_XML *xml)
struct ACL_DBUF_POOL ACL_DBUF_POOL
ACL_API const char * acl_xml_getAttrValueById(ACL_XML *xml, const char *id)
ACL_API void acl_xml_slash(ACL_XML *xml, int ignore)
ACL_API ACL_ARRAY * acl_xml_getElementsByAttr(ACL_XML *xml, const char *name, const char *value)
ACL_API void acl_xml_space_clear(ACL_XML *xml)
ACL_API int acl_xml_tag_leaf(const char *tag)
ACL_API int acl_xml_free(ACL_XML *xml)
ACL_API void acl_xml_tag_add(const char *tag)
ACL_API void acl_xml_node_append(ACL_XML_NODE *node1, ACL_XML_NODE *node2)
ACL_API const char * acl_xml_getEncoding(ACL_XML *xml)
ACL_API void acl_xml_node_add_child(ACL_XML_NODE *parent, ACL_XML_NODE *child)
ACL_API void acl_xml_node_set_text_stream(ACL_XML_NODE *node, ACL_VSTREAM *fp, size_t off, size_t len)
ACL_API int acl_xml_node_delete(ACL_XML_NODE *node)
ACL_API ACL_XML_NODE * acl_xml_create_node_with_text_stream(ACL_XML *xml, const char *tag, ACL_VSTREAM *in, size_t off, size_t len)
ACL_API ACL_XML_ATTR * acl_xml_getAttrById(ACL_XML *xml, const char *id)
ACL_API ACL_XML * acl_xml_dbuf_alloc(ACL_DBUF_POOL *dbuf)
ACL_API void acl_xml_foreach_init(ACL_XML *xml, ACL_XML_NODE *node)
ACL_API ACL_XML_ATTR * acl_xml_attr_alloc(ACL_XML_NODE *node)
ACL_API ACL_ARRAY * acl_xml_getElementsByTagName(ACL_XML *xml, const char *tag)
ACL_API ACL_XML_NODE * acl_xml_node_next(ACL_XML_NODE *node)
ACL_API const char * acl_xml_getType(ACL_XML *xml)
ACL_API ACL_XML_NODE * acl_xml_node_prev(ACL_XML_NODE *node)
ACL_API void acl_xml_reset(ACL_XML *xml)