10 #ifndef PCMK__CRM_COMMON_XML_COMPAT__H 11 #define PCMK__CRM_COMMON_XML_COMPAT__H 14 #include <libxml/tree.h> 32 #define XML_PARANOIA_CHECKS 0 48 void xml_log_changes(uint8_t level,
const char *
function,
const xmlNode *xml);
51 void xml_log_patchset(uint8_t level,
const char *
function,
const xmlNode *xml);
54 gboolean
apply_xml_diff(xmlNode *old_xml, xmlNode *diff, xmlNode **new_xml);
63 static inline const char *
64 crm_xml_add_boolean(xmlNode *node,
const char *
name, gboolean value)
71 static inline const char *
72 crm_element_name(
const xmlNode *xml)
74 return (xml == NULL)? NULL : (
const char *) xml->name;
82 xmlNode *
copy_xml(xmlNode *src_node);
85 xmlNode *
add_node_copy(xmlNode *new_parent, xmlNode *xml_node);
91 xmlNode *
diff_xml_object(xmlNode *left, xmlNode *right, gboolean suppress);
95 gboolean full, gboolean *changed,
106 const char *content);
110 const char *
id,
const char *class_name,
117 xmlNode *
find_xml_node(
const xmlNode *root,
const char *search_path,
128 gboolean delete_only);
135 const char *field,
const char *value,
136 gboolean search_matches);
146 gboolean
add_message_xml(xmlNode *msg,
const char *field, xmlNode *xml);
162 gboolean transform, gboolean to_logs);
165 gboolean
validate_xml(xmlNode *xml_blob,
const char *validation,
176 static inline const char *
177 crm_map_element_name(
const xmlNode *xml)
181 }
else if (strcmp((
const char *) xml->name,
"master") == 0) {
185 return (
const char *) xml->name;
199 #endif // PCMK__CRM_COMMON_XML_COMPAT__H void xml_log_changes(uint8_t level, const char *function, const xmlNode *xml)
xmlNode * get_message_xml(const xmlNode *msg, const char *field)
xmlNode * add_node_copy(xmlNode *new_parent, xmlNode *xml_node)
xmlNode * crm_next_same_xml(const xmlNode *sibling)
void purge_diff_markers(xmlNode *a_node)
gboolean xml_has_children(const xmlNode *root)
gboolean validate_xml_verbose(const xmlNode *xml_blob)
int get_schema_version(const char *name)
const char * crm_xml_add(xmlNode *node, const char *name, const char *value)
Create an XML attribute with specified name and value.
void crm_destroy_xml(gpointer data)
gboolean replace_xml_child(xmlNode *parent, xmlNode *child, xmlNode *update, gboolean delete_only)
void fix_plus_plus_recursive(xmlNode *target)
char * crm_xml_escape(const char *text)
gboolean can_prune_leaf(xmlNode *xml_node)
xmlNode * create_xml_node(xmlNode *parent, const char *name)
xmlNode * first_named_child(const xmlNode *parent, const char *name)
gboolean validate_xml(xmlNode *xml_blob, const char *validation, gboolean to_logs)
xmlNode * pcmk_create_xml_text_node(xmlNode *parent, const char *name, const char *content)
xmlNode * subtract_xml_object(xmlNode *parent, xmlNode *left, xmlNode *right, gboolean full, gboolean *changed, const char *marker)
xmlDoc * getDocPtr(xmlNode *node)
xmlNode * diff_xml_object(xmlNode *left, xmlNode *right, gboolean suppress)
int find_xml_children(xmlNode **children, xmlNode *root, const char *tag, const char *field, const char *value, gboolean search_matches)
gboolean apply_xml_diff(xmlNode *old_xml, xmlNode *diff, xmlNode **new_xml)
const char * get_schema_name(int version)
void copy_in_properties(xmlNode *target, const xmlNode *src)
xmlNode * get_xpath_object_relative(const char *xpath, xmlNode *xml_obj, int error_level)
Functionality for manipulating name/value pairs.
Defined string constants for XML element and attribute names.
int add_node_nocopy(xmlNode *parent, const char *name, xmlNode *child)
gboolean cli_config_update(xmlNode **xml, int *best_version, gboolean to_logs)
gboolean update_xml_child(xmlNode *child, xmlNode *to_update)
xmlNode * find_entity(xmlNode *parent, const char *node_name, const char *id)
void xml_log_patchset(uint8_t level, const char *function, const xmlNode *xml)
int update_validation(xmlNode **xml_blob, int *best, int max, gboolean transform, gboolean to_logs)
gboolean add_message_xml(xmlNode *msg, const char *field, xmlNode *xml)
char * xml_get_path(const xmlNode *xml)
Get an XPath string that matches an XML element as closely as possible.
xmlNode * find_xml_node(const xmlNode *root, const char *search_path, gboolean must_find)
void xml_remove_prop(xmlNode *obj, const char *name)
void expand_plus_plus(xmlNode *target, const char *name, const char *value)
xmlNode * pcmk_create_html_node(xmlNode *parent, const char *element_name, const char *id, const char *class_name, const char *text)
const char * xml_latest_schema(void)
xmlNode * copy_xml(xmlNode *src_node)