pacemaker
2.1.0-7c3f660
Scalable High-Availability cluster resource manager
|
#include <crm_internal.h>
#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>
#include <time.h>
#include <string.h>
#include <stdlib.h>
#include <stdarg.h>
#include <bzlib.h>
#include <libxml/parser.h>
#include <libxml/tree.h>
#include <libxml/xmlIO.h>
#include <crm/crm.h>
#include <crm/msg_xml.h>
#include <crm/common/iso8601_internal.h>
#include <crm/common/xml.h>
#include <crm/common/xml_internal.h>
#include "crmcommon_private.h"
#include <crm/common/xml_compat.h>
Go to the source code of this file.
Macros | |
#define | XML_PARSER_DEBUG 0 |
#define | PCMK__XML_PARSE_OPTS (XML_PARSE_NOBLANKS | XML_PARSE_RECOVER) |
#define | CHUNK_SIZE 1024 |
#define | buffer_print(buffer, max, offset, fmt, args...) |
#define | XML_PRIVATE_MAGIC (long) 0x81726354 |
#define | attr_matches(c, n, v) |
#define | PCMK__XMLDUMP_STATS 0 |
#define | XPATH_MAX 512 |
Functions | |
bool | pcmk__tracking_xml_changes (xmlNode *xml, bool lazy) |
void | pcmk__set_xml_doc_flag (xmlNode *xml, enum xml_private_flags flag) |
void | pcmk__mark_xml_created (xmlNode *xml) |
void | pcmk__mark_xml_attr_dirty (xmlAttr *a) |
void | xml_track_changes (xmlNode *xml, const char *user, xmlNode *acl_source, bool enforce_acls) |
bool | xml_tracking_changes (xmlNode *xml) |
bool | xml_document_dirty (xmlNode *xml) |
int | pcmk__xml_position (xmlNode *xml, enum xml_private_flags ignore_if_set) |
xmlNode * | pcmk__xml_match (xmlNode *haystack, xmlNode *needle, bool exact) |
void | xml_log_changes (uint8_t log_level, const char *function, xmlNode *xml) |
void | xml_accept_changes (xmlNode *xml) |
xmlNode * | find_xml_node (xmlNode *root, const char *search_path, gboolean must_find) |
xmlNode * | pcmk__xe_match (xmlNode *parent, const char *node_name, const char *attr_n, const char *attr_v) |
void | copy_in_properties (xmlNode *target, xmlNode *src) |
void | fix_plus_plus_recursive (xmlNode *target) |
void | expand_plus_plus (xmlNode *target, const char *name, const char *value) |
void | pcmk__xe_remove_matching_attrs (xmlNode *element, bool(*match)(xmlAttrPtr, void *), void *user_data) |
xmlDoc * | getDocPtr (xmlNode *node) |
xmlNode * | add_node_copy (xmlNode *parent, xmlNode *src_node) |
int | add_node_nocopy (xmlNode *parent, const char *name, xmlNode *child) |
xmlNode * | create_xml_node (xmlNode *parent, const char *name) |
xmlNode * | pcmk_create_xml_text_node (xmlNode *parent, const char *name, const char *content) |
xmlNode * | pcmk_create_html_node (xmlNode *parent, const char *element_name, const char *id, const char *class_name, const char *text) |
void | pcmk_free_xml_subtree (xmlNode *xml) |
void | free_xml (xmlNode *child) |
xmlNode * | copy_xml (xmlNode *src) |
xmlNode * | string2xml (const char *input) |
xmlNode * | stdin2xml (void) |
void | pcmk__strip_xml_text (xmlNode *xml) |
xmlNode * | filename2xml (const char *filename) |
const char * | pcmk__xe_add_last_written (xmlNode *xe) |
void | crm_xml_sanitize_id (char *id) |
Sanitize a string so it is usable as an XML ID. More... | |
void | crm_xml_set_id (xmlNode *xml, const char *format,...) |
Set the ID of an XML element using a format. More... | |
int | write_xml_fd (xmlNode *xml_node, const char *filename, int fd, gboolean compress) |
Write XML to a file descriptor. More... | |
int | write_xml_file (xmlNode *xml_node, const char *filename, gboolean compress) |
Write XML to a file. More... | |
char * | crm_xml_escape (const char *text) |
void | pcmk__xe_log (int log_level, const char *file, const char *function, int line, const char *prefix, xmlNode *data, int depth, int options) |
void | log_data_element (int log_level, const char *file, const char *function, int line, const char *prefix, xmlNode *data, int depth, int options) |
void | pcmk__xml2text (xmlNode *data, int options, char **buffer, int *offset, int *max, int depth) |
void | pcmk__buffer_add_char (char **buffer, int *offset, int *max, char c) |
char * | dump_xml_formatted_with_text (xmlNode *an_xml_node) |
char * | dump_xml_formatted (xmlNode *an_xml_node) |
char * | dump_xml_unformatted (xmlNode *an_xml_node) |
gboolean | xml_has_children (const xmlNode *xml_root) |
void | xml_remove_prop (xmlNode *obj, const char *name) |
void | save_xml_to_file (xmlNode *xml, const char *desc, const char *filename) |
void | xml_calculate_significant_changes (xmlNode *old_xml, xmlNode *new_xml) |
void | xml_calculate_changes (xmlNode *old_xml, xmlNode *new_xml) |
gboolean | can_prune_leaf (xmlNode *xml_node) |
xmlNode * | pcmk__xc_match (xmlNode *root, xmlNode *search_comment, bool exact) |
void | pcmk__xc_update (xmlNode *parent, xmlNode *target, xmlNode *update) |
void | pcmk__xml_update (xmlNode *parent, xmlNode *target, xmlNode *update, bool as_diff) |
gboolean | update_xml_child (xmlNode *child, xmlNode *to_update) |
int | find_xml_children (xmlNode **children, xmlNode *root, const char *tag, const char *field, const char *value, gboolean search_matches) |
gboolean | replace_xml_child (xmlNode *parent, xmlNode *child, xmlNode *update, gboolean delete_only) |
xmlNode * | sorted_xml (xmlNode *input, xmlNode *parent, gboolean recursive) |
xmlNode * | first_named_child (const xmlNode *parent, const char *name) |
xmlNode * | crm_next_same_xml (const xmlNode *sibling) |
Get next instance of same XML tag. More... | |
void | crm_xml_init (void) |
void | crm_xml_cleanup (void) |
xmlNode * | expand_idref (xmlNode *input, xmlNode *top) |
void | crm_destroy_xml (gpointer data) |
xmlNode destructor which can be used in glib collections More... | |
char * | pcmk__xml_artefact_root (enum pcmk__xml_artefact_ns ns) |
char * | pcmk__xml_artefact_path (enum pcmk__xml_artefact_ns ns, const char *filespec) |
void | pcmk__xe_set_propv (xmlNodePtr node, va_list pairs) |
void | pcmk__xe_set_props (xmlNodePtr node,...) |
xmlNode * | find_entity (xmlNode *parent, const char *node_name, const char *id) |
#define attr_matches | ( | c, | |
n, | |||
v | |||
) |
#define buffer_print | ( | buffer, | |
max, | |||
offset, | |||
fmt, | |||
args... | |||
) |
#define PCMK__XML_PARSE_OPTS (XML_PARSE_NOBLANKS | XML_PARSE_RECOVER) |
xmlNode* add_node_copy | ( | xmlNode * | parent, |
xmlNode * | src_node | ||
) |
int add_node_nocopy | ( | xmlNode * | parent, |
const char * | name, | ||
xmlNode * | child | ||
) |
xmlNode* create_xml_node | ( | xmlNode * | parent, |
const char * | name | ||
) |
void crm_destroy_xml | ( | gpointer | data | ) |
xmlNode* crm_next_same_xml | ( | const xmlNode * | sibling | ) |
void crm_xml_sanitize_id | ( | char * | id | ) |
void crm_xml_set_id | ( | xmlNode * | xml, |
const char * | format, | ||
... | |||
) |
void expand_plus_plus | ( | xmlNode * | target, |
const char * | name, | ||
const char * | value | ||
) |
xmlNode* find_entity | ( | xmlNode * | parent, |
const char * | node_name, | ||
const char * | id | ||
) |
int find_xml_children | ( | xmlNode ** | children, |
xmlNode * | root, | ||
const char * | tag, | ||
const char * | field, | ||
const char * | value, | ||
gboolean | search_matches | ||
) |
xmlNode* find_xml_node | ( | xmlNode * | root, |
const char * | search_path, | ||
gboolean | must_find | ||
) |
xmlNode* first_named_child | ( | const xmlNode * | parent, |
const char * | name | ||
) |
void log_data_element | ( | int | log_level, |
const char * | file, | ||
const char * | function, | ||
int | line, | ||
const char * | prefix, | ||
xmlNode * | data, | ||
int | depth, | ||
int | options | ||
) |
void pcmk__buffer_add_char | ( | char ** | buffer, |
int * | offset, | ||
int * | max, | ||
char | c | ||
) |
void pcmk__set_xml_doc_flag | ( | xmlNode * | xml, |
enum xml_private_flags | flag | ||
) |
xmlNode* pcmk__xc_match | ( | xmlNode * | root, |
xmlNode * | search_comment, | ||
bool | exact | ||
) |
void pcmk__xc_update | ( | xmlNode * | parent, |
xmlNode * | target, | ||
xmlNode * | update | ||
) |
void pcmk__xe_log | ( | int | log_level, |
const char * | file, | ||
const char * | function, | ||
int | line, | ||
const char * | prefix, | ||
xmlNode * | data, | ||
int | depth, | ||
int | options | ||
) |
xmlNode* pcmk__xe_match | ( | xmlNode * | parent, |
const char * | node_name, | ||
const char * | attr_n, | ||
const char * | attr_v | ||
) |
void pcmk__xe_remove_matching_attrs | ( | xmlNode * | element, |
bool(*)(xmlAttrPtr, void *) | match, | ||
void * | user_data | ||
) |
void pcmk__xml2text | ( | xmlNode * | data, |
int | options, | ||
char ** | buffer, | ||
int * | offset, | ||
int * | max, | ||
int | depth | ||
) |
char* pcmk__xml_artefact_path | ( | enum pcmk__xml_artefact_ns | ns, |
const char * | filespec | ||
) |
char* pcmk__xml_artefact_root | ( | enum pcmk__xml_artefact_ns | ns | ) |
xmlNode* pcmk__xml_match | ( | xmlNode * | haystack, |
xmlNode * | needle, | ||
bool | exact | ||
) |
int pcmk__xml_position | ( | xmlNode * | xml, |
enum xml_private_flags | ignore_if_set | ||
) |
void pcmk__xml_update | ( | xmlNode * | parent, |
xmlNode * | target, | ||
xmlNode * | update, | ||
bool | as_diff | ||
) |
xmlNode* pcmk_create_html_node | ( | xmlNode * | parent, |
const char * | element_name, | ||
const char * | id, | ||
const char * | class_name, | ||
const char * | text | ||
) |
xmlNode* pcmk_create_xml_text_node | ( | xmlNode * | parent, |
const char * | name, | ||
const char * | content | ||
) |
void pcmk_free_xml_subtree | ( | xmlNode * | xml | ) |
gboolean replace_xml_child | ( | xmlNode * | parent, |
xmlNode * | child, | ||
xmlNode * | update, | ||
gboolean | delete_only | ||
) |
void save_xml_to_file | ( | xmlNode * | xml, |
const char * | desc, | ||
const char * | filename | ||
) |
xmlNode* sorted_xml | ( | xmlNode * | input, |
xmlNode * | parent, | ||
gboolean | recursive | ||
) |
gboolean update_xml_child | ( | xmlNode * | child, |
xmlNode * | to_update | ||
) |
int write_xml_fd | ( | xmlNode * | xml_node, |
const char * | filename, | ||
int | fd, | ||
gboolean | compress | ||
) |
Write XML to a file descriptor.
[in] | xml_node | XML to write |
[in] | filename | Name of file being written (for logging only) |
[in] | fd | Open file descriptor corresponding to filename |
[in] | compress | Whether to compress XML before writing |
int write_xml_file | ( | xmlNode * | xml_node, |
const char * | filename, | ||
gboolean | compress | ||
) |
void xml_calculate_changes | ( | xmlNode * | old_xml, |
xmlNode * | new_xml | ||
) |
void xml_calculate_significant_changes | ( | xmlNode * | old_xml, |
xmlNode * | new_xml | ||
) |
void xml_log_changes | ( | uint8_t | log_level, |
const char * | function, | ||
xmlNode * | xml | ||
) |
void xml_track_changes | ( | xmlNode * | xml, |
const char * | user, | ||
xmlNode * | acl_source, | ||
bool | enforce_acls | ||
) |