yumapro  20.10-12
YumaPro SDK
ycontrol_xml.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2008 - 2012, Andy Bierman, All Rights Reserved.
3  * Copyright (c) 2012 - 2021, YumaWorks, Inc., All Rights Reserved.
4  *
5  * Unless required by applicable law or agreed to in writing,
6  * software distributed under the License is distributed on an
7  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
8  * KIND, either express or implied. See the License for the
9  * specific language governing permissions and limitations
10  * under the License.
11  */
12 #ifndef _H_ycontrol_xml
13 #define _H_ycontrol_xml
14 /* FILE: ycontrol_xml.h
15 *********************************************************************
16 * *
17 * P U R P O S E *
18 * *
19 *********************************************************************/
20 
27 /*********************************************************************
28 * *
29 * C H A N G E H I S T O R Y *
30 * *
31 *********************************************************************
32 
33 date init comment
34 ----------------------------------------------------------------------
35 13-apr-14 abb begun; start from mgr_xml.c
36 */
37 
38 /* From /usr/include/libxml2/libxml/ */
39 #include <xmlreader.h>
40 #include <xmlstring.h>
41 
42 #ifndef _H_xml_util
43 #include "xml_util.h"
44 #endif
45 
46 #ifdef __cplusplus
47 extern "C" {
48 #endif
49 
50 /********************************************************************
51 * *
52 * C O N S T A N T S *
53 * *
54 *********************************************************************/
55 
56 /********************************************************************
57 * *
58 * T Y P E S *
59 * *
60 *********************************************************************/
61 
62 /********************************************************************
63 * *
64 * F U N C T I O N S *
65 * *
66 *********************************************************************/
67 
68 
69 
70 /* group defined in ycontrol_val_parse.h */
71 
72 
80 /**************** XMLTextReader APIs ******************/
81 
82 
134 extern status_t
135  ycontrol_xml_consume_node (xmlTextReaderPtr reader,
136  xml_node_t *node);
137 
138 
139 
156 extern status_t
157  ycontrol_xml_consume_node_nons (xmlTextReaderPtr reader,
158  xml_node_t *node);
159 
160 
161 
176 extern status_t
177  ycontrol_xml_consume_node_noadv (xmlTextReaderPtr reader,
178  xml_node_t *node);
179 
180 
197 extern status_t
198  ycontrol_xml_skip_subtree (xmlTextReaderPtr reader,
199  const xml_node_t *startnode);
200 
204 #ifdef __cplusplus
205 } /* end extern 'C' */
206 #endif
207 
208 #endif /* _H_ycontrol_xml */
xml_clean_node
void xml_clean_node(xml_node_t *node)
Clean an xml_node_t struct.
Definition: xml_util.c:266
xml_util.h
XML Utilities.
log_debug3
void void void void void void void void void void void log_debug3(const char *fstr,...) __attribute__((format(printf
Generate a new LOG_DEBUG_DEBUG3 log entry.
XML_NT_END
@ XML_NT_END
end-tag of an element
Definition: xml_util.h:193
ncxconst.h
Contains NCX constants.
xmlns_id_t
uint16 xmlns_id_t
integer handle for registered namespaces
Definition: xmlns.h:89
def_reg.h
Definition Registry module.
NO_ERR
@ NO_ERR
000
Definition: status_enum.h:188
xml_check_ns
status_t xml_check_ns(xmlTextReaderPtr reader, const xmlChar *elname, xmlns_id_t *id, uint32 *pfix_len, const xmlChar **badns)
Check a namespace during parsing.
Definition: xml_util.c:2248
ycontrol_xml_consume_node
status_t ycontrol_xml_consume_node(xmlTextReaderPtr reader, xml_node_t *node)
Consume an XML node from the XmlTextReader.
Definition: ycontrol_xml.c:130
XML_NT_STRING
@ XML_NT_STRING
string content node
Definition: xml_util.h:194
ERR_INTERNAL_VAL
@ ERR_INTERNAL_VAL
004
Definition: status_enum.h:194
ycontrol_xml.h
YControl XML parser APIs.
ERR_INTERNAL_PTR
@ ERR_INTERNAL_PTR
002
Definition: status_enum.h:192
xml_strcmp
int xml_strcmp(const xmlChar *s1, const xmlChar *s2)
String compare for xmlChar.
Definition: xml_util.c:1746
log.h
NCX System Logging Manager.
ERR_XML_READER_INTERNAL
@ ERR_XML_READER_INTERNAL
121
Definition: status_enum.h:233
XML_NT_START
@ XML_NT_START
start-tag of an element
Definition: xml_util.h:192
xml_get_node_name
const char * xml_get_node_name(int nodeval)
get the node type according to the xmlElementType enum list in /usr/include/libxml/libxml/tree....
Definition: xml_util.c:475
ERR_XML_READER_EOF
@ ERR_XML_READER_EOF
221
Definition: status_enum.h:260
ycontrol_xml_consume_node_noadv
status_t ycontrol_xml_consume_node_noadv(xmlTextReaderPtr reader, xml_node_t *node)
re-get the current node
Definition: ycontrol_xml.c:149
SET_ERROR
#define SET_ERROR(E)
macro SET_ERROR
Definition: status_enum.h:103
XML_NT_EMPTY
@ XML_NT_EMPTY
standalone empty node
Definition: xml_util.h:191
xml_init_node
void xml_init_node(xml_node_t *node)
Init an xml_node_t struct.
Definition: xml_util.c:229
ycontrol_xml_consume_node_nons
status_t ycontrol_xml_consume_node_nons(xmlTextReaderPtr reader, xml_node_t *node)
consume node but do not generate namespace errors if seen.
Definition: ycontrol_xml.c:139
xml_endnode_match
status_t xml_endnode_match(const xml_node_t *startnode, const xml_node_t *endnode)
check if a specific node is the proper endnode match for a given startnode
Definition: xml_util.c:592
xmlns.h
XML namespace support.
status.h
Global error messages for status code enumerations.
xml_consume_node
status_t xml_consume_node(xmlTextReaderPtr reader, xml_node_t *xmlnode, boolean nserr, boolean adv)
parse function for YIN input
Definition: xml_util.c:2447
ycontrol_xml_skip_subtree
status_t ycontrol_xml_skip_subtree(xmlTextReaderPtr reader, const xml_node_t *startnode)
Skip the current subtree (due to parse or schema error)
Definition: ycontrol_xml.c:176