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_element_name
  2. numXpathResults

   1 /*
   2  * Copyright 2004-2025 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 #include <libxml/xpath.h>           // xmlXPathObject
  16 
  17 #include <crm/common/nvpair.h>  // crm_xml_add()
  18 #include <crm/common/xml_names.h>   // PCMK_XE_CLONE
  19 
  20 #ifdef __cplusplus
  21 extern "C" {
  22 #endif
  23 
  24 /**
  25  * \file
  26  * \brief Deprecated Pacemaker XML API
  27  * \ingroup core
  28  * \deprecated Do not include this header directly. The XML APIs in this
  29  *             header, and the header itself, will be removed in a future
  30  *             release.
  31  */
  32 
  33 // NOTE: sbd (as of at least 1.5.2) uses this
  34 //! \deprecated Use name member directly
  35 static inline const char *
  36 crm_element_name(const xmlNode *xml)
     /* [previous][next][first][last][top][bottom][index][help] */
  37 {
  38     return (xml == NULL)? NULL : (const char *) xml->name;
  39 }
  40 
  41 // NOTE: sbd (as of at least 1.5.2) uses this
  42 //! \deprecated Do not use Pacemaker for general-purpose XML manipulation
  43 xmlNode *copy_xml(xmlNode *src_node);
  44 
  45 // NOTE: sbd (as of at least 1.5.2) uses this
  46 //! \deprecated Do not use
  47 gboolean cli_config_update(xmlNode **xml, int *best_version, gboolean to_logs);
  48 
  49 // NOTE: sbd (as of at least 1.5.2) uses this
  50 //! \deprecated Call \c crm_log_init() or \c crm_log_cli_init() instead
  51 void crm_xml_init(void);
  52 
  53 //! \deprecated Exit with \c crm_exit() instead
  54 void crm_xml_cleanup(void);
  55 
  56 //! \deprecated Do not use Pacemaker for general-purpose XML manipulation
  57 void pcmk_free_xml_subtree(xmlNode *xml);
  58 
  59 // NOTE: sbd (as of at least 1.5.2) uses this
  60 //! \deprecated Do not use Pacemaker for general-purpose XML manipulation
  61 void free_xml(xmlNode *child);
  62 
  63 //! \deprecated Do not use Pacemaker for general-purpose XML manipulation
  64 void crm_xml_sanitize_id(char *id);
  65 
  66 //! \deprecated Do not use
  67 char *calculate_on_disk_digest(xmlNode *input);
  68 
  69 //! \deprecated Do not use
  70 char *calculate_operation_digest(xmlNode *input, const char *version);
  71 
  72 //! \deprecated Do not use
  73 char *calculate_xml_versioned_digest(xmlNode *input, gboolean sort,
  74                                      gboolean do_filter, const char *version);
  75 
  76 //! \deprecated Do not use
  77 xmlXPathObjectPtr xpath_search(const xmlNode *xml_top, const char *path);
  78 
  79 //! \deprecated Do not use
  80 static inline int numXpathResults(xmlXPathObjectPtr xpathObj)
     /* [previous][next][first][last][top][bottom][index][help] */
  81 {
  82     if ((xpathObj == NULL) || (xpathObj->nodesetval == NULL)) {
  83         return 0;
  84     }
  85     return xpathObj->nodesetval->nodeNr;
  86 }
  87 
  88 //! \deprecated Do not use
  89 xmlNode *getXpathResult(xmlXPathObjectPtr xpathObj, int index);
  90 
  91 //! \deprecated Do not use
  92 void freeXpathObject(xmlXPathObjectPtr xpathObj);
  93 
  94 //! \deprecated Do not use
  95 void dedupXpathResults(xmlXPathObjectPtr xpathObj);
  96 
  97 //! \deprecated Do not use
  98 void crm_foreach_xpath_result(xmlNode *xml, const char *xpath,
  99                               void (*helper)(xmlNode*, void*), void *user_data);
 100 
 101 // NOTE: sbd (as of at least 1.5.2) uses this
 102 //! \deprecated Do not use
 103 xmlNode *get_xpath_object(const char *xpath, xmlNode *xml_obj, int error_level);
 104 
 105 //! \deprecated Do not use
 106 typedef const xmlChar *pcmkXmlStr;
 107 
 108 //! \deprecated Do not use
 109 bool xml_tracking_changes(xmlNode *xml);
 110 
 111 //! \deprecated Do not use
 112 bool xml_document_dirty(xmlNode *xml);
 113 
 114 //! \deprecated Do not use
 115 void xml_accept_changes(xmlNode *xml);
 116 
 117 //! \deprecated Do not use
 118 void xml_track_changes(xmlNode *xml, const char *user, xmlNode *acl_source,
 119                        bool enforce_acls);
 120 
 121 //! \deprecated Do not use
 122 void xml_calculate_changes(xmlNode *old_xml, xmlNode *new_xml);
 123 
 124 //! \deprecated Do not use
 125 void xml_calculate_significant_changes(xmlNode *old_xml, xmlNode *new_xml);
 126 
 127 #ifdef __cplusplus
 128 }
 129 #endif
 130 
 131 #endif // PCMK__CRM_COMMON_XML_COMPAT__H

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