|
Home --> Documentations --> PJLIB-UTIL Reference
xml.hGo to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __PJ_XML_H__
00021 #define __PJ_XML_H__
00022
00028 #include <pj/types.h>
00029 #include <pj/list.h>
00030
00031 PJ_BEGIN_DECL
00032
00040 typedef struct pj_xml_attr pj_xml_attr;
00041
00043 typedef struct pj_xml_node pj_xml_node;
00044
00046 struct pj_xml_attr
00047 {
00048 PJ_DECL_LIST_MEMBER(pj_xml_attr);
00049 pj_str_t name;
00050 pj_str_t value;
00051 };
00052
00055 typedef struct pj_xml_node_head
00056 {
00057 PJ_DECL_LIST_MEMBER(pj_xml_node);
00058 } pj_xml_node_head;
00059
00061 struct pj_xml_node
00062 {
00063 PJ_DECL_LIST_MEMBER(pj_xml_node);
00064 pj_str_t name;
00065 pj_xml_attr attr_head;
00066 pj_xml_node_head node_head;
00067 pj_str_t content;
00068 };
00069
00082 PJ_DECL(pj_xml_node*) pj_xml_parse( pj_pool_t *pool, char *msg, pj_size_t len);
00083
00084
00097 PJ_DECL(int) pj_xml_print( const pj_xml_node *node, char *buf, pj_size_t len,
00098 pj_bool_t prolog);
00099
00108 PJ_DECL(pj_xml_node*) pj_xml_clone( pj_pool_t *pool, const pj_xml_node *rhs);
00109
00110
00119 PJ_DECL(pj_xml_node*) pj_xml_node_new(pj_pool_t *pool, const pj_str_t *name);
00120
00121
00131 PJ_DECL(pj_xml_attr*) pj_xml_attr_new(pj_pool_t *pool, const pj_str_t *name,
00132 const pj_str_t *value);
00133
00140 PJ_DECL(void) pj_xml_add_node( pj_xml_node *parent, pj_xml_node *node );
00141
00142
00149 PJ_DECL(void) pj_xml_add_attr( pj_xml_node *node, pj_xml_attr *attr );
00150
00159 PJ_DECL(pj_xml_node*) pj_xml_find_node(const pj_xml_node *parent,
00160 const pj_str_t *name);
00161
00171 PJ_DECL(pj_xml_node*) pj_xml_find_next_node(const pj_xml_node *parent,
00172 const pj_xml_node *node,
00173 const pj_str_t *name);
00174
00184 PJ_DECL(pj_xml_node*) pj_xml_find_node_rec(const pj_xml_node *parent,
00185 const pj_str_t *name);
00186
00187
00198 PJ_DECL(pj_xml_attr*) pj_xml_find_attr(const pj_xml_node *node,
00199 const pj_str_t *name,
00200 const pj_str_t *value);
00201
00202
00214 PJ_DECL(pj_xml_node*) pj_xml_find( const pj_xml_node *parent,
00215 const pj_str_t *name,
00216 const void *data,
00217 pj_bool_t (*match)(const pj_xml_node *,
00218 const void*));
00219
00220
00233 PJ_DECL(pj_xml_node*) pj_xml_find_rec(const pj_xml_node *parent,
00234 const pj_str_t *name,
00235 const void *data,
00236 pj_bool_t (*match)(const pj_xml_node*,
00237 const void*));
00238
00239
00244 PJ_END_DECL
00245
00246 #endif
PJLIB-UTIL Open Source, small footprint, and portable asynchronous/caching DNS resolver, text scanner, STUN client, and XML library
Copyright (C) 2006-2009 Teluu Inc.
|