This source file includes following definitions.
- crm_xml_add_boolean
- crm_element_name
1
2
3
4
5
6
7
8
9
10 #ifndef PCMK__CRM_COMMON_XML_COMPAT__H
11 # define PCMK__CRM_COMMON_XML_COMPAT__H
12
13 #include <glib.h>
14 #include <libxml/tree.h>
15 #include <crm/common/xml.h>
16
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20
21
22
23
24
25
26
27
28
29
30
31 #define XML_PARANOIA_CHECKS 0
32
33
34 xmlDoc *getDocPtr(xmlNode *node);
35
36
37 int add_node_nocopy(xmlNode * parent, const char *name, xmlNode * child);
38
39
40 xmlNode *find_entity(xmlNode *parent, const char *node_name, const char *id);
41
42
43 char *xml_get_path(const xmlNode *xml);
44
45
46 void xml_log_changes(uint8_t level, const char *function, const xmlNode *xml);
47
48
49 void xml_log_patchset(uint8_t level, const char *function, const xmlNode *xml);
50
51
52 gboolean apply_xml_diff(xmlNode *old_xml, xmlNode *diff, xmlNode **new_xml);
53
54
55 void crm_destroy_xml(gpointer data);
56
57
58 gboolean xml_has_children(const xmlNode *root);
59
60
61 static inline const char *
62 crm_xml_add_boolean(xmlNode *node, const char *name, gboolean value)
63 {
64 return crm_xml_add(node, name, (value? "true" : "false"));
65 }
66
67
68 static inline const char *
69 crm_element_name(const xmlNode *xml)
70 {
71 return (xml == NULL)? NULL : (const char *) xml->name;
72 }
73
74 #ifdef __cplusplus
75 }
76 #endif
77
78 #endif