10 #ifndef PCMK__COMMON_UTIL_COMPAT__H
11 # define PCMK__COMMON_UTIL_COMPAT__H
26 #define crm_get_interval crm_parse_interval_spec
30 static inline gboolean
31 is_not_set(
long long word,
long long bit)
33 return ((word & bit) == 0);
37 static inline gboolean
38 is_set(
long long word,
long long bit)
40 return ((word & bit) == bit);
44 static inline gboolean
45 is_set_any(
long long word,
long long bit)
47 return ((word & bit) != 0);
51 gboolean
crm_str_eq(
const char *a,
const char *b, gboolean use_case);
57 #define safe_str_eq(a, b) crm_str_eq(a, b, FALSE)
73 long long crm_parse_ll(
const char *text,
const char *default_text);
76 int crm_parse_int(
const char *text,
const char *default_text);
79 # define crm_atoi(text, default_text) crm_parse_int(text, default_text)
85 #define crm_str_hash g_str_hash_traditional
94 static inline GHashTable *
95 crm_str_table_new(
void)
97 return g_hash_table_new_full(
crm_str_hash, g_str_equal, free, free);
101 static inline GHashTable *
102 crm_strcase_table_new(
void)
113 crm_hash_table_size(GHashTable *hashtable)
115 if (hashtable == NULL) {
118 return g_hash_table_size(hashtable);
136 crm_ftoa(
double a_float)
143 crm_ttoa(time_t epoch_time)
155 #endif // PCMK__COMMON_UTIL_COMPAT__H
char * crm_itoa_stack(int an_int, char *buf, size_t len)
guint crm_strcase_hash(gconstpointer v)
int crm_parse_int(const char *text, const char *default_text)
gboolean crm_str_eq(const char *a, const char *b, gboolean use_case)
char * pcmk_format_nvpair(const char *name, const char *value, const char *units)
guint g_str_hash_traditional(gconstpointer v)
char * crm_strdup_printf(char const *format,...) G_GNUC_PRINTF(1
int pcmk_scan_nvpair(const char *input, char **name, char **value)
void crm_build_path(const char *path_c, mode_t mode)
int pcmk_numeric_strcasecmp(const char *s1, const char *s2)
long long crm_parse_ll(const char *text, const char *default_text)
gboolean safe_str_neq(const char *a, const char *b)
gboolean crm_strcase_equal(gconstpointer a, gconstpointer b)
char * pcmk_format_named_time(const char *name, time_t epoch_time)
char * crm_strip_trailing_newline(char *str)
GHashTable * crm_str_table_dup(GHashTable *old_table)