pacemaker  2.1.7-0f7f88312f
Scalable High-Availability cluster resource manager
crm_compat.h
Go to the documentation of this file.
1 /*
2  * Copyright 2004-2023 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_CRM_COMPAT__H
11 # define PCMK__CRM_CRM_COMPAT__H
12 
13 #include <strings.h>
14 #include <glib.h>
15 
16 #include <crm/common/actions.h>
17 
18 #ifdef __cplusplus
19 extern "C" {
20 #endif
21 
31 #define EOS '\0'
33 
35 #define MAX_IPC_DELAY 120
36 
38 #define CRM_OP_FENCE PCMK_ACTION_STONITH
39 
41 #define CRM_OP_LRM_QUERY "lrm_query"
42 
44 #define CRM_OP_RELAXED_CLONE PCMK_ACTION_CLONE_ONE_OR_MORE
45 
47 #define CRM_OP_RELAXED_SET PCMK_ACTION_ONE_OR_MORE
48 
50 #define CRM_ATTR_RA_VERSION "#ra-version"
51 
53 #define CRMD_ACTION_CANCEL PCMK_ACTION_CANCEL
54 
56 #define CRMD_ACTION_DELETE PCMK_ACTION_DELETE
57 
59 #define CRMD_ACTION_DEMOTE PCMK_ACTION_DEMOTE
60 
62 #define CRMD_ACTION_DEMOTED PCMK_ACTION_DEMOTED
63 
65 #define CRMD_ACTION_METADATA PCMK_ACTION_META_DATA
66 
68 #define CRMD_ACTION_MIGRATE PCMK_ACTION_MIGRATE_TO
69 
71 #define CRMD_ACTION_MIGRATED PCMK_ACTION_MIGRATE_FROM
72 
74 #define CRMD_ACTION_NOTIFIED PCMK_ACTION_NOTIFIED
75 
77 #define CRMD_ACTION_NOTIFY PCMK_ACTION_NOTIFY
78 
80 #define CRMD_ACTION_PROMOTE PCMK_ACTION_PROMOTE
81 
83 #define CRMD_ACTION_PROMOTED PCMK_ACTION_PROMOTED
84 
86 #define CRMD_ACTION_RELOAD PCMK_ACTION_RELOAD
87 
89 #define CRMD_ACTION_RELOAD_AGENT PCMK_ACTION_RELOAD_AGENT
90 
92 #define CRMD_ACTION_START PCMK_ACTION_START
93 
95 #define CRMD_ACTION_STARTED PCMK_ACTION_RUNNING
96 
98 #define CRMD_ACTION_STATUS PCMK_ACTION_MONITOR
99 
101 #define CRMD_ACTION_STOP PCMK_ACTION_STOP
102 
104 #define CRMD_ACTION_STOPPED PCMK_ACTION_STOPPED
105 
107 #define CRMD_METADATA_CALL_TIMEOUT PCMK_DEFAULT_METADATA_TIMEOUT_MS
108 
110 #define RSC_CANCEL PCMK_ACTION_CANCEL
111 
113 #define RSC_DELETE PCMK_ACTION_DELETE
114 
116 #define RSC_DEMOTE PCMK_ACTION_DEMOTE
117 
119 #define RSC_DEMOTED PCMK_ACTION_DEMOTED
120 
122 #define RSC_METADATA PCMK_ACTION_META_DATA
123 
125 #define RSC_MIGRATE PCMK_ACTION_MIGRATE_TO
126 
128 #define RSC_MIGRATED PCMK_ACTION_MIGRATE_FROM
129 
131 #define RSC_NOTIFIED PCMK_ACTION_NOTIFIED
132 
134 #define RSC_NOTIFY PCMK_ACTION_NOTIFY
135 
137 #define RSC_PROMOTE PCMK_ACTION_PROMOTE
138 
140 #define RSC_PROMOTED PCMK_ACTION_PROMOTED
141 
143 #define RSC_START PCMK_ACTION_START
144 
146 #define RSC_STARTED PCMK_ACTION_RUNNING
147 
149 #define RSC_STATUS PCMK_ACTION_MONITOR
150 
152 #define RSC_STOP PCMK_ACTION_STOP
153 
155 #define RSC_STOPPED PCMK_ACTION_STOPPED
156 
159 
160 # ifndef __GNUC__
161 # define __builtin_expect(expr, result) (expr)
162 # endif
163 
164 #define __likely(expr) __builtin_expect(expr, 1)
165 
166 #define __unlikely(expr) __builtin_expect(expr, 0)
167 
168 // This ends the doxygen deprecation comment
170 
172 typedef GList *GListPtr;
173 
175 static inline const char *
176 crm_action_str(const char *task, guint interval_ms) {
177  if ((task != NULL) && (interval_ms == 0)
178  && (strcasecmp(task, PCMK_ACTION_MONITOR) == 0)) {
179  return "probe";
180  }
181  return task;
182 }
183 
184 #ifdef __cplusplus
185 }
186 #endif
187 
188 #endif // PCMK__CRM_CRM_COMPAT__H
GList * GListPtr
Definition: crm_compat.h:172
APIs related to actions.
#define PCMK_ACTION_MONITOR
Definition: actions.h:59