1 /*
2 * Copyright 2004-2023 the Pacemaker project contributors
3 *
4 * The version control history for this file may have further details.
5 *
6 * This source code is licensed under the GNU Lesser General Public License
7 * version 2.1 or later (LGPLv2.1+) WITHOUT ANY WARRANTY.
8 */
9
10 #ifndef PCMK__CRM_COMMON_XML_COMPAT__H
11 # define PCMK__CRM_COMMON_XML_COMPAT__H
12
13 #include <glib.h> // gboolean
14 #include <libxml/tree.h> // xmlNode
15 #include <crm/common/xml.h> // crm_xml_add()
16
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20
21 /**
22 * \file
23 * \brief Deprecated Pacemaker XML API
24 * \ingroup core
25 * \deprecated Do not include this header directly. The XML APIs in this
26 * header, and the header itself, will be removed in a future
27 * release.
28 */
29
30 //! \deprecated Do not use (will be removed in a future release)
31 #define XML_PARANOIA_CHECKS 0
32
33 //! \deprecated This function will be removed in a future release
34 int add_node_nocopy(xmlNode * parent, const char *name, xmlNode * child);
35
36 //! \deprecated This function will be removed in a future release
37 xmlNode *find_entity(xmlNode *parent, const char *node_name, const char *id);
38
39 //! \deprecated This function will be removed in a future release
40 char *xml_get_path(const xmlNode *xml);
41
42 //! \deprecated This function will be removed in a future release
43 void xml_log_changes(uint8_t level, const char *function, const xmlNode *xml);
44
45 //! \deprecated This function will be removed in a future release
46 void xml_log_patchset(uint8_t level, const char *function, const xmlNode *xml);
47
48 //! \deprecated Use xml_apply_patchset() instead
49 gboolean apply_xml_diff(xmlNode *old_xml, xmlNode *diff, xmlNode **new_xml);
50
51 //! \deprecated Do not use (will be removed in a future release)
52 void crm_destroy_xml(gpointer data);
53
54 //! \deprecated Use crm_xml_add() with "true" or "false" instead
55 static inline const char *
56 crm_xml_add_boolean(xmlNode *node, const char *name, gboolean value)
/* ![[previous]](../icons/n_left.png)
![[next]](../icons/n_right.png)
![[first]](../icons/n_first.png)
![[last]](../icons/n_last.png)
![[top]](../icons/top.png)
![[bottom]](../icons/bottom.png)
![[index]](../icons/index.png)
*/
57 {
58 return crm_xml_add(node, name, (value? "true" : "false"));
59 }
60
61 #ifdef __cplusplus
62 }
63 #endif
64
65 #endif // PCMK__CRM_COMMON_XML_COMPAT__H