diff options
Diffstat (limited to 'include/crm/common/xml_compat.h')
-rw-r--r-- | include/crm/common/xml_compat.h | 127 |
1 files changed, 124 insertions, 3 deletions
diff --git a/include/crm/common/xml_compat.h b/include/crm/common/xml_compat.h index 85e39ff..3582838 100644 --- a/include/crm/common/xml_compat.h +++ b/include/crm/common/xml_compat.h @@ -1,5 +1,5 @@ /* - * Copyright 2004-2023 the Pacemaker project contributors + * Copyright 2004-2024 the Pacemaker project contributors * * The version control history for this file may have further details. * @@ -8,11 +8,13 @@ */ #ifndef PCMK__CRM_COMMON_XML_COMPAT__H -# define PCMK__CRM_COMMON_XML_COMPAT__H +#define PCMK__CRM_COMMON_XML_COMPAT__H #include <glib.h> // gboolean #include <libxml/tree.h> // xmlNode -#include <crm/common/xml.h> // crm_xml_add() + +#include <crm/common/nvpair.h> // crm_xml_add() +#include <crm/common/xml_names.h> // PCMK_XE_CLONE #ifdef __cplusplus extern "C" { @@ -64,6 +66,7 @@ crm_xml_add_boolean(xmlNode *node, const char *name, gboolean value) return crm_xml_add(node, name, (value? "true" : "false")); } +// NOTE: sbd (as of at least 1.5.2) uses this //! \deprecated Use name member directly static inline const char * crm_element_name(const xmlNode *xml) @@ -71,6 +74,124 @@ crm_element_name(const xmlNode *xml) return (xml == NULL)? NULL : (const char *) xml->name; } +//! \deprecated Do not use +char *crm_xml_escape(const char *text); + +// NOTE: sbd (as of at least 1.5.2) uses this +//! \deprecated Do not use Pacemaker for general-purpose XML manipulation +xmlNode *copy_xml(xmlNode *src_node); + +//! \deprecated Do not use Pacemaker for general-purpose XML manipulation +xmlNode *add_node_copy(xmlNode *new_parent, xmlNode *xml_node); + +//! \deprecated Do not use +void purge_diff_markers(xmlNode *a_node); + +//! \deprecated Do not use +xmlNode *diff_xml_object(xmlNode *left, xmlNode *right, gboolean suppress); + +//! \deprecated Do not use +xmlNode *subtract_xml_object(xmlNode *parent, xmlNode *left, xmlNode *right, + gboolean full, gboolean *changed, + const char *marker); + +//! \deprecated Do not use +gboolean can_prune_leaf(xmlNode *xml_node); + +//! \deprecated Do not use Pacemaker for general-purpose XML manipulation +xmlNode *create_xml_node(xmlNode *parent, const char *name); + +//! \deprecated Do not use Pacemaker for general-purpose XML manipulation +xmlNode *pcmk_create_xml_text_node(xmlNode *parent, const char *name, + const char *content); + +//! \deprecated Do not use Pacemaker for general-purpose XML manipulation +xmlNode *pcmk_create_html_node(xmlNode *parent, const char *element_name, + const char *id, const char *class_name, + const char *text); + +//! \deprecated Do not use Pacemaker for general-purpose XML manipulation +xmlNode *first_named_child(const xmlNode *parent, const char *name); + +//! \deprecated Do not use Pacemaker for general-purpose XML manipulation +xmlNode *find_xml_node(const xmlNode *root, const char *search_path, + gboolean must_find); + +//! \deprecated Do not use Pacemaker for general-purpose XML manipulation +xmlNode *crm_next_same_xml(const xmlNode *sibling); + +//! \deprecated Do not use Pacemaker for general-purpose XML manipulation +void xml_remove_prop(xmlNode *obj, const char *name); + +//! \deprecated Do not use Pacemaker for general-purpose XML manipulation +gboolean replace_xml_child(xmlNode *parent, xmlNode *child, xmlNode *update, + gboolean delete_only); + +//! \deprecated Do not use Pacemaker for general-purpose XML manipulation +gboolean update_xml_child(xmlNode *child, xmlNode *to_update); + +//! \deprecated Do not use Pacemaker for general-purpose XML manipulation +int find_xml_children(xmlNode **children, xmlNode *root, const char *tag, + const char *field, const char *value, + gboolean search_matches); + +//! \deprecated Do not use Pacemaker for general-purpose XML manipulation +xmlNode *get_xpath_object_relative(const char *xpath, xmlNode *xml_obj, + int error_level); + +//! \deprecated Do not use +void fix_plus_plus_recursive(xmlNode *target); + +//! \deprecated Do not use Pacemaker for general-purpose XML manipulation +gboolean add_message_xml(xmlNode *msg, const char *field, xmlNode *xml); + +//! \deprecated Do not use Pacemaker for general-purpose XML manipulation +xmlNode *get_message_xml(const xmlNode *msg, const char *field); + +//! \deprecated Do not use +const char *xml_latest_schema(void); + +//! \deprecated Do not use +const char *get_schema_name(int version); + +//! \deprecated Do not use +int get_schema_version(const char *name); + +//! \deprecated Do not use +int update_validation(xmlNode **xml_blob, int *best, int max, + gboolean transform, gboolean to_logs); + +//! \deprecated Do not use +gboolean validate_xml(xmlNode *xml_blob, const char *validation, + gboolean to_logs); + +//! \deprecated Do not use +gboolean validate_xml_verbose(const xmlNode *xml_blob); + +// NOTE: sbd (as of at least 1.5.2) uses this +//! \deprecated Do not use +gboolean cli_config_update(xmlNode **xml, int *best_version, gboolean to_logs); + +//! \deprecated Do not use +static inline const char * +crm_map_element_name(const xmlNode *xml) +{ + if (xml == NULL) { + return NULL; + } else if (strcmp((const char *) xml->name, "master") == 0) { + // Can't use PCMK__XE_PROMOTABLE_LEGACY because it's internal + return PCMK_XE_CLONE; + } else { + return (const char *) xml->name; + } +} + +//! \deprecated Do not use +void copy_in_properties(xmlNode *target, const xmlNode *src); + +//! \deprecated Do not use +void expand_plus_plus(xmlNode * target, const char *name, const char *value); + #ifdef __cplusplus } #endif |