10 #ifndef PCMK__CRM_COMMON_XML__H 11 #define PCMK__CRM_COMMON_XML__H 15 #include <sys/types.h> 22 #include <libxml/tree.h> 23 #include <libxml/xpath.h> 49 xmlNode *
get_xpath_object(
const char *xpath, xmlNode * xml_obj,
int error_level);
74 void (*helper)(xmlNode*,
void*),
void *user_data);
81 static inline int numXpathResults(xmlXPathObjectPtr xpathObj)
83 if(xpathObj == NULL || xpathObj->nodesetval == NULL) {
86 return xpathObj->nodesetval->nodeNr;
91 void xml_track_changes(xmlNode * xml,
const char *user, xmlNode *acl_source,
bool enforce_acls);
98 int format, xmlNode *source, xmlNode *
target,
bool *config,
bool manage_version);
104 void crm_xml_set_id(xmlNode *xml,
const char *format, ...) G_GNUC_PRINTF(2, 3);
106 #if !defined(PCMK_ALLOW_DEPRECATED) || (PCMK_ALLOW_DEPRECATED == 1)
void crm_xml_cleanup(void)
void xml_track_changes(xmlNode *xml, const char *user, xmlNode *acl_source, bool enforce_acls)
void crm_xml_init(void)
Initialize the CRM XML subsystem.
void xml_accept_changes(xmlNode *xml)
Wrappers for and extensions to XML input/output functions.
void dedupXpathResults(xmlXPathObjectPtr xpathObj)
xmlNode * get_xpath_object(const char *xpath, xmlNode *xml_obj, int error_level)
Deprecated Pacemaker XML API.
void crm_xml_sanitize_id(char *id)
Sanitize a string so it is usable as an XML ID.
bool xml_tracking_changes(xmlNode *xml)
char * calculate_operation_digest(xmlNode *local_cib, const char *version)
Calculate and return digest of XML operation.
void pcmk_free_xml_subtree(xmlNode *xml)
int xml_apply_patchset(xmlNode *xml, xmlNode *patchset, bool check_version)
void crm_xml_set_id(xmlNode *xml, const char *format,...) G_GNUC_PRINTF(2
xmlNode * expand_idref(xmlNode *input, xmlNode *top)
bool xml_document_dirty(xmlNode *xml)
void free_xml(xmlNode *child)
char * calculate_on_disk_digest(xmlNode *local_cib)
Calculate and return digest of XML tree, suitable for storing on disk.
xmlNode * sorted_xml(xmlNode *input, xmlNode *parent, gboolean recursive)
void patchset_process_digest(xmlNode *patch, xmlNode *source, xmlNode *target, bool with_digest)
const xmlChar * pcmkXmlStr
Functionality for manipulating name/value pairs.
xmlXPathObjectPtr xpath_search(const xmlNode *xml_top, const char *path)
Defined string constants for XML element and attribute names.
xmlNode * getXpathResult(xmlXPathObjectPtr xpathObj, int index)
char * calculate_xml_versioned_digest(xmlNode *input, gboolean sort, gboolean do_filter, const char *version)
Calculate and return digest of XML tree.
void crm_foreach_xpath_result(xmlNode *xml, const char *xpath, void(*helper)(xmlNode *, void *), void *user_data)
Run a supplied function for each result of an xpath search.
bool xml_patch_versions(const xmlNode *patchset, int add[3], int del[3])
void xml_calculate_significant_changes(xmlNode *old_xml, xmlNode *new_xml)
void freeXpathObject(xmlXPathObjectPtr xpathObj)
xmlNode * xml_create_patchset(int format, xmlNode *source, xmlNode *target, bool *config, bool manage_version)
void xml_calculate_changes(xmlNode *old_xml, xmlNode *new_xml)