Data Structures | |
struct | mirkl_str_list_t_ |
List of strings. More... | |
Typedefs | |
typedef struct mirkl_str_list_t_ | mirkl_str_list_t |
List of strings. | |
Functions | |
mirkl_error_t * | mirkl_strlist_create (mirkl_str_list_t **slist, apr_pool_t *pool) |
void | mirkl_strlist_destroy (mirkl_str_list_t *slist) |
void | mirkl_strlist_clear (mirkl_str_list_t *slist) |
mirkl_error_t * | mirkl_strlist_addfirst (mirkl_str_list_t *slist, const char *str, apr_pool_t *pool) |
mirkl_error_t * | mirkl_strlist_addlast (mirkl_str_list_t *slist, const char *str, apr_pool_t *pool) |
char * | mirkl_strlist_getn (mirkl_str_list_t *slist, int n) |
mirkl_error_t * | mirkl_strlist_copy (mirkl_str_list_t *dst, mirkl_str_list_t *src, apr_pool_t *pool) |
int | mirkl_strlist_is_exists (mirkl_str_list_t *slist, const char *str) |
int | mirkl_strlist_nelts (mirkl_str_list_t *slist) |
mirkl_error_t * | mirkl_strlist_tokenize (mirkl_str_list_t *slistInp, mirkl_str_list_t *slistOut, const char *seps, apr_pool_t *pool) |
mirkl_size_t | mirkl_str_strlcat (char *dst, const char *src, mirkl_size_t siz) |
appends the NUL-terminated string src to the end of dst. It will append at most (size - strlen(dst) - 1) bytes, NUL-terminating the result. More... | |
mirkl_size_t | mirkl_str_strlcpy (char *dst, const char *src, mirkl_size_t siz) |
copies up to (size - 1) characters from the NUL-terminated string src to dst, NUL-terminating the result. More... | |
int | mirkl_str_stricmp (const char *s1, const char *s2) |
int | mirkl_str_len (const char *s) |
mirkl_size_t | mirkl_str_utf8_len (const char *s) |
char * | mirkl_str_trim (char *str) |
mirkl_error_t * | mirkl_str_to_double (const char *str, double *val) |
mirkl_error_t * | mirkl_str_to_integer (const char *str, int *val) |
mirkl_error_t * | mirkl_str_to_int64 (const char *str, mirkl_int64_t *val) |
int | mirkl_str_int64_to_base62 (mirkl_int64_t num, int base, char *out, mirkl_size_t len) |
Return string representation of a signed 64-bit integer in the defined base. More... | |
mirkl_error_t * | mirkl_str_base62_to_int64 (const char *nptr, char **endptr, int base, mirkl_int64_t *val) |
Convert string representing an integer in particular base to a signed 64-bit integer in base 10. More... | |
mirkl_bool_t | mirkl_str_is_integer (const char *str) |
Checks whether string represents a valid signed integer. More... | |
mirkl_error_t * | mirkl_str_escape_parse (char *buf, mirkl_size_t *len, const char *inbuf, mirkl_size_t inlen, int wide_char_string, int use_unicode) |
Search for escape sequences, parse them and substitute with binary representation. More... | |
mirkl_error_t * | mirkl_str_escape_unparse (char *buf, mirkl_size_t *len, const char *inbuf, mirkl_size_t inlen) |
This function is inverse to mirkl_str_escape_parse. It transforms parsed sequences back to escaped form. More... | |
char * | mirkl_str_replace (const char *str, const char *substr, const char *replace) |
Creates a new string as a result of replacement of a substring in the original string. More... | |
char * | mirkl_str_replace_all (const char *str, const char *substr, const char *replace) |
Same as mirkl_str_replace but does all possible replacements. More... | |
char * | mirkl_str_replace_char (char *str, char find, char replace) |
Replaces all occurrences of a character in a string by another character. More... | |
int | mirkl_str_asprintf (char **buf, const char *msg_format,...) __attribute__((format(printf |
Portable asprintf function. More... | |
int int | mirkl_str_vasprintf (char **buf, const char *msg_format, va_list arg_buffer) |
Portable vasprintf function. More... | |
int | mirkl_str_snprintf (char *buf, mirkl_size_t siz, const char *msg_format,...) __attribute__((format(printf |
Portable snprintf function. More... | |
int char * | mirkl_str_pvsprintf (apr_pool_t *pool, const char *msg_format, va_list arg_buffer) |
char * | mirkl_str_psprintf (apr_pool_t *pool, const char *msg_format,...) __attribute__((format(printf |
int mirkl_str_asprintf | ( | char ** | buf, |
const char * | msg_format, | ||
... | |||
) |
Portable asprintf function.
[out] | buf | Allocated bufer with string. |
mirkl_error_t * mirkl_str_base62_to_int64 | ( | const char * | nptr, |
char ** | endptr, | ||
int | base, | ||
mirkl_int64_t * | val | ||
) |
Convert string representing an integer in particular base to a signed 64-bit integer in base 10.
[in] | nptr | Pointer to the string to be converted. |
[in,out] | endptr | If not NULL this will be set to the first invalid character. |
[in] | base | Original base of the number in the input string. The valid values of the base are between 2 and 62. |
[out] | val | Converted value on the output. |
mirkl_error_t * mirkl_str_escape_parse | ( | char * | buf, |
mirkl_size_t * | len, | ||
const char * | inbuf, | ||
mirkl_size_t | inlen, | ||
int | wide_char_string, | ||
int | use_unicode | ||
) |
Search for escape sequences, parse them and substitute with binary representation.
[io,out] | buf Buffer for parsed string. This buffer must be long enough to contain the parsed string. | |
[in,out] | len | On input this must be the maximal length of the output buffer. On output this variable contains the length of parsed string. |
[in] | inbuf | String to be parsed. |
[in] | inlen | Length of the string to be parsed. |
[in] | wide_char_string | If not zero, then parsed escape sequences can be represented as wide characters, see https://en.wikipedia.org/wiki/Wide_character |
[in] | use_unicode | If not zero, then parsed escape sequences can be represented as Unicode characters. This also requires that wide_char_string is not zero. |
mirkl_error_t * mirkl_str_escape_unparse | ( | char * | buf, |
mirkl_size_t * | len, | ||
const char * | inbuf, | ||
mirkl_size_t | inlen | ||
) |
This function is inverse to mirkl_str_escape_parse. It transforms parsed sequences back to escaped form.
[io,out] | buf Buffer for output string. This buffer must be long enough to contain the output string. | |
[in,out] | len | On input this must be the maximal length of the output buffer. On output this variable contains the length of the output string. |
[in] | inbuf | String to be processed. |
[in] | inlen | Length of the string to be processed. |
int mirkl_str_int64_to_base62 | ( | mirkl_int64_t | num, |
int | base, | ||
char * | out, | ||
mirkl_size_t | len | ||
) |
Return string representation of a signed 64-bit integer in the defined base.
[in] | num | Number to be converted to a string. |
[in] | base | Conversion must be done for this base. The valid values of the base are between 2 and 62. |
[out] | out | Preallocated buffer for output string. The buffer must be at least 66 bytes long. |
[in] | len | Length of the buffer. |
mirkl_bool_t mirkl_str_is_integer | ( | const char * | str | ) |
Checks whether string represents a valid signed integer.
char * mirkl_str_psprintf | ( | apr_pool_t * | pool, |
const char * | msg_format, | ||
... | |||
) |
Portable analog of sprintf function, in which buffer is allocated from an APR pool
pool | The pool to allocate out of |
msg_format | The format of the string |
... | The arguments to use while printing the data |
int char * mirkl_str_pvsprintf | ( | apr_pool_t * | pool, |
const char * | msg_format, | ||
va_list | arg_buffer | ||
) |
Portable analog of vsprintf function, in which buffer is allocated from an APR pool
pool | The pool to allocate out of |
msg_format | The format of the string |
arg_buffer | The arguments to use while printing the data |
char * mirkl_str_replace | ( | const char * | str, |
const char * | substr, | ||
const char * | replace | ||
) |
Creates a new string as a result of replacement of a substring in the original string.
[in] | str | Original string. |
[in] | substr | Substring to be replaced. |
[in] | replace | Replacement string. |
char * mirkl_str_replace_all | ( | const char * | str, |
const char * | substr, | ||
const char * | replace | ||
) |
Same as mirkl_str_replace but does all possible replacements.
char * mirkl_str_replace_char | ( | char * | str, |
char | find, | ||
char | replace | ||
) |
Replaces all occurrences of a character in a string by another character.
[in] | str | Original string. |
[in] | find | Character to find and replace. |
[in] | replace | New character. |
int mirkl_str_snprintf | ( | char * | buf, |
mirkl_size_t | siz, | ||
const char * | msg_format, | ||
... | |||
) |
Portable snprintf function.
[in,out] | buf | preallocated bufer in which the resulting string is printed. |
[in] | siz | size of preallocated buffer. |
mirkl_size_t mirkl_str_strlcat | ( | char * | dst, |
const char * | src, | ||
mirkl_size_t | siz | ||
) |
appends the NUL-terminated string src to the end of dst. It will append at most (size - strlen(dst) - 1) bytes, NUL-terminating the result.
mirkl_size_t mirkl_str_strlcpy | ( | char * | dst, |
const char * | src, | ||
mirkl_size_t | siz | ||
) |
copies up to (size - 1) characters from the NUL-terminated string src to dst, NUL-terminating the result.
int int mirkl_str_vasprintf | ( | char ** | buf, |
const char * | msg_format, | ||
va_list | arg_buffer | ||
) |
Portable vasprintf function.
[out] | buf | Allocated bufer with string. |