BLOG | DOCUMENTATION | GITHUB

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

xml.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
3 * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19#ifndef __PJ_XML_H__
20#define __PJ_XML_H__
21
27#include <pj/types.h>
28#include <pj/list.h>
29
31
39typedef struct pj_xml_attr pj_xml_attr;
40
42typedef struct pj_xml_node pj_xml_node;
43
46{
50};
51
54typedef struct pj_xml_node_head
55{
58
61{
67};
68
84PJ_DECL(pj_xml_node*) pj_xml_parse( pj_pool_t *pool, char *msg, pj_size_t len);
85
86
99PJ_DECL(int) pj_xml_print( const pj_xml_node *node, char *buf, pj_size_t len,
100 pj_bool_t prolog);
101
110PJ_DECL(pj_xml_node*) pj_xml_clone( pj_pool_t *pool, const pj_xml_node *rhs);
111
112
121PJ_DECL(pj_xml_node*) pj_xml_node_new(pj_pool_t *pool, const pj_str_t *name);
122
123
133PJ_DECL(pj_xml_attr*) pj_xml_attr_new(pj_pool_t *pool, const pj_str_t *name,
134 const pj_str_t *value);
135
142PJ_DECL(void) pj_xml_add_node( pj_xml_node *parent, pj_xml_node *node );
143
144
151PJ_DECL(void) pj_xml_add_attr( pj_xml_node *node, pj_xml_attr *attr );
152
161PJ_DECL(pj_xml_node*) pj_xml_find_node(const pj_xml_node *parent,
162 const pj_str_t *name);
163
174 const pj_xml_node *node,
175 const pj_str_t *name);
176
187 const pj_str_t *name);
188
189
201 const pj_str_t *name,
202 const pj_str_t *value);
203
204
216PJ_DECL(pj_xml_node*) pj_xml_find( const pj_xml_node *parent,
217 const pj_str_t *name,
218 const void *data,
219 pj_bool_t (*match)(const pj_xml_node *,
220 const void*));
221
222
235PJ_DECL(pj_xml_node*) pj_xml_find_rec(const pj_xml_node *parent,
236 const pj_str_t *name,
237 const void *data,
238 pj_bool_t (*match)(const pj_xml_node*,
239 const void*));
240
241
247
248#endif /* __PJ_XML_H__ */
int pj_bool_t
size_t pj_size_t
pj_xml_node * pj_xml_clone(pj_pool_t *pool, const pj_xml_node *rhs)
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_xml_node * pj_xml_node_new(pj_pool_t *pool, 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_find_next_node(const pj_xml_node *parent, const pj_xml_node *node, const pj_str_t *name)
int pj_xml_print(const pj_xml_node *node, char *buf, pj_size_t len, pj_bool_t prolog)
void pj_xml_add_attr(pj_xml_node *node, pj_xml_attr *attr)
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 *))
pj_xml_node * pj_xml_parse(pj_pool_t *pool, char *msg, pj_size_t len)
void pj_xml_add_node(pj_xml_node *parent, pj_xml_node *node)
pj_xml_attr * pj_xml_find_attr(const pj_xml_node *node, const pj_str_t *name, const pj_str_t *value)
pj_xml_node * pj_xml_find_node(const pj_xml_node *parent, const pj_str_t *name)
pj_xml_attr * pj_xml_attr_new(pj_pool_t *pool, const pj_str_t *name, const pj_str_t *value)
#define PJ_BEGIN_DECL
#define PJ_END_DECL
Definition: xml.h:46
PJ_DECL_LIST_MEMBER(pj_xml_attr)
pj_str_t name
Definition: xml.h:48
pj_str_t value
Definition: xml.h:49
Definition: xml.h:55
PJ_DECL_LIST_MEMBER(pj_xml_node)
Definition: xml.h:61
PJ_DECL_LIST_MEMBER(pj_xml_node)
pj_str_t name
Definition: xml.h:63
pj_str_t content
Definition: xml.h:66
pj_xml_node_head node_head
Definition: xml.h:65
pj_xml_attr attr_head
Definition: xml.h:64

 


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.