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