CAEN Utility  2.0.2
Utilities for CAEN projects
CAENXMLParser.h
Go to the documentation of this file.
1 /******************************************************************************
2 *
3 * CAEN SpA - Software Division
4 * Via Vetraia, 11 - 55049 - Viareggio ITALY
5 * +39 0594 388 398 - www.caen.it
6 *
7 *******************************************************************************
8 *
9 * Copyright (C) 2019-2022 CAEN SpA
10 *
11 * This file is part of the CAEN Utility.
12 *
13 * The CAEN Utility is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU Lesser General Public
15 * License as published by the Free Software Foundation; either
16 * version 3 of the License, or (at your option) any later version.
17 *
18 * The CAEN Utility is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 * Lesser General Public License for more details.
22 *
23 * You should have received a copy of the GNU Lesser General Public
24 * License along with the CAEN Utility; if not, see
25 * https://www.gnu.org/licenses/.
26 *
27 * SPDX-License-Identifier: LGPL-3.0-or-later
28 *
29 ***************************************************************************/
37 #ifndef CAEN_INCLUDE_CAENXMLPARSER_H_
38 #define CAEN_INCLUDE_CAENXMLPARSER_H_
39 
40 #ifndef _NOUSEXML
41 
47 #ifdef __cplusplus
48 extern "C" {
49 #endif
50 
53 #include <CAENUtility.h>
54 
55 #include <libxml/xpath.h>
56 
65 
75 
82 
91 
100 
109 CAEN_UTILITY_DLLAPI xmlNodeSet * CAEN_UTILITY_API c_xml_getnodeset(c_xmlfile_t *file, const xmlChar *query);
110 
116 CAEN_UTILITY_DLLAPI void CAEN_UTILITY_API c_xml_freenodeset(xmlNodeSet *nodeset);
117 
127 CAEN_UTILITY_DLLAPI const char * CAEN_UTILITY_API c_xml_getattributevalue(const xmlNode *node, const char *attribute, bool warnEnable);
128 
138 
147 CAEN_UTILITY_DLLAPI xmlNode * CAEN_UTILITY_API c_xml_getnextelementfromname(xmlNode *node, const char *nodename);
148 
157 CAEN_UTILITY_DLLAPI xmlNode * CAEN_UTILITY_API c_getfirstsiblingelementfromname(xmlNode *node, const char *nodename);
158 
167 CAEN_UTILITY_DLLAPI xmlNode * CAEN_UTILITY_API c_xml_getfirstchildrenelementfromname(xmlNode *node, const char *nodename);
168 
177 CAEN_UTILITY_DLLAPI xmlNode * CAEN_UTILITY_API c_xml_getfirstdescendantelementfromname(xmlNode *node, const char *nodename);
178 
186 CAEN_UTILITY_DLLAPI int32_t CAEN_UTILITY_API c_xml_getcodefromnodechild(const xmlNode *node, double *code);
187 
195 CAEN_UTILITY_DLLAPI int32_t CAEN_UTILITY_API c_xml_getcodefromnode(const xmlNode *node, double *code);
196 
207 CAEN_UTILITY_DLLAPI int32_t CAEN_UTILITY_API c_xml_getcodefromcodename(const c_xmlfile_t *file, const char *__restrict category, const char *__restrict codename, double *code);
208 
219 CAEN_UTILITY_DLLAPI const char * CAEN_UTILITY_API c_xml_getattributevaluefromcodename(const c_xmlfile_t *file, const char *__restrict category, const char *__restrict codename, const char *__restrict attrname);
220 
231 
241 c_attribute_format(3, 4)
242 CAEN_UTILITY_DLLAPI int CAEN_UTILITY_API c_xml_snprintf(xmlChar *buf, int len, const char *msg, ...);
243 
251 CAEN_UTILITY_DLLAPI int CAEN_UTILITY_API c_xml_strlen(const xmlChar *str);
252 
260 
267 
268 #ifdef __cplusplus
269 }
270 #endif
271 
272 #endif // !_NOUSEXML
273 
274 #endif // CAEN_INCLUDE_CAENXMLPARSER_H_
int c_xml_snprintf(xmlChar *buf, int len, const char *msg,...)
const char * c_xml_getattributevalue(const xmlNode *node, const char *attribute, bool warnEnable)
#define CAEN_UTILITY_API
Definition: CAENUtility.h:104
void c_xml_freefile(c_xmlfile_t *file)
xmlNode * c_xml_getfirstdescendantelementfromname(xmlNode *node, const char *nodename)
Main header and generic tools.
A wrapper to xmlDoc.
Definitions and types for CAENMultiplatform.h.
void * c_fcnhandle_t
void c_xml_freenodeset(xmlNodeSet *nodeset)
int c_xml_strlen(const xmlChar *str)
#define c_attribute_format(_FMT_, _ARGS_)
Definition: CAENUtility.h:173
#define c_attribute_nonnull(...)
Definition: CAENUtility.h:213
#define CAEN_UTILITY_DLLAPI
Definition: CAENUtility.h:105
int32_t c_xml_getcodefromnode(const xmlNode *node, double *code)
c_xmlfile_t * c_xml_newfile_from_memory(const char *buffer, int size)
Definition: CAENXMLParser.c:79
#define c_nodiscard
Definition: CAENUtility.h:245
#define c_attribute_malloc
Definition: CAENUtility.h:199
xmlNode * c_xml_getnextelementfromname(xmlNode *node, const char *nodename)
c_fcnhandle_t c_xml_getfunctionpointerfromcodename(const c_xmlfile_t *file, const char *codename)
xmlNode * c_xml_getfirstchildrenelementfromname(xmlNode *node, const char *nodename)
const char * c_xml_parserversion(void)
int32_t c_xml_getcodefromcodename(const c_xmlfile_t *file, const char *__restrict category, const char *__restrict codename, double *code)
const char * c_xml_getattributevaluefromcodename(const c_xmlfile_t *file, const char *__restrict category, const char *__restrict codename, const char *__restrict attrname)
xmlNode * c_xml_getrootnode(const c_xmlfile_t *file)
void c_xml_parsercleanup(void)
xmlNode * c_getfirstsiblingelementfromname(xmlNode *node, const char *nodename)
xmlNode * c_xml_getfirstnodefromxpathquery(c_xmlfile_t *file, const xmlChar *query)
Definitions and types for CAENXMLParser.h.
xmlNodeSet * c_xml_getnodeset(c_xmlfile_t *file, const xmlChar *query)
c_xmlfile_t * c_xml_newfile(const char *filename)
Definition: CAENXMLParser.c:54
int32_t c_xml_getcodefromnodechild(const xmlNode *node, double *code)
const char * c_xml_getpath(const c_xmlfile_t *file)