 |
pacemaker
2.0.1-9e909a5bdd
Scalable High-Availability cluster resource manager
|
Go to the documentation of this file.
8 #ifndef CRM_COMMON_NVPAIR__H
9 # define CRM_COMMON_NVPAIR__H
21 # include <sys/time.h>
23 # include <libxml/tree.h>
38 const char *name,
const char *value);
39 void hash2nvpair(gpointer key, gpointer value, gpointer user_data);
40 void hash2field(gpointer key, gpointer value, gpointer user_data);
41 void hash2metafield(gpointer key, gpointer value, gpointer user_data);
43 GHashTable *
xml2list(xmlNode *parent);
45 const char *
crm_xml_add(xmlNode *node,
const char *name,
const char *value);
46 const char *
crm_xml_replace(xmlNode *node,
const char *name,
const char *value);
47 const char *
crm_xml_add_int(xmlNode *node,
const char *name,
int value);
48 const char *
crm_xml_add_ms(xmlNode *node,
const char *name, guint ms);
54 const char *name_usec,
struct timeval *dest);
66 static inline const char *
67 crm_copy_xml_element(xmlNode *obj1, xmlNode *obj2,
const char *element)
87 static inline const char *
88 crm_xml_add_boolean(xmlNode *node,
const char *name, gboolean value)
90 return crm_xml_add(node, name, (value?
"true" :
"false"));
97 #endif // CRM_COMMON_NVPAIR__H
int crm_element_value_timeval(const xmlNode *data, const char *name_sec, const char *name_usec, struct timeval *dest)
Retrieve the value of XML second/microsecond attributes as time.
int crm_element_value_int(const xmlNode *data, const char *name, int *dest)
Retrieve the integer value of an XML attribute.
void hash2nvpair(gpointer key, gpointer value, gpointer user_data)
Add XML nvpair element based on hash table entry.
int crm_element_value_ms(const xmlNode *data, const char *name, guint *dest)
Retrieve the millisecond value of an XML attribute.
const char * crm_xml_replace(xmlNode *node, const char *name, const char *value)
Replace an XML attribute with specified name and (possibly NULL) value.
void hash2metafield(gpointer key, gpointer value, gpointer user_data)
Set XML attribute based on hash table entry, as meta-attribute name.
void pcmk_nvpairs2xml_attrs(GSList *list, xmlNode *xml)
Add XML attributes based on a list of name/value pairs.
xmlNode * crm_create_nvpair_xml(xmlNode *parent, const char *id, const char *name, const char *value)
Create an XML name/value pair.
void hash2smartfield(gpointer key, gpointer value, gpointer user_data)
Add hash table entry to XML as (possibly legacy) name/value.
struct pcmk_nvpair_s pcmk_nvpair_t
const char * crm_xml_add(xmlNode *node, const char *name, const char *value)
Create an XML attribute with specified name and value.
const char * crm_element_value(const xmlNode *data, const char *name)
Retrieve the value of an XML attribute.
GSList * pcmk_sort_nvpairs(GSList *list)
Sort a list of name/value pairs.
const char * crm_xml_add_int(xmlNode *node, const char *name, int value)
Create an XML attribute with specified name and integer value.
char * crm_element_value_copy(const xmlNode *data, const char *name)
Retrieve a copy of the value of an XML attribute.
void hash2field(gpointer key, gpointer value, gpointer user_data)
Set XML attribute based on hash table entry.
void pcmk_free_nvpairs(GSList *nvpairs)
Free a list of name/value pairs.
GSList * pcmk_xml_attrs2nvpairs(xmlNode *xml)
Create a list of name/value pairs from an XML node's attributes.
const char * crm_xml_add_ms(xmlNode *node, const char *name, guint ms)
Create an XML attribute with specified name and unsigned value.
GHashTable * xml2list(xmlNode *parent)
Retrieve XML attributes as a hash table.
GSList * pcmk_prepend_nvpair(GSList *nvpairs, const char *name, const char *value)
Prepend a name/value pair to a list.