root/include/crm/common/xml_compat.h

/* [previous][next][first][last][top][bottom][index][help] */

INCLUDED FROM


DEFINITIONS

This source file includes following definitions.
  1. crm_xml_add_boolean
  2. crm_element_name
  3. crm_map_element_name

   1 /*
   2  * Copyright 2004-2024 the Pacemaker project contributors
   3  *
   4  * The version control history for this file may have further details.
   5  *
   6  * This source code is licensed under the GNU Lesser General Public License
   7  * version 2.1 or later (LGPLv2.1+) WITHOUT ANY WARRANTY.
   8  */
   9 
  10 #ifndef PCMK__CRM_COMMON_XML_COMPAT__H
  11 #define PCMK__CRM_COMMON_XML_COMPAT__H
  12 
  13 #include <glib.h>               // gboolean
  14 #include <libxml/tree.h>        // xmlNode
  15 
  16 #include <crm/common/nvpair.h>  // crm_xml_add()
  17 #include <crm/common/xml_names.h>   // PCMK_XE_CLONE
  18 
  19 #ifdef __cplusplus
  20 extern "C" {
  21 #endif
  22 
  23 /**
  24  * \file
  25  * \brief Deprecated Pacemaker XML API
  26  * \ingroup core
  27  * \deprecated Do not include this header directly. The XML APIs in this
  28  *             header, and the header itself, will be removed in a future
  29  *             release.
  30  */
  31 
  32 //! \deprecated Do not use (will be removed in a future release)
  33 #define XML_PARANOIA_CHECKS 0
  34 
  35 //! \deprecated This function will be removed in a future release
  36 xmlDoc *getDocPtr(xmlNode *node);
  37 
  38 //! \deprecated This function will be removed in a future release
  39 int add_node_nocopy(xmlNode * parent, const char *name, xmlNode * child);
  40 
  41 //! \deprecated This function will be removed in a future release
  42 xmlNode *find_entity(xmlNode *parent, const char *node_name, const char *id);
  43 
  44 //! \deprecated This function will be removed in a future release
  45 char *xml_get_path(const xmlNode *xml);
  46 
  47 //! \deprecated This function will be removed in a future release
  48 void xml_log_changes(uint8_t level, const char *function, const xmlNode *xml);
  49 
  50 //! \deprecated This function will be removed in a future release
  51 void xml_log_patchset(uint8_t level, const char *function, const xmlNode *xml);
  52 
  53 //!  \deprecated Use xml_apply_patchset() instead
  54 gboolean apply_xml_diff(xmlNode *old_xml, xmlNode *diff, xmlNode **new_xml);
  55 
  56 //! \deprecated Do not use (will be removed in a future release)
  57 void crm_destroy_xml(gpointer data);
  58 
  59 //! \deprecated Check children member directly
  60 gboolean xml_has_children(const xmlNode *root);
  61 
  62 //! \deprecated Use crm_xml_add() with "true" or "false" instead
  63 static inline const char *
  64 crm_xml_add_boolean(xmlNode *node, const char *name, gboolean value)
     /* [previous][next][first][last][top][bottom][index][help] */
  65 {
  66     return crm_xml_add(node, name, (value? "true" : "false"));
  67 }
  68 
  69 // NOTE: sbd (as of at least 1.5.2) uses this
  70 //! \deprecated Use name member directly
  71 static inline const char *
  72 crm_element_name(const xmlNode *xml)
     /* [previous][next][first][last][top][bottom][index][help] */
  73 {
  74     return (xml == NULL)? NULL : (const char *) xml->name;
  75 }
  76 
  77 //! \deprecated Do not use
  78 char *crm_xml_escape(const char *text);
  79 
  80 // NOTE: sbd (as of at least 1.5.2) uses this
  81 //! \deprecated Do not use Pacemaker for general-purpose XML manipulation
  82 xmlNode *copy_xml(xmlNode *src_node);
  83 
  84 //! \deprecated Do not use Pacemaker for general-purpose XML manipulation
  85 xmlNode *add_node_copy(xmlNode *new_parent, xmlNode *xml_node);
  86 
  87 //! \deprecated Do not use
  88 void purge_diff_markers(xmlNode *a_node);
  89 
  90 //! \deprecated Do not use
  91 xmlNode *diff_xml_object(xmlNode *left, xmlNode *right, gboolean suppress);
  92 
  93 //! \deprecated Do not use
  94 xmlNode *subtract_xml_object(xmlNode *parent, xmlNode *left, xmlNode *right,
  95                              gboolean full, gboolean *changed,
  96                              const char *marker);
  97 
  98 //! \deprecated Do not use
  99 gboolean can_prune_leaf(xmlNode *xml_node);
 100 
 101 //! \deprecated Do not use Pacemaker for general-purpose XML manipulation
 102 xmlNode *create_xml_node(xmlNode *parent, const char *name);
 103 
 104 //! \deprecated Do not use Pacemaker for general-purpose XML manipulation
 105 xmlNode *pcmk_create_xml_text_node(xmlNode *parent, const char *name,
 106                                    const char *content);
 107 
 108 //! \deprecated Do not use Pacemaker for general-purpose XML manipulation
 109 xmlNode *pcmk_create_html_node(xmlNode *parent, const char *element_name,
 110                                const char *id, const char *class_name,
 111                                const char *text);
 112 
 113 //! \deprecated Do not use Pacemaker for general-purpose XML manipulation
 114 xmlNode *first_named_child(const xmlNode *parent, const char *name);
 115 
 116 //! \deprecated Do not use Pacemaker for general-purpose XML manipulation
 117 xmlNode *find_xml_node(const xmlNode *root, const char *search_path,
 118                        gboolean must_find);
 119 
 120 //! \deprecated Do not use Pacemaker for general-purpose XML manipulation
 121 xmlNode *crm_next_same_xml(const xmlNode *sibling);
 122 
 123 //! \deprecated Do not use Pacemaker for general-purpose XML manipulation
 124 void xml_remove_prop(xmlNode *obj, const char *name);
 125 
 126 //! \deprecated Do not use Pacemaker for general-purpose XML manipulation
 127 gboolean replace_xml_child(xmlNode *parent, xmlNode *child, xmlNode *update,
 128                            gboolean delete_only);
 129 
 130 //! \deprecated Do not use Pacemaker for general-purpose XML manipulation
 131 gboolean update_xml_child(xmlNode *child, xmlNode *to_update);
 132 
 133 //! \deprecated Do not use Pacemaker for general-purpose XML manipulation
 134 int find_xml_children(xmlNode **children, xmlNode *root, const char *tag,
 135                       const char *field, const char *value,
 136                       gboolean search_matches);
 137 
 138 //! \deprecated Do not use Pacemaker for general-purpose XML manipulation
 139 xmlNode *get_xpath_object_relative(const char *xpath, xmlNode *xml_obj,
 140                                    int error_level);
 141 
 142 //! \deprecated Do not use
 143 void fix_plus_plus_recursive(xmlNode *target);
 144 
 145 //! \deprecated Do not use Pacemaker for general-purpose XML manipulation
 146 gboolean add_message_xml(xmlNode *msg, const char *field, xmlNode *xml);
 147 
 148 //! \deprecated Do not use Pacemaker for general-purpose XML manipulation
 149 xmlNode *get_message_xml(const xmlNode *msg, const char *field);
 150 
 151 //! \deprecated Do not use
 152 const char *xml_latest_schema(void);
 153 
 154 //! \deprecated Do not use
 155 const char *get_schema_name(int version);
 156 
 157 //! \deprecated Do not use
 158 int get_schema_version(const char *name);
 159 
 160 //! \deprecated Do not use
 161 int update_validation(xmlNode **xml_blob, int *best, int max,
 162                       gboolean transform, gboolean to_logs);
 163 
 164 //! \deprecated Do not use
 165 gboolean validate_xml(xmlNode *xml_blob, const char *validation,
 166                       gboolean to_logs);
 167 
 168 //! \deprecated Do not use
 169 gboolean validate_xml_verbose(const xmlNode *xml_blob);
 170 
 171 // NOTE: sbd (as of at least 1.5.2) uses this
 172 //! \deprecated Do not use
 173 gboolean cli_config_update(xmlNode **xml, int *best_version, gboolean to_logs);
 174 
 175 //! \deprecated Do not use
 176 static inline const char *
 177 crm_map_element_name(const xmlNode *xml)
     /* [previous][next][first][last][top][bottom][index][help] */
 178 {
 179     if (xml == NULL) {
 180         return NULL;
 181     } else if (strcmp((const char *) xml->name, "master") == 0) {
 182         // Can't use PCMK__XE_PROMOTABLE_LEGACY because it's internal
 183         return PCMK_XE_CLONE;
 184     } else {
 185         return (const char *) xml->name;
 186     }
 187 }
 188 
 189 //! \deprecated Do not use
 190 void copy_in_properties(xmlNode *target, const xmlNode *src);
 191 
 192 //! \deprecated Do not use
 193 void expand_plus_plus(xmlNode * target, const char *name, const char *value);
 194 
 195 #ifdef __cplusplus
 196 }
 197 #endif
 198 
 199 #endif // PCMK__CRM_COMMON_XML_COMPAT__H

/* [previous][next][first][last][top][bottom][index][help] */