|
Orcania
Potluck with different functions for different purposes that can be shared among C programs
|
Functions | |
| size_t | split_string (const char *string, const char *separator, char ***return_array) |
| void | free_string_array (char **array) |
| size_t | string_array_size (char **array) |
| int | string_array_has_value (const char **array, const char *needle) |
| int | string_array_has_value_case (const char **array, const char *needle) |
| int | string_array_has_value_n (const char **array, const char *needle, size_t len) |
| int | string_array_has_value_ncase (const char **array, const char *needle, size_t len) |
| int | string_array_has_trimmed_value (const char **array, const char *needle) |
| char * | string_array_join (const char **array, const char *separator) |
| void free_string_array | ( | char ** | array | ) |
Clean an array of strings
| array | an array of char * to free using o_free for each element the last element of array must be a NULL |
| size_t split_string | ( | const char * | string, |
| const char * | separator, | ||
| char *** | return_array | ||
| ) |
Split a string into an array of strings using separator string return the number of elements to be returned, 0 on error
| string | the string to split |
| separator | the string separator, will not be included in the result |
| return_array | an reference to a char ** that will be heap-allocated by the function The last element in return_array will be NULL |
| int string_array_has_trimmed_value | ( | const char ** | array, |
| const char * | needle | ||
| ) |
Check if an array of string has a specified trimmed value
| array | an array of char * with NULL in the last element |
| needle | the value to look for in array |
| int string_array_has_value | ( | const char ** | array, |
| const char * | needle | ||
| ) |
Check if an array of string has a specified value, case sensitive
| array | an array of char * with NULL in the last element |
| needle | the value to look for in array |
| int string_array_has_value_case | ( | const char ** | array, |
| const char * | needle | ||
| ) |
Check if an array of string has a specified value, case insensitive
| array | an array of char * with NULL in the last element |
| needle | the value to look for in array |
| int string_array_has_value_n | ( | const char ** | array, |
| const char * | needle, | ||
| size_t | len | ||
| ) |
Check if an array of string has a specified value, case sensitive, limit to len characters
| array | an array of char * with NULL in the last element |
| needle | the value to look for in array |
| len | the length of needle |
| int string_array_has_value_ncase | ( | const char ** | array, |
| const char * | needle, | ||
| size_t | len | ||
| ) |
Check if an array of string has a specified value, case insensitive, limit to len characters
| array | an array of char * with NULL in the last element |
| needle | the value to look for in array |
| len | the length of needle |
| char * string_array_join | ( | const char ** | array, |
| const char * | separator | ||
| ) |
Join a string array into a single string
| array | an array of char * with NULL in the last element |
| separator | a string to put between the elements |
| size_t string_array_size | ( | char ** | array | ) |
Count the number of elements in an array of strings
| array | an array of char * with NULL in the last element |