20 #ifndef CRM_COMMON_INTERNAL__H
21 #define CRM_COMMON_INTERNAL__H
26 #include <sys/types.h>
38 gboolean
crm_is_writable(
const char *dir,
const char *file,
const char *user,
const char *group,
63 char *
crm_concat(
const char *prefix,
const char *suffix,
char join);
71 unsigned int *result_len);
75 crm_strlen_zero(
const char *s)
77 return !s || *s ==
'\0';
88 #define CRM_FAIL_COUNT_PREFIX "fail-count"
89 #define CRM_LAST_FAILURE_PREFIX "last-failure"
109 crm_fail_attr_name(
const char *prefix,
const char *rsc_id,
const char *op,
112 CRM_CHECK(prefix && rsc_id && op,
return NULL);
117 crm_failcount_name(
const char *rsc_id,
const char *op,
int interval)
123 crm_lastfailure_name(
const char *rsc_id,
const char *op,
int interval)
#define CRM_CHECK(expr, failure_action)
void crm_schema_init(void)
int get_last_sequence(const char *directory, const char *series)
#define CRM_LAST_FAILURE_PREFIX
long long crm_int_helper(const char *text, char **end_text)
void crm_schema_cleanup(void)
char * generate_series_filename(const char *directory, const char *series, int sequence, gboolean bzip)
bool crm_starts_with(const char *str, const char *prefix)
Check whether a string starts with a certain sequence.
Wrappers for and extensions to libqb logging.
char * crm_read_contents(const char *filename)
#define CRM_FAIL_COUNT_PREFIX
char * add_list_element(char *list, const char *value)
gint crm_alpha_sort(gconstpointer a, gconstpointer b)
Compare two strings alphabetically (case-insensitive)
int crm_set_nonblocking(int fd)
gboolean crm_ends_with_ext(const char *s, const char *match)
gboolean crm_ends_with(const char *s, const char *match)
int crm_procfs_process_info(struct dirent *entry, char *name, int *pid)
gboolean crm_is_writable(const char *dir, const char *file, const char *user, const char *group, gboolean need_both)
void write_last_sequence(const char *directory, const char *series, int sequence, int max)
bool crm_compress_string(const char *data, int length, int max, char **result, unsigned int *result_len)
unsigned int crm_procfs_num_cores(void)
int crm_write_sync(int fd, const char *contents)
int crm_chown_last_sequence(const char *directory, const char *series, uid_t uid, gid_t gid)
void crm_sync_directory(const char *name)
char * crm_concat(const char *prefix, const char *suffix, char join)
int crm_procfs_pid_of(const char *name)
char * crm_strdup_printf(char const *format,...) __attribute__((__format__(__printf__
void g_hash_destroy_str(gpointer data)