ecoli_string - Man Page
Name
ecoli_string — String manipulation
— Helpers for strings manipulation.
Synopsis
Functions
size_t ec_strcmp_count (const char *s1, const char *s2)
int ec_str_startswith (const char *s, const char *beginning)
bool ec_str_is_space (const char *s)
int ec_str_parse_llint (const char *str, unsigned int base, int64_t min, int64_t max, int64_t *val)
int ec_str_parse_ullint (const char *str, unsigned int base, uint64_t min, uint64_t max, uint64_t *val)
char * ec_str_quote (const char *str, char quote)
Detailed Description
Helpers for strings manipulation.
Function Documentation
size_t ec_strcmp_count (const char * s1, const char * s2)
count the number of identical chars at the beginning of 2 strings
int ec_str_startswith (const char * s, const char * beginning)
return 1 if 's' starts with 'beginning'
bool ec_str_is_space (const char * s)
return true if string is only composed of spaces (' ', '
int ec_str_parse_llint (const char * str, unsigned int base, int64_t min, int64_t max, int64_t * val)
Parse a string for a signed integer.
- Parameters
str The string to parse.
base The base (0 means "guess").
min The minimum allowed value.
max The maximum allowed value.
val The pointer to the value to be set on success.- Returns
On success, return 0. Else, return -1 and set errno.
int ec_str_parse_ullint (const char * str, unsigned int base, uint64_t min, uint64_t max, uint64_t * val)
Parse a string for an unsigned integer.
- Parameters
str The string to parse.
base The base (0 means "guess").
min The minimum allowed value.
max The maximum allowed value.
val The pointer to the value to be set on success.- Returns
On success, return 0. Else, return -1 and set errno.
char * ec_str_quote (const char * str, char quote)
Quote a string, escaping nested quotes.
- Parameters
str The string to quote.
quote The quote character to use: usually " or ' but can be anything. If 0, select between " or ' automatically.- Returns
An allocated string, that must be freed by the caller using free().
Author
Generated automatically by Doxygen for Libecoli from the source code.
Referenced By
The man pages ec_strcmp_count(3), ec_str_is_space(3), ec_str_parse_llint(3), ec_str_parse_ullint(3), ec_str_quote(3) and ec_str_startswith(3) are aliases of ecoli_string(3).