Home --> Documentations --> PJLIB-UTIL Reference

xml.h
Go to the documentation of this file.
1 /* $Id: xml.h 3553 2011-05-05 06:14:19Z nanang $ */
2 /*
3  * Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
4  * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19  */
20 #ifndef __PJ_XML_H__
21 #define __PJ_XML_H__
22 
28 #include <pj/types.h>
29 #include <pj/list.h>
30 
32 
40 typedef struct pj_xml_attr pj_xml_attr;
41 
43 typedef struct pj_xml_node pj_xml_node;
44 
47 {
51 };
52 
55 typedef struct pj_xml_node_head
56 {
59 
62 {
68 };
69 
82 PJ_DECL(pj_xml_node*) pj_xml_parse( pj_pool_t *pool, char *msg, pj_size_t len);
83 
84 
97 PJ_DECL(int) pj_xml_print( const pj_xml_node *node, char *buf, pj_size_t len,
98  pj_bool_t prolog);
99 
108 PJ_DECL(pj_xml_node*) pj_xml_clone( pj_pool_t *pool, const pj_xml_node *rhs);
109 
110 
119 PJ_DECL(pj_xml_node*) pj_xml_node_new(pj_pool_t *pool, const pj_str_t *name);
120 
121 
131 PJ_DECL(pj_xml_attr*) pj_xml_attr_new(pj_pool_t *pool, const pj_str_t *name,
132  const pj_str_t *value);
133 
140 PJ_DECL(void) pj_xml_add_node( pj_xml_node *parent, pj_xml_node *node );
141 
142 
149 PJ_DECL(void) pj_xml_add_attr( pj_xml_node *node, pj_xml_attr *attr );
150 
159 PJ_DECL(pj_xml_node*) pj_xml_find_node(const pj_xml_node *parent,
160  const pj_str_t *name);
161 
171 PJ_DECL(pj_xml_node*) pj_xml_find_next_node(const pj_xml_node *parent,
172  const pj_xml_node *node,
173  const pj_str_t *name);
174 
184 PJ_DECL(pj_xml_node*) pj_xml_find_node_rec(const pj_xml_node *parent,
185  const pj_str_t *name);
186 
187 
198 PJ_DECL(pj_xml_attr*) pj_xml_find_attr(const pj_xml_node *node,
199  const pj_str_t *name,
200  const pj_str_t *value);
201 
202 
214 PJ_DECL(pj_xml_node*) pj_xml_find( const pj_xml_node *parent,
215  const pj_str_t *name,
216  const void *data,
217  pj_bool_t (*match)(const pj_xml_node *,
218  const void*));
219 
220 
233 PJ_DECL(pj_xml_node*) pj_xml_find_rec(const pj_xml_node *parent,
234  const pj_str_t *name,
235  const void *data,
236  pj_bool_t (*match)(const pj_xml_node*,
237  const void*));
238 
239 
244 PJ_END_DECL
245 
246 #endif /* __PJ_XML_H__ */
pj_xml_node * pj_xml_clone(pj_pool_t *pool, const pj_xml_node *rhs)
pj_xml_node_head node_head
Definition: xml.h:66
int pj_bool_t
pj_xml_attr attr_head
Definition: xml.h:65
PJ_DECL_LIST_MEMBER(pj_xml_attr)
pj_str_t name
Definition: xml.h:49
Definition: xml.h:61
pj_xml_attr * pj_xml_attr_new(pj_pool_t *pool, const pj_str_t *name, const pj_str_t *value)
Definition: xml.h:46
pj_str_t name
Definition: xml.h:64
PJ_DECL_LIST_MEMBER(pj_xml_node)
pj_xml_node * pj_xml_find_next_node(const pj_xml_node *parent, const pj_xml_node *node, const pj_str_t *name)
pj_xml_node * pj_xml_find_node_rec(const pj_xml_node *parent, const pj_str_t *name)
pj_xml_node * pj_xml_node_new(pj_pool_t *pool, const pj_str_t *name)
pj_xml_attr * pj_xml_find_attr(const pj_xml_node *node, const pj_str_t *name, const pj_str_t *value)
#define PJ_BEGIN_DECL
void pj_xml_add_attr(pj_xml_node *node, pj_xml_attr *attr)
void pj_xml_add_node(pj_xml_node *parent, pj_xml_node *node)
Definition: xml.h:55
pj_xml_node * pj_xml_parse(pj_pool_t *pool, char *msg, pj_size_t len)
pj_xml_node * pj_xml_find(const pj_xml_node *parent, const pj_str_t *name, const void *data, pj_bool_t(*match)(const pj_xml_node *, const void *))
int pj_xml_print(const pj_xml_node *node, char *buf, pj_size_t len, pj_bool_t prolog)
pj_xml_node * pj_xml_find_rec(const pj_xml_node *parent, const pj_str_t *name, const void *data, pj_bool_t(*match)(const pj_xml_node *, const void *))
pj_str_t value
Definition: xml.h:50
pj_str_t content
Definition: xml.h:67
size_t pj_size_t
PJ_DECL_LIST_MEMBER(pj_xml_node)
pj_xml_node * pj_xml_find_node(const pj_xml_node *parent, const pj_str_t *name)

 


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.