pacemaker 3.0.1-16e74fc4da
Scalable High-Availability cluster resource manager
Loading...
Searching...
No Matches
nvpair_internal.h
Go to the documentation of this file.
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_NVPAIR_INTERNAL__H
11#define PCMK__CRM_COMMON_NVPAIR_INTERNAL__H
12
13#include <stdbool.h> // bool
14#include <glib.h> // gboolean, gpointer, GHashTable
15#include <libxml/tree.h> // xmlNode
16
17#include <crm/common/rules.h> // pcmk_rule_input_t
18#include <crm/common/iso8601.h> // crm_time_t
19#include <crm/common/strings_internal.h> // pcmk__str_eq(), etc.
20
21#ifdef __cplusplus
22extern "C" {
23#endif
24
25// Data needed to sort XML blocks of name/value pairs
26typedef struct unpack_data_s {
27 GHashTable *values; // Where to put name/value pairs
28 const char *first_id; // Block with this XML ID should sort first
29 pcmk_rule_input_t rule_input; // Data used to evaluate rules
30
31 /* Whether each block's values should overwrite any existing ones
32 *
33 * @COMPAT Only external call paths set this to true. Drop it when we drop
34 * pe_eval_nvpairs() and pe_unpack_nvpairs().
35 */
37
38 // If not NULL, this will be set to when rule evaluations will change next
41
42gint pcmk__cmp_nvpair_blocks(gconstpointer a, gconstpointer b,
43 gpointer user_data);
44
45void pcmk__unpack_nvpair_block(gpointer data, gpointer user_data);
46
56#define pcmk__insert_meta(obj, name, value) do { \
57 if (pcmk__str_eq((value), "#default", pcmk__str_casei)) { \
58 /* @COMPAT Deprecated since 2.1.8 */ \
59 pcmk__config_warn("Support for setting meta-attributes " \
60 "(such as %s) to the explicit value " \
61 "'#default' is deprecated and will be " \
62 "removed in a future release", (name)); \
63 } else if ((value) != NULL) { \
64 pcmk__insert_dup((obj)->meta, (name), (value)); \
65 } \
66 } while (0)
67
68#ifdef __cplusplus
69}
70#endif
71
72#endif // PCMK__CRM_COMMON_NVPAIR_INTERNAL__H
Scheduler API for rules.
char data[0]
Definition cpg.c:10
ISO_8601 Date handling.
struct crm_time_s crm_time_t
Definition iso8601.h:32
void pcmk__unpack_nvpair_block(gpointer data, gpointer user_data)
Definition nvpair.c:445
gint pcmk__cmp_nvpair_blocks(gconstpointer a, gconstpointer b, gpointer user_data)
Definition nvpair.c:582
struct unpack_data_s pcmk__nvpair_unpack_t
Data used to evaluate a rule (any NULL items are ignored)
Definition rules.h:57
pcmk_rule_input_t rule_input
const char * first_id
crm_time_t * next_change
GHashTable * values