10 #ifndef PCMK__CRM_COMMON_UTIL_COMPAT__H 11 # define PCMK__CRM_COMMON_UTIL_COMPAT__H 29 #define crm_get_interval crm_parse_interval_spec 33 static inline gboolean
34 is_not_set(
long long word,
long long bit)
36 return ((word & bit) == 0);
40 static inline gboolean
41 is_set(
long long word,
long long bit)
43 return ((word & bit) == bit);
47 static inline gboolean
48 is_set_any(
long long word,
long long bit)
50 return ((word & bit) != 0);
54 gboolean
crm_str_eq(
const char *a,
const char *b, gboolean use_case);
60 #define safe_str_eq(a, b) crm_str_eq(a, b, FALSE) 76 long long crm_parse_ll(
const char *text,
const char *default_text);
79 int crm_parse_int(
const char *text,
const char *default_text);
82 # define crm_atoi(text, default_text) crm_parse_int(text, default_text) 88 #define crm_str_hash g_str_hash_traditional 97 static inline GHashTable *
98 crm_str_table_new(
void)
100 return g_hash_table_new_full(
crm_str_hash, g_str_equal, free, free);
104 static inline GHashTable *
105 crm_strcase_table_new(
void)
116 crm_hash_table_size(GHashTable *hashtable)
118 if (hashtable == NULL) {
121 return g_hash_table_size(hashtable);
139 crm_ftoa(
double a_float)
146 crm_ttoa(time_t epoch_time)
158 #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)
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)
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)