This source file includes following definitions.
- crm_strdup_printf
- pcmk_all_flags_set
1
2
3
4
5
6
7
8
9
10 #ifndef PCMK__CRM_COMMON_UTIL__H
11 #define PCMK__CRM_COMMON_UTIL__H
12
13 #include <sys/types.h>
14 #include <stdlib.h>
15 #include <stdbool.h>
16 #include <stdint.h>
17 #include <limits.h>
18 #include <signal.h>
19 #include <glib.h>
20
21 #include <crm/common/acl.h>
22 #include <crm/common/actions.h>
23 #include <crm/common/agents.h>
24 #include <crm/common/results.h>
25 #include <crm/common/scores.h>
26 #include <crm/common/nvpair.h>
27
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31
32
33
34
35
36
37
38
39 char *pcmk_promotion_score_name(const char *rsc_id);
40
41
42 int crm_default_remote_port(void);
43
44
45
46
47 gboolean crm_is_true(const char *s);
48
49 int crm_str_to_boolean(const char *s, int *ret);
50
51
52 long long crm_get_msec(const char *input);
53
54
55 char *crm_strdup_printf(char const *format, ...) G_GNUC_PRINTF(1, 2);
56
57 int pcmk_parse_interval_spec(const char *input, guint *result_ms);
58
59 int compare_version(const char *version1, const char *version2);
60
61
62
63
64
65
66
67
68
69
70 static inline bool
71 pcmk_any_flags_set(uint64_t flag_group, uint64_t flags_to_check)
72 {
73 return (flag_group & flags_to_check) != 0;
74 }
75
76
77
78
79
80
81
82
83
84
85 static inline bool
86 pcmk_all_flags_set(uint64_t flag_group, uint64_t flags_to_check)
87 {
88 return (flag_group & flags_to_check) == flags_to_check;
89 }
90
91
92
93
94 #define pcmk_is_set(g, f) pcmk_all_flags_set((g), (f))
95
96 char *crm_md5sum(const char *buffer);
97
98 char *crm_generate_uuid(void);
99
100
101 bool crm_is_daemon_name(const char *name);
102
103 int crm_user_lookup(const char *name, uid_t * uid, gid_t * gid);
104 int pcmk_daemon_user(uid_t *uid, gid_t *gid);
105
106 #ifdef HAVE_GNUTLS_GNUTLS_H
107 void crm_gnutls_global_init(void);
108 #endif
109
110 bool pcmk_str_is_infinity(const char *s);
111 bool pcmk_str_is_minus_infinity(const char *s);
112
113 #if !defined(PCMK_ALLOW_DEPRECATED) || (PCMK_ALLOW_DEPRECATED == 1)
114 #include <crm/common/util_compat.h>
115 #endif
116
117 #ifdef __cplusplus
118 }
119 #endif
120
121 #endif