1 /* 2 * Copyright 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__PCMKI_PCMKI_VERIFY__H 11 #define PCMK__PCMKI_PCMKI_VERIFY__H 12 13 #include <crm/common/output_internal.h> 14 #include <crm/common/scheduler.h> 15 #include <libxml/tree.h> 16 17 #ifdef __cplusplus 18 extern "C" { 19 #endif 20 21 /*! 22 * \internal 23 * \brief Parse a CIB file 24 * 25 * This function parses a CIB file into a CIB object 26 * 27 * \param[in] out Output to use for logging and printing results 28 * \param[in] cib_source Source of the CIB: 29 * NULL -> use live cib, "-" -> stdin 30 * "<..." -> xml str, otherwise -> xml file name 31 * \param[in,out] cib_object The resulting, parsed CIB object 32 * 33 * \return Standard Pacemaker return code 34 */ 35 int pcmk__parse_cib(pcmk__output_t *out, const char *cib_source, xmlNodePtr *cib_object); 36 37 /*! 38 * \internal 39 * \brief Verify that a CIB is error-free or output errors and warnings 40 * 41 * This high-level function essentially implements crm_verify(8). It operates 42 * on an input CIB file, which can be inputted through one of several ways. It 43 * can either write out XML-formatted output or plaintext output. 44 * 45 * \param[in,out] scheduler Scheduler data 46 * \param[in] out Output to use for logging and printing results 47 * \param[in,out] cib_object The parsed CIB object 48 * 49 * \return Standard Pacemaker return code 50 */ 51 int pcmk__verify(pcmk_scheduler_t *scheduler, pcmk__output_t *out, 52 xmlNode **cib_object); 53 54 #ifdef __cplusplus 55 } 56 #endif 57 58 #endif // PCMK__PCMKI_PCMKI_VERIFY__H