This source file includes following definitions.
- crm_copy_xml_element
1
2
3
4
5
6
7
8
9
10 #ifndef PCMK__CRM_COMMON_XML_ELEMENT__H
11 #define PCMK__CRM_COMMON_XML_ELEMENT__H
12
13 #include <sys/time.h>
14
15 #include <glib.h>
16 #include <libxml/tree.h>
17
18 #ifdef __cplusplus
19 extern "C" {
20 #endif
21
22
23
24
25
26
27
28 const char *crm_xml_add(xmlNode *node, const char *name, const char *value);
29 const char *crm_xml_add_int(xmlNode *node, const char *name, int value);
30 const char *crm_xml_add_ll(xmlNode *node, const char *name, long long value);
31 const char *crm_xml_add_ms(xmlNode *node, const char *name, guint ms);
32 const char *crm_xml_add_timeval(xmlNode *xml, const char *name_sec,
33 const char *name_usec,
34 const struct timeval *value);
35
36 const char *crm_element_value(const xmlNode *data, const char *name);
37 int crm_element_value_int(const xmlNode *data, const char *name, int *dest);
38 int crm_element_value_ll(const xmlNode *data, const char *name, long long *dest);
39 int crm_element_value_ms(const xmlNode *data, const char *name, guint *dest);
40 int crm_element_value_epoch(const xmlNode *xml, const char *name, time_t *dest);
41 int crm_element_value_timeval(const xmlNode *data, const char *name_sec,
42 const char *name_usec, struct timeval *dest);
43 char *crm_element_value_copy(const xmlNode *data, const char *name);
44
45
46
47
48
49
50
51
52
53
54 static inline const char *
55 crm_copy_xml_element(const xmlNode *obj1, xmlNode *obj2, const char *element)
56 {
57 const char *value = crm_element_value(obj1, element);
58
59 crm_xml_add(obj2, element, value);
60 return value;
61 }
62
63 #ifdef __cplusplus
64 }
65 #endif
66
67 #if !defined(PCMK_ALLOW_DEPRECATED) || (PCMK_ALLOW_DEPRECATED == 1)
68 #include <crm/common/xml_element_compat.h>
69 #endif
70
71 #endif