10 #ifndef PCMK__CRM_COMMON_XML_ELEMENT_INTERNAL__H 11 #define PCMK__CRM_COMMON_XML_ELEMENT_INTERNAL__H 23 #include <libxml/tree.h> 36 const char *attr_n,
const char *attr_v);
41 bool (*match)(xmlAttrPtr,
void *),
55 static inline const char *
56 pcmk__xe_id(
const xmlNode *xml)
71 pcmk__xe_is(
const xmlNode *xml,
const char *
name)
73 return (xml != NULL) && (xml->name != NULL) && (
name != NULL)
74 && (strcmp((
const char *) xml->name,
name) == 0);
78 xmlNode *
pcmk__xe_next(
const xmlNode *node,
const char *element_name);
115 G_GNUC_NULL_TERMINATED;
125 static inline xmlAttr *
126 pcmk__xe_first_attr(const xmlNode *xe)
128 return (xe == NULL)? NULL : xe->properties;
153 int (*handler)(xmlNode *xml,
void *userdata),
158 uint32_t default_value);
168 #endif // PCMK__CRM_COMMON_XML_ELEMENT_INTERNAL__H xmlNode * pcmk__xe_first_child(const xmlNode *parent, const char *node_name, const char *attr_n, const char *attr_v)
void pcmk__xe_set_bool_attr(xmlNodePtr node, const char *name, bool value)
struct crm_time_s crm_time_t
bool pcmk__xe_remove_attr_cb(xmlNode *xml, void *user_data)
void pcmk__xe_sort_attrs(xmlNode *xml)
int pcmk__xe_foreach_child(xmlNode *xml, const char *child_element_name, int(*handler)(xmlNode *xml, void *userdata), void *userdata)
int pcmk__xe_update_match(xmlNode *xml, xmlNode *update, uint32_t flags)
void pcmk__xe_remove_attr(xmlNode *element, const char *name)
bool pcmk__xe_attr_is_true(const xmlNode *node, const char *name)
xmlNode * pcmk__xe_create(xmlNode *parent, const char *name)
int pcmk__xe_delete_match(xmlNode *xml, xmlNode *search)
int pcmk__xe_get_bool_attr(const xmlNode *node, const char *name, bool *value)
int pcmk__xe_get_datetime(const xmlNode *xml, const char *attr, crm_time_t **t)
const char * crm_element_value(const xmlNode *data, const char *name)
Retrieve the value of an XML attribute.
void void pcmk__xe_set_propv(xmlNodePtr node, va_list pairs)
int pcmk__xe_get_flags(const xmlNode *xml, const char *name, uint32_t *dest, uint32_t default_value)
void pcmk__xe_set_content(xmlNode *node, const char *format,...) G_GNUC_PRINTF(2
const char * pcmk__xe_add_last_written(xmlNode *xe)
xmlNode * pcmk__xe_next(const xmlNode *node, const char *element_name)
void int pcmk__xe_get_score(const xmlNode *xml, const char *name, int *score, int default_score)
void pcmk__xe_set_props(xmlNodePtr node,...) G_GNUC_NULL_TERMINATED
Defined string constants for XML element and attribute names.
int pcmk__xe_copy_attrs(xmlNode *target, const xmlNode *src, uint32_t flags)
void pcmk__xe_set_id(xmlNode *xml, const char *format,...) G_GNUC_PRINTF(2
int pcmk__xe_replace_match(xmlNode *xml, xmlNode *replace)
Wrappers for and extensions to libxml2 for XML elements.
void pcmk__xe_remove_matching_attrs(xmlNode *element, bool(*match)(xmlAttrPtr, void *), void *user_data)