#include <crm_internal.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <bzlib.h>
#include <sys/types.h>
Go to the source code of this file.
|
char * | crm_concat (const char *prefix, const char *suffix, char join) |
|
char * | crm_itoa_stack (int an_int, char *buffer, size_t len) |
|
char * | crm_itoa (int an_int) |
|
void | g_hash_destroy_str (gpointer data) |
|
long long | crm_int_helper (const char *text, char **end_text) |
|
int | crm_parse_int (const char *text, const char *default_text) |
|
gboolean | safe_str_neq (const char *a, const char *b) |
|
gboolean | crm_is_true (const char *s) |
|
int | crm_str_to_boolean (const char *s, int *ret) |
|
char * | crm_strip_trailing_newline (char *str) |
|
gboolean | crm_str_eq (const char *a, const char *b, gboolean use_case) |
|
bool | crm_starts_with (const char *str, const char *prefix) |
| Check whether a string starts with a certain sequence. More...
|
|
gboolean | crm_ends_with (const char *s, const char *match) |
|
gboolean | crm_ends_with_ext (const char *s, const char *match) |
|
guint | g_str_hash_traditional (gconstpointer v) |
|
guint | crm_strcase_hash (gconstpointer v) |
|
GHashTable * | crm_str_table_dup (GHashTable *old_table) |
|
char * | add_list_element (char *list, const char *value) |
|
bool | crm_compress_string (const char *data, int length, int max, char **result, unsigned int *result_len) |
|
gint | crm_alpha_sort (gconstpointer a, gconstpointer b) |
| Compare two strings alphabetically (case-insensitive) More...
|
|
char* add_list_element |
( |
char * |
list, |
|
|
const char * |
value |
|
) |
| |
gint crm_alpha_sort |
( |
gconstpointer |
a, |
|
|
gconstpointer |
b |
|
) |
| |
Compare two strings alphabetically (case-insensitive)
- Parameters
-
[in] | a | First string to compare |
[in] | b | Second string to compare |
- Returns
- 0 if strings are equal, -1 if a < b, 1 if a > b
- Note
- Usable as a GCompareFunc with g_list_sort(). NULL is considered less than non-NULL.
Definition at line 472 of file strings.c.
bool crm_compress_string |
( |
const char * |
data, |
|
|
int |
length, |
|
|
int |
max, |
|
|
char ** |
result, |
|
|
unsigned int * |
result_len |
|
) |
| |
char* crm_concat |
( |
const char * |
prefix, |
|
|
const char * |
suffix, |
|
|
char |
join |
|
) |
| |
gboolean crm_ends_with |
( |
const char * |
s, |
|
|
const char * |
match |
|
) |
| |
gboolean crm_ends_with_ext |
( |
const char * |
s, |
|
|
const char * |
match |
|
) |
| |
long long crm_int_helper |
( |
const char * |
text, |
|
|
char ** |
end_text |
|
) |
| |
gboolean crm_is_true |
( |
const char * |
s | ) |
|
char* crm_itoa |
( |
int |
an_int | ) |
|
char* crm_itoa_stack |
( |
int |
an_int, |
|
|
char * |
buffer, |
|
|
size_t |
len |
|
) |
| |
int crm_parse_int |
( |
const char * |
text, |
|
|
const char * |
default_text |
|
) |
| |
bool crm_starts_with |
( |
const char * |
str, |
|
|
const char * |
prefix |
|
) |
| |
Check whether a string starts with a certain sequence.
- Parameters
-
[in] | str | String to check |
[in] | match | 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 252 of file strings.c.
gboolean crm_str_eq |
( |
const char * |
a, |
|
|
const char * |
b, |
|
|
gboolean |
use_case |
|
) |
| |
GHashTable* crm_str_table_dup |
( |
GHashTable * |
old_table | ) |
|
int crm_str_to_boolean |
( |
const char * |
s, |
|
|
int * |
ret |
|
) |
| |
guint crm_strcase_hash |
( |
gconstpointer |
v | ) |
|
char* crm_strip_trailing_newline |
( |
char * |
str | ) |
|
void g_hash_destroy_str |
( |
gpointer |
data | ) |
|
guint g_str_hash_traditional |
( |
gconstpointer |
v | ) |
|
gboolean safe_str_neq |
( |
const char * |
a, |
|
|
const char * |
b |
|
) |
| |