#include <stdbool.h>
#include <glib.h>
Go to the source code of this file.
|
int | pcmk__scan_double (const char *text, double *result, const char *default_text, char **end_text) |
|
int | pcmk__guint_from_hash (GHashTable *table, const char *key, guint default_val, guint *result) |
|
bool | pcmk__starts_with (const char *str, const char *prefix) |
| Check whether a string starts with a certain sequence. More...
|
|
bool | pcmk__ends_with (const char *s, const char *match) |
|
bool | pcmk__ends_with_ext (const char *s, const char *match) |
|
void | pcmk__add_separated_word (char **list, size_t *len, const char *word, const char *separator) |
|
int | pcmk__compress (const char *data, unsigned int length, unsigned int max, char **result, unsigned int *result_len) |
|
int | pcmk__parse_ll_range (const char *srcstring, long long *start, long long *end) |
|
gboolean | pcmk__str_in_list (GList *lst, const gchar *s) |
|
bool | pcmk__strcase_any_of (const char *s,...) G_GNUC_NULL_TERMINATED |
|
bool | pcmk__str_any_of (const char *s,...) G_GNUC_NULL_TERMINATED |
|
bool | pcmk__char_in_any_str (int ch,...) G_GNUC_NULL_TERMINATED |
|
int | pcmk__strcmp (const char *s1, const char *s2, uint32_t flags) |
|
◆ PCMK__PARSE_DBL_DEFAULT
#define PCMK__PARSE_DBL_DEFAULT -1.0 |
◆ PCMK__PARSE_INT_DEFAULT
#define PCMK__PARSE_INT_DEFAULT -1 |
◆ pcmk__plural_alt
#define pcmk__plural_alt |
( |
|
i, |
|
|
|
s1, |
|
|
|
s2 |
|
) |
| (((i) == 1)? (s1) : (s2)) |
◆ pcmk__plural_s
◆ pcmk__str_flags
Enumerator |
---|
pcmk__str_none | |
pcmk__str_casei | |
pcmk__str_null_matches | |
pcmk__str_regex | |
Definition at line 24 of file strings_internal.h.
◆ pcmk__add_separated_word()
void pcmk__add_separated_word |
( |
char ** |
list, |
|
|
size_t * |
len, |
|
|
const char * |
word, |
|
|
const char * |
separator |
|
) |
| |
◆ pcmk__char_in_any_str()
bool pcmk__char_in_any_str |
( |
int |
ch, |
|
|
|
... |
|
) |
| |
◆ pcmk__compress()
int pcmk__compress |
( |
const char * |
data, |
|
|
unsigned int |
length, |
|
|
unsigned int |
max, |
|
|
char ** |
result, |
|
|
unsigned int * |
result_len |
|
) |
| |
◆ pcmk__ends_with()
bool pcmk__ends_with |
( |
const char * |
s, |
|
|
const char * |
match |
|
) |
| |
◆ pcmk__ends_with_ext()
bool pcmk__ends_with_ext |
( |
const char * |
s, |
|
|
const char * |
match |
|
) |
| |
◆ pcmk__guint_from_hash()
int pcmk__guint_from_hash |
( |
GHashTable * |
table, |
|
|
const char * |
key, |
|
|
guint |
default_val, |
|
|
guint * |
result |
|
) |
| |
◆ pcmk__parse_ll_range()
int pcmk__parse_ll_range |
( |
const char * |
srcstring, |
|
|
long long * |
start, |
|
|
long long * |
end |
|
) |
| |
◆ pcmk__scan_double()
int pcmk__scan_double |
( |
const char * |
text, |
|
|
double * |
result, |
|
|
const char * |
default_text, |
|
|
char ** |
end_text |
|
) |
| |
◆ pcmk__starts_with()
bool pcmk__starts_with |
( |
const char * |
str, |
|
|
const char * |
prefix |
|
) |
| |
Check whether a string starts with a certain sequence.
- Parameters
-
[in] | str | String to check |
[in] | prefix | Sequence to match against beginning of str |
- Returns
true
if str
begins with match, false
otherwise
- Note
- This is equivalent to !strncmp(s, prefix, strlen(prefix)) but is likely less efficient when prefix is a string literal if the compiler optimizes away the strlen() at compile time, and more efficient otherwise.
Definition at line 452 of file strings.c.
◆ pcmk__str_any_of()
bool pcmk__str_any_of |
( |
const char * |
s, |
|
|
|
... |
|
) |
| |
◆ pcmk__str_in_list()
gboolean pcmk__str_in_list |
( |
GList * |
lst, |
|
|
const gchar * |
s |
|
) |
| |
◆ pcmk__strcase_any_of()
bool pcmk__strcase_any_of |
( |
const char * |
s, |
|
|
|
... |
|
) |
| |
◆ pcmk__strcmp()
int pcmk__strcmp |
( |
const char * |
s1, |
|
|
const char * |
s2, |
|
|
uint32_t |
flags |
|
) |
| |