From b5a1af6f999820564ead4867b1e5d5574778ee56 Mon Sep 17 00:00:00 2001 From: Benny Prijono Date: Mon, 31 Oct 2005 21:02:30 +0000 Subject: initial import git-svn-id: http://svn.pjsip.org/repos/pjproject/main@1 74dad513-b988-da41-8d7b-12977e46ad98 --- pjlib/include/pj/xml.h | 155 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 155 insertions(+) create mode 100644 pjlib/include/pj/xml.h (limited to 'pjlib/include/pj/xml.h') diff --git a/pjlib/include/pj/xml.h b/pjlib/include/pj/xml.h new file mode 100644 index 00000000..6311448e --- /dev/null +++ b/pjlib/include/pj/xml.h @@ -0,0 +1,155 @@ +/* $Header: /pjproject-0.3/pjlib/include/pj/xml.h 4 10/14/05 12:26a Bennylp $ */ + +#ifndef __PJ_XML_H__ +#define __PJ_XML_H__ + +/** + * @file xml.h + * @brief PJLIB XML Parser/Helper. + */ + +#include +#include + +PJ_BEGIN_DECL + +/** + * @defgroup PJ_XML XML Parser/Helper. + * @ingroup PJ + * @{ + */ + +/** Typedef for XML attribute. */ +typedef struct pj_xml_attr pj_xml_attr; + +/** Typedef for XML nodes. */ +typedef struct pj_xml_node pj_xml_node; + +/** This structure declares XML attribute. */ +struct pj_xml_attr +{ + PJ_DECL_LIST_MEMBER(pj_xml_attr) + pj_str_t name; /**< Attribute name. */ + pj_str_t value; /**< Attribute value. */ +}; + +/** This structure describes XML node head inside XML node structure. + */ +typedef struct pj_xml_node_head +{ + PJ_DECL_LIST_MEMBER(pj_xml_node) +} pj_xml_node_head; + +/** This structure describes XML node. */ +struct pj_xml_node +{ + PJ_DECL_LIST_MEMBER(pj_xml_node) /** List @a prev and @a next member */ + pj_str_t name; /** Node name. */ + pj_xml_attr attr_head; /** Attribute list. */ + pj_xml_node_head node_head; /** Node list. */ + pj_str_t content; /** Node content. */ +}; + +/** + * Parse XML message into XML document with a single root node. The parser + * is capable of parsing XML processing instruction construct ("