This source file includes following definitions.
- recovery2text
1
2
3
4
5
6
7
8
9
10 #ifndef PCMK__CRM_PENGINE_COMMON__H
11 # define PCMK__CRM_PENGINE_COMMON__H
12
13 # include <glib.h>
14 # include <regex.h>
15 # include <crm/common/iso8601.h>
16 # include <crm/common/scheduler.h>
17
18 #ifdef __cplusplus
19 extern "C" {
20 #endif
21
22 extern gboolean was_processing_error;
23 extern gboolean was_processing_warning;
24
25 const char *task2text(enum action_tasks task);
26 enum action_tasks text2task(const char *task);
27 enum rsc_role_e text2role(const char *role);
28 const char *role2text(enum rsc_role_e role);
29 const char *fail2text(enum action_fail_response fail);
30
31 const char *pe_pref(GHashTable * options, const char *name);
32
33
34
35
36
37
38
39
40 static inline const char *
41 recovery2text(enum rsc_recovery_type type)
42 {
43 switch (type) {
44 case pcmk_multiply_active_stop:
45 return "shutting it down";
46 case pcmk_multiply_active_restart:
47 return "attempting recovery";
48 case pcmk_multiply_active_block:
49 return "waiting for an administrator";
50 case pcmk_multiply_active_unexpected:
51 return "stopping unexpected instances";
52 }
53 return "Unknown";
54 }
55
56 typedef struct pe_re_match_data {
57 char *string;
58 int nregs;
59 regmatch_t *pmatch;
60 } pe_re_match_data_t;
61
62 typedef struct pe_match_data {
63 pe_re_match_data_t *re;
64 GHashTable *params;
65 GHashTable *meta;
66 } pe_match_data_t;
67
68 typedef struct pe_rsc_eval_data {
69 const char *standard;
70 const char *provider;
71 const char *agent;
72 } pe_rsc_eval_data_t;
73
74 typedef struct pe_op_eval_data {
75 const char *op_name;
76 guint interval;
77 } pe_op_eval_data_t;
78
79 typedef struct pe_rule_eval_data {
80 GHashTable *node_hash;
81 enum rsc_role_e role;
82 crm_time_t *now;
83 pe_match_data_t *match_data;
84 pe_rsc_eval_data_t *rsc_data;
85 pe_op_eval_data_t *op_data;
86 } pe_rule_eval_data_t;
87
88 #if !defined(PCMK_ALLOW_DEPRECATED) || (PCMK_ALLOW_DEPRECATED == 1)
89 #include <crm/pengine/common_compat.h>
90 #endif
91
92 #ifdef __cplusplus
93 }
94 #endif
95
96 #endif