pacemaker  3.0.0-d8340737c4
Scalable High-Availability cluster resource manager
xml_compat.h
Go to the documentation of this file.
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 
32 // NOTE: sbd (as of at least 1.5.2) uses this
34 static inline const char *
35 crm_element_name(const xmlNode *xml)
36 {
37  return (xml == NULL)? NULL : (const char *) xml->name;
38 }
39 
40 // NOTE: sbd (as of at least 1.5.2) uses this
42 xmlNode *copy_xml(xmlNode *src_node);
43 
44 // NOTE: sbd (as of at least 1.5.2) uses this
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
50 void crm_xml_init(void);
51 
53 void crm_xml_cleanup(void);
54 
56 void pcmk_free_xml_subtree(xmlNode *xml);
57 
58 // NOTE: sbd (as of at least 1.5.2) uses this
60 void free_xml(xmlNode *child);
61 
63 void crm_xml_sanitize_id(char *id);
64 
66 char *calculate_on_disk_digest(xmlNode *input);
67 
69 char *calculate_operation_digest(xmlNode *input, const char *version);
70 
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
void pcmk_free_xml_subtree(xmlNode *xml)
Definition: xml.c:1571
void crm_xml_cleanup(void)
Definition: xml.c:1565
void crm_xml_init(void)
Definition: xml.c:1559
char * calculate_xml_versioned_digest(xmlNode *input, gboolean sort, gboolean do_filter, const char *version)
Definition: digest.c:357
void free_xml(xmlNode *child)
Definition: xml.c:1577
void crm_xml_sanitize_id(char *id)
Definition: xml.c:1583
char * calculate_on_disk_digest(xmlNode *input)
Definition: digest.c:341
Functionality for manipulating name/value pairs.
Defined string constants for XML element and attribute names.
gboolean cli_config_update(xmlNode **xml, int *best_version, gboolean to_logs)
Definition: schemas.c:1485
xmlNode * input
char * calculate_operation_digest(xmlNode *input, const char *version)
Definition: digest.c:347
uint32_t version
Definition: remote.c:209
xmlNode * copy_xml(xmlNode *src_node)
Definition: xml.c:1545