10 #ifndef PCMK__STRINGS_INTERNAL__H 11 #define PCMK__STRINGS_INTERNAL__H 19 #define PCMK__PARSE_INT_DEFAULT -1 20 #define PCMK__PARSE_DBL_DEFAULT -1.0 32 const char *default_text,
char **end_text);
39 const char *separator);
41 char **result,
unsigned int *result_len);
53 pcmk__str_eq(const
char *s1, const
char *s2, uint32_t
flags)
60 pcmk__add_word(
char **list,
size_t *len,
const char *word)
83 #define pcmk__plural_alt(i, s1, s2) (((i) == 1)? (s1) : (s2)) 86 #define pcmk__plural_s(i) pcmk__plural_alt(i, "", "s") 89 pcmk__str_empty(
const char *s)
91 return (s == NULL) || (s[0] ==
'\0');
95 static inline const char *
96 pcmk__btoa(
bool condition)
98 return condition?
"true" :
"false";
void pcmk__add_separated_word(char **list, size_t *len, const char *word, const char *separator)
bool pcmk__char_in_any_str(int ch,...) G_GNUC_NULL_TERMINATED
bool pcmk__strcase_any_of(const char *s,...) G_GNUC_NULL_TERMINATED
gboolean pcmk__str_in_list(GList *lst, const gchar *s)
bool pcmk__ends_with(const char *s, const char *match)
int pcmk__guint_from_hash(GHashTable *table, const char *key, guint default_val, guint *result)
int pcmk__compress(const char *data, unsigned int length, unsigned int max, char **result, unsigned int *result_len)
bool pcmk__str_any_of(const char *s,...) G_GNUC_NULL_TERMINATED
int pcmk__scan_double(const char *text, double *result, const char *default_text, char **end_text)
int pcmk__strcmp(const char *s1, const char *s2, uint32_t flags)
int pcmk__parse_ll_range(const char *srcstring, long long *start, long long *end)
bool pcmk__starts_with(const char *str, const char *prefix)
Check whether a string starts with a certain sequence.
bool pcmk__ends_with_ext(const char *s, const char *match)