1 /*
2 * Copyright 2022 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_RULE__H
11 # define PCMK__PCMKI_PCMKI_RULE__H
12
13 #include <crm/crm.h>
14 #include <crm/common/iso8601.h>
15 #include <crm/common/output_internal.h>
16
17 int pcmk__check_rules(pcmk__output_t *out, xmlNodePtr input,
18 const crm_time_t *date_time, const char **rule_ids);
19
20 /*!
21 * \internal
22 * \brief Check whether a given rule is in effect
23 *
24 * \param[in,out] out Output object
25 * \param[in] input The CIB XML to check (if \c NULL, use current CIB)
26 * \param[in] date Check whether the rule is in effect at this date and
27 * time (if \c NULL, use current date and time)
28 * \param[in] rule_ids The ID of the rule to check
29 *
30 * \return Standard Pacemaker return code
31 */
32 static inline int
33 pcmk__check_rule(pcmk__output_t *out, xmlNodePtr input, const crm_time_t *date,
/* ![[previous]](../icons/n_left.png)
![[next]](../icons/n_right.png)
![[first]](../icons/n_first.png)
![[last]](../icons/n_last.png)
![[top]](../icons/top.png)
![[bottom]](../icons/bottom.png)
![[index]](../icons/index.png)
*/
34 const char *rule_id)
35 {
36 const char *rule_ids[] = {rule_id, NULL};
37 return pcmk__check_rules(out, input, date, rule_ids);
38 }
39
40 #endif // PCMK__PCMKI_PCMKI_RULE__H