BLOG | DOCUMENTATION | TRAC

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

xml.h
Go to the documentation of this file.
1 /* $Id$ */
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 
85 PJ_DECL(pj_xml_node*) pj_xml_parse( pj_pool_t *pool, char *msg, pj_size_t len);
86 
87 
100 PJ_DECL(int) pj_xml_print( const pj_xml_node *node, char *buf, pj_size_t len,
101  pj_bool_t prolog);
102 
111 PJ_DECL(pj_xml_node*) pj_xml_clone( pj_pool_t *pool, const pj_xml_node *rhs);
112 
113 
122 PJ_DECL(pj_xml_node*) pj_xml_node_new(pj_pool_t *pool, const pj_str_t *name);
123 
124 
134 PJ_DECL(pj_xml_attr*) pj_xml_attr_new(pj_pool_t *pool, const pj_str_t *name,
135  const pj_str_t *value);
136 
143 PJ_DECL(void) pj_xml_add_node( pj_xml_node *parent, pj_xml_node *node );
144 
145 
152 PJ_DECL(void) pj_xml_add_attr( pj_xml_node *node, pj_xml_attr *attr );
153 
162 PJ_DECL(pj_xml_node*) pj_xml_find_node(const pj_xml_node *parent,
163  const pj_str_t *name);
164 
174 PJ_DECL(pj_xml_node*) pj_xml_find_next_node(const pj_xml_node *parent,
175  const pj_xml_node *node,
176  const pj_str_t *name);
177 
187 PJ_DECL(pj_xml_node*) pj_xml_find_node_rec(const pj_xml_node *parent,
188  const pj_str_t *name);
189 
190 
201 PJ_DECL(pj_xml_attr*) pj_xml_find_attr(const pj_xml_node *node,
202  const pj_str_t *name,
203  const pj_str_t *value);
204 
205 
217 PJ_DECL(pj_xml_node*) pj_xml_find( const pj_xml_node *parent,
218  const pj_str_t *name,
219  const void *data,
220  pj_bool_t (*match)(const pj_xml_node *,
221  const void*));
222 
223 
236 PJ_DECL(pj_xml_node*) pj_xml_find_rec(const pj_xml_node *parent,
237  const pj_str_t *name,
238  const void *data,
239  pj_bool_t (*match)(const pj_xml_node*,
240  const void*));
241 
242 
248 
249 #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_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)
#define PJ_END_DECL
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_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.