pacemaker
3.0.0-d8340737c4
Scalable High-Availability cluster resource manager
|
Wrappers for and extensions to libxml2 for XML elements. More...
#include <sys/time.h>
#include <glib.h>
#include <libxml/tree.h>
#include <crm/common/xml_element_compat.h>
Go to the source code of this file.
Functions | |
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_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_ll (xmlNode *node, const char *name, long long value) |
Create an XML attribute with specified name and long long int 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_xml_add_timeval (xmlNode *xml, const char *name_sec, const char *name_usec, const struct timeval *value) |
Create XML attributes for seconds and microseconds. 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_ll (const xmlNode *data, const char *name, long long *dest) |
Retrieve the long long 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_epoch (const xmlNode *xml, const char *name, time_t *dest) |
Retrieve the seconds-since-epoch 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... | |
Wrappers for and extensions to libxml2 for XML elements.
Definition in file xml_element.h.
const char* crm_element_value | ( | const xmlNode * | data, |
const char * | name | ||
) |
Retrieve the value of an XML attribute.
[in] | data | XML node to check |
[in] | name | Attribute name to check |
NULL
) Definition at line 1168 of file xml_element.c.
char* crm_element_value_copy | ( | const xmlNode * | data, |
const char * | name | ||
) |
Retrieve a copy of the value of an XML attribute.
This is like crm_element_value()
but allocating new memory for the result.
[in] | data | XML node to check |
[in] | name | Attribute name to check |
NULL
) Definition at line 1466 of file xml_element.c.
int crm_element_value_epoch | ( | const xmlNode * | xml, |
const char * | name, | ||
time_t * | dest | ||
) |
Retrieve the seconds-since-epoch value of an XML attribute.
This is like crm_element_value()
but returning the value as a time_t.
[in] | xml | XML node to check |
[in] | name | Attribute name to check |
[out] | dest | Where to store attribute value |
pcmk_ok
on success, -1 otherwise Definition at line 1359 of file xml_element.c.
int crm_element_value_int | ( | const xmlNode * | data, |
const char * | name, | ||
int * | dest | ||
) |
Retrieve the integer value of an XML attribute.
This is like crm_element_value()
but getting the value as an integer.
[in] | data | XML node to check |
[in] | name | Attribute name to check |
[out] | dest | Where to store element value |
Definition at line 1201 of file xml_element.c.
int crm_element_value_ll | ( | const xmlNode * | data, |
const char * | name, | ||
long long * | dest | ||
) |
Retrieve the long long integer value of an XML attribute.
This is like crm_element_value()
but getting the value as a long long int.
[in] | data | XML node to check |
[in] | name | Attribute name to check |
[out] | dest | Where to store element value |
Definition at line 1291 of file xml_element.c.
int crm_element_value_ms | ( | const xmlNode * | data, |
const char * | name, | ||
guint * | dest | ||
) |
Retrieve the millisecond value of an XML attribute.
This is like crm_element_value()
but returning the value as a guint.
[in] | data | XML node to check |
[in] | name | Attribute name to check |
[out] | dest | Where to store attribute value |
pcmk_ok
on success, -1 otherwise Definition at line 1322 of file xml_element.c.
int crm_element_value_timeval | ( | const xmlNode * | xml, |
const char * | name_sec, | ||
const char * | name_usec, | ||
struct timeval * | dest | ||
) |
Retrieve the value of XML second/microsecond attributes as time.
This is like crm_element_value()
but returning value as a struct timeval.
[in] | xml | XML to parse |
[in] | name_sec | Name of XML attribute for seconds |
[in] | name_usec | Name of XML attribute for microseconds |
[out] | dest | Where to store result |
pcmk_ok
on success, -errno on error Definition at line 1388 of file xml_element.c.
const char* crm_xml_add | ( | xmlNode * | node, |
const char * | name, | ||
const char * | value | ||
) |
Create an XML attribute with specified name and value.
[in,out] | node | XML node to modify |
[in] | name | Attribute name to set |
[in] | value | Attribute value to set |
NULL
otherwise NULL
or empty. Definition at line 1015 of file xml_element.c.
const char* crm_xml_add_int | ( | xmlNode * | node, |
const char * | name, | ||
int | value | ||
) |
Create an XML attribute with specified name and integer value.
This is like crm_xml_add()
but taking an integer value.
[in,out] | node | XML node to modify |
[in] | name | Attribute name to set |
[in] | value | Attribute value to set |
NULL
otherwise NULL
or empty. Definition at line 1070 of file xml_element.c.
const char* crm_xml_add_ll | ( | xmlNode * | xml, |
const char * | name, | ||
long long | value | ||
) |
Create an XML attribute with specified name and long long int value.
This is like crm_xml_add()
but taking a long long int value. It is a useful equivalent for defined types like time_t, etc.
[in,out] | xml | XML node to modify |
[in] | name | Attribute name to set |
[in] | value | Attribute value to set |
NULL
otherwise NULL
or empty. This does not support greater than 64-bit values. Definition at line 1120 of file xml_element.c.
const char* crm_xml_add_ms | ( | xmlNode * | node, |
const char * | name, | ||
guint | ms | ||
) |
Create an XML attribute with specified name and unsigned value.
This is like crm_xml_add()
but taking a guint value.
[in,out] | node | XML node to modify |
[in] | name | Attribute name to set |
[in] | ms | Attribute value to set |
NULL
otherwise NULL
or empty. Definition at line 1092 of file xml_element.c.
const char* crm_xml_add_timeval | ( | xmlNode * | xml, |
const char * | name_sec, | ||
const char * | name_usec, | ||
const struct timeval * | value | ||
) |
Create XML attributes for seconds and microseconds.
This is like crm_xml_add()
but taking a struct timeval.
[in,out] | xml | XML node to modify |
[in] | name_sec | Name of XML attribute for seconds |
[in] | name_usec | Name of XML attribute for microseconds (or NULL) |
[in] | value | Time value to set |
NULL
otherwise NULL
. Definition at line 1144 of file xml_element.c.