x_cstr_ends_with
Checks whether the string ends with the specified suffix.
X_STRING_API bool x_cstr_ends_with(
const char *str,
const char *suffix
);
Parameters
const char *str
- Input C-string.
const char *suffix
- Suffix to match.
Returns
true if the condition holds; false otherwise.
x_cstr_ends_with_ci
Case-insensitive check whether the string ends with the specified suffix.
X_STRING_API bool x_cstr_ends_with_ci(
const char *str,
const char *suffix
);
Parameters
const char *str
- Input C-string.
const char *suffix
- Suffix to match.
Returns
true if the condition holds; false otherwise.
x_cstr_hash
Computes a 32-bit FNV hash for a null-terminated C-string.
X_STRING_API uint32_t x_cstr_hash(const char *str);
Parameters
const char *str
- Input C-string.
x_cstr_starts_with
Checks whether a null-terminated C-string starts with the given prefix.
X_STRING_API bool x_cstr_starts_with(
const char *str,
const char *prefix
);
Parameters
const char *str
- Input C-string.
const char *prefix
- Prefix to match.
Returns
true if the condition holds; false otherwise.
x_cstr_starts_with_ci
Checks whether a null-terminated C-string starts with the given prefix.
X_STRING_API bool x_cstr_starts_with_ci(
const char *str,
const char *prefix
);
Parameters
const char *str
- Input C-string.
const char *prefix
- Prefix to match.
Returns
true if the condition holds; false otherwise.
x_cstr_str
Searches for a substring within a null-terminated C-string.
X_STRING_API char * x_cstr_str(
const char *haystack,
const char *needle
);
Parameters
const char *haystack
- Input string to search in.
const char *needle
- Substring to search for.
Returns
pointer within haystack where needle is found