1 /*
2 * Copyright 2004-2024 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
16 #include <crm/common/nvpair.h> // crm_xml_add()
17 #include <crm/common/xml_names.h> // PCMK_XE_CLONE
18
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22
23 /**
24 * \file
25 * \brief Deprecated Pacemaker XML API
26 * \ingroup core
27 * \deprecated Do not include this header directly. The XML APIs in this
28 * header, and the header itself, will be removed in a future
29 * release.
30 */
31
32 // NOTE: sbd (as of at least 1.5.2) uses this
33 //! \deprecated Use name member directly
34 static inline const char *
35 crm_element_name(const xmlNode *xml)
/* ![[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)
*/
36 {
37 return (xml == NULL)? NULL : (const char *) xml->name;
38 }
39
40 // NOTE: sbd (as of at least 1.5.2) uses this
41 //! \deprecated Do not use Pacemaker for general-purpose XML manipulation
42 xmlNode *copy_xml(xmlNode *src_node);
43
44 // NOTE: sbd (as of at least 1.5.2) uses this
45 //! \deprecated Do not use
46 gboolean cli_config_update(xmlNode **xml, int *best_version, gboolean to_logs);
47
48 // NOTE: sbd (as of at least 1.5.2) uses this
49 //! \deprecated Call \c crm_log_init() or \c crm_log_cli_init() instead
50 void crm_xml_init(void);
51
52 //! \deprecated Exit with \c crm_exit() instead
53 void crm_xml_cleanup(void);
54
55 //! \deprecated Do not use Pacemaker for general-purpose XML manipulation
56 void pcmk_free_xml_subtree(xmlNode *xml);
57
58 // NOTE: sbd (as of at least 1.5.2) uses this
59 //! \deprecated Do not use Pacemaker for general-purpose XML manipulation
60 void free_xml(xmlNode *child);
61
62 //! \deprecated Do not use Pacemaker for general-purpose XML manipulation
63 void crm_xml_sanitize_id(char *id);
64
65 //! \deprecated Do not use
66 char *calculate_on_disk_digest(xmlNode *input);
67
68 //! \deprecated Do not use
69 char *calculate_operation_digest(xmlNode *input, const char *version);
70
71 //! \deprecated Do not use
72 char *calculate_xml_versioned_digest(xmlNode *input, gboolean sort,
73 gboolean do_filter, const char *version);
74
75 #ifdef __cplusplus
76 }
77 #endif
78
79 #endif // PCMK__CRM_COMMON_XML_COMPAT__H