|
GSList * | pcmk_prepend_nvpair (GSList *nvpairs, const char *name, const char *value) |
| Prepend a name/value pair to a list. More...
|
|
void | pcmk_free_nvpairs (GSList *nvpairs) |
| Free a list of name/value pairs. More...
|
|
GSList * | pcmk_sort_nvpairs (GSList *list) |
| Sort a list of name/value pairs. More...
|
|
GSList * | pcmk_xml_attrs2nvpairs (xmlNode *xml) |
| Create a list of name/value pairs from an XML node's attributes. More...
|
|
void | pcmk_nvpairs2xml_attrs (GSList *list, xmlNode *xml) |
| Add XML attributes based on a list of name/value pairs. More...
|
|
xmlNode * | crm_create_nvpair_xml (xmlNode *parent, const char *id, const char *name, const char *value) |
| Create an XML name/value pair. More...
|
|
void | hash2nvpair (gpointer key, gpointer value, gpointer user_data) |
| Add XML nvpair element based on hash table entry. More...
|
|
void | hash2field (gpointer key, gpointer value, gpointer user_data) |
| Set XML attribute based on hash table entry. More...
|
|
void | hash2metafield (gpointer key, gpointer value, gpointer user_data) |
| Set XML attribute based on hash table entry, as meta-attribute name. More...
|
|
void | hash2smartfield (gpointer key, gpointer value, gpointer user_data) |
| Add hash table entry to XML as (possibly legacy) name/value. More...
|
|
GHashTable * | xml2list (xmlNode *parent) |
| Retrieve XML attributes as a hash table. More...
|
|
const char * | crm_xml_add (xmlNode *node, const char *name, const char *value) |
| Create an XML attribute with specified name and value. More...
|
|
const char * | crm_xml_replace (xmlNode *node, const char *name, const char *value) |
| Replace an XML attribute with specified name and (possibly NULL) value. More...
|
|
const char * | crm_xml_add_int (xmlNode *node, const char *name, int value) |
| Create an XML attribute with specified name and integer value. More...
|
|
const char * | crm_xml_add_ms (xmlNode *node, const char *name, guint ms) |
| Create an XML attribute with specified name and unsigned value. More...
|
|
const char * | crm_element_value (const xmlNode *data, const char *name) |
| Retrieve the value of an XML attribute. More...
|
|
int | crm_element_value_int (const xmlNode *data, const char *name, int *dest) |
| Retrieve the integer value of an XML attribute. More...
|
|
int | crm_element_value_ms (const xmlNode *data, const char *name, guint *dest) |
| Retrieve the millisecond value of an XML attribute. More...
|
|
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. More...
|
|
char * | crm_element_value_copy (const xmlNode *data, const char *name) |
| Retrieve a copy of the value of an XML attribute. More...
|
|
Functionality for manipulating name/value pairs.
Definition in file nvpair.h.
void hash2metafield |
( |
gpointer |
key, |
|
|
gpointer |
value, |
|
|
gpointer |
user_data |
|
) |
| |
Set XML attribute based on hash table entry, as meta-attribute name.
Suitable for g_hash_table_foreach()
, this function takes a hash table key and value, with an XML node passed as user data, and adds an XML attribute with the meta-attribute version of the specified name and value if it does not already exist and if the name does not appear to be cluster-internal.
- Parameters
-
[in] | key | Key of hash table entry |
[in] | value | Value of hash table entry |
[in] | user_data | XML node |
Definition at line 579 of file nvpair.c.
void hash2smartfield |
( |
gpointer |
key, |
|
|
gpointer |
value, |
|
|
gpointer |
user_data |
|
) |
| |
Add hash table entry to XML as (possibly legacy) name/value.
Suitable for g_hash_table_foreach()
, this function takes a hash table key and value, with an XML node passed as user data, and adds an XML attribute with the specified name and value if it does not already exist. If the key name starts with a digit, this will instead add a <param name=NAME value=VALUE/> child to the XML (for legacy compatibility with heartbeat).
- Parameters
-
[in] | key | Key of hash table entry |
[in] | value | Value of hash table entry |
[in] | user_data | XML node |
Definition at line 517 of file nvpair.c.
GHashTable* xml2list |
( |
xmlNode * |
parent | ) |
|
Retrieve XML attributes as a hash table.
Given an XML element, this will look for any <attributes> element child, creating a hash table of (newly allocated string) name/value pairs taken first from the attributes element's NAME=VALUE XML attributes, and then from any <param name=NAME value=VALUE> children of attributes.
- Parameters
-
- Returns
- Hash table with name/value pairs
- Note
- It is the caller's responsibility to free the result using
g_hash_table_destroy()
.
Definition at line 677 of file nvpair.c.