10 #ifndef PCMK__CRM_COMMON_UTIL_COMPAT__H 11 #define PCMK__CRM_COMMON_UTIL_COMPAT__H 14 #include <libxml/tree.h> 30 #define crm_get_interval crm_parse_interval_spec 34 #define CRM_DEFAULT_OP_TIMEOUT_S "20s" 37 static inline gboolean
38 is_not_set(
long long word,
long long bit)
40 return ((word & bit) == 0);
45 static inline gboolean
46 is_set(
long long word,
long long bit)
48 return ((word & bit) == bit);
52 static inline gboolean
53 is_set_any(
long long word,
long long bit)
55 return ((word & bit) != 0);
59 gboolean
crm_str_eq(
const char *a,
const char *b, gboolean use_case);
65 #define safe_str_eq(a, b) crm_str_eq(a, b, FALSE) 84 long long crm_parse_ll(
const char *text,
const char *default_text);
87 int crm_parse_int(
const char *text,
const char *default_text);
90 #define crm_atoi(text, default_text) crm_parse_int(text, default_text) 96 #define crm_str_hash g_str_hash_traditional 105 static inline GHashTable *
106 crm_str_table_new(
void)
108 return g_hash_table_new_full(
crm_str_hash, g_str_equal, free, free);
112 static inline GHashTable *
113 crm_strcase_table_new(
void)
124 crm_hash_table_size(GHashTable *hashtable)
126 if (hashtable == NULL) {
129 return g_hash_table_size(hashtable);
147 crm_ftoa(
double a_float)
154 crm_ttoa(time_t epoch_time)
166 #define ONLINESTATUS PCMK_VALUE_ONLINE 169 #define OFFLINESTATUS PCMK_VALUE_OFFLINE 178 #endif // PCMK__CRM_COMMON_UTIL_COMPAT__H GHashTable * crm_str_table_dup(GHashTable *old_table)
int crm_parse_int(const char *text, const char *default_text)
gboolean crm_str_eq(const char *a, const char *b, gboolean use_case)
gboolean crm_strcase_equal(gconstpointer a, gconstpointer b)
char * crm_itoa_stack(int an_int, char *buf, size_t len)
guint crm_strcase_hash(gconstpointer v)
guint g_str_hash_traditional(gconstpointer v)
char * crm_strip_trailing_newline(char *str)
char * pcmk_hostname(void)
const char * crm_xml_replace(xmlNode *node, const char *name, const char *value)
int pcmk_scan_nvpair(const char *input, char **name, char **value)
char * crm_strdup_printf(char const *format,...) G_GNUC_PRINTF(1
gboolean safe_str_neq(const char *a, const char *b)
int pcmk_numeric_strcasecmp(const char *s1, const char *s2)
char * pcmk_format_nvpair(const char *name, const char *value, const char *units)
guint crm_parse_interval_spec(const char *input)
void crm_build_path(const char *path_c, mode_t mode)
long long crm_parse_ll(const char *text, const char *default_text)
char * pcmk_format_named_time(const char *name, time_t epoch_time)