|
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...
|
|
int | pcmk__scan_nvpair (const char *input, char **name, char **value) |
|
char * | pcmk__format_nvpair (const char *name, const char *value, const char *units) |
|
void | hash2smartfield (gpointer key, gpointer value, gpointer user_data) |
| Safely add hash table entry to XML as attribute or name-value pair. 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...
|
|
xmlNode * | crm_create_nvpair_xml (xmlNode *parent, const char *id, const char *name, const char *value) |
| Create an XML name/value pair. More...
|
|
GHashTable * | xml2list (const xmlNode *parent) |
| Retrieve XML attributes as a hash table. More...
|
|
char * | crm_meta_name (const char *attr_name) |
| Get the environment variable equivalent of a meta-attribute name. More...
|
|
const char * | crm_meta_value (GHashTable *meta, const char *attr_name) |
| Get the value of a meta-attribute. More...
|
|
gint | pcmk__cmp_nvpair_blocks (gconstpointer a, gconstpointer b, gpointer user_data) |
|
GSList * | pcmk_sort_nvpairs (GSList *list) |
|
GSList * | pcmk_xml_attrs2nvpairs (const xmlNode *xml) |
|
void | pcmk_nvpairs2xml_attrs (GSList *list, xmlNode *xml) |
|
void | hash2nvpair (gpointer key, gpointer value, gpointer user_data) |
|
void hash2field |
( |
gpointer |
key, |
|
|
gpointer |
value, |
|
|
gpointer |
user_data |
|
) |
| |
Set XML attribute based on hash table entry.
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.
- Parameters
-
[in] | key | Key of hash table entry |
[in] | value | Value of hash table entry |
[in,out] | user_data | XML node |
Definition at line 249 of file nvpair.c.
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,out] | user_data | XML node |
Definition at line 277 of file nvpair.c.
void hash2smartfield |
( |
gpointer |
key, |
|
|
gpointer |
value, |
|
|
gpointer |
user_data |
|
) |
| |
Safely add hash table entry to XML as attribute or name-value pair.
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, then it's not a valid XML attribute name. In that case, this will instead add a
- Parameters
-
| NAME | child to the XML. |
[in] | key | Key of hash table entry |
[in] | value | Value of hash table entry |
[in,out] | user_data | XML node |
Definition at line 207 of file nvpair.c.
GHashTable* xml2list |
( |
const 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 350 of file nvpair.c.