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);
44 static inline gboolean
45 is_set(
long long word,
long long bit)
47 return ((word & bit) == bit);
51 static inline gboolean
52 is_set_any(
long long word,
long long bit)
54 return ((word & bit) != 0);
58 gboolean
crm_str_eq(
const char *a,
const char *b, gboolean use_case);
64 #define safe_str_eq(a, b) crm_str_eq(a, b, FALSE) 83 long long crm_parse_ll(
const char *text,
const char *default_text);
86 int crm_parse_int(
const char *text,
const char *default_text);
89 # define crm_atoi(text, default_text) crm_parse_int(text, default_text) 95 #define crm_str_hash g_str_hash_traditional 104 static inline GHashTable *
105 crm_str_table_new(
void)
107 return g_hash_table_new_full(
crm_str_hash, g_str_equal, free, free);
111 static inline GHashTable *
112 crm_strcase_table_new(
void)
123 crm_hash_table_size(GHashTable *hashtable)
125 if (hashtable == NULL) {
128 return g_hash_table_size(hashtable);
146 crm_ftoa(
double a_float)
153 crm_ttoa(time_t epoch_time)
171 #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 * score2char(int score)
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)
char * score2char_stack(int score, char *buf, size_t len)
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)