23void **
arr_cut(
void **arr,
int len);
25int arr_has(
void **arr,
void *content,
26 int (*
compare)(
void *,
void *));
30 void *(*
copy)(
void *));
31void *
err(
const char *str,
void *retval);
void ** arr_cut(void **arr, int len)
Create new null-terminated array containing first len elements of arr.
void ** arr_free(void **arr)
Free each element in a null-terminated array, and then the array itself.
int arr_has(void **arr, void *content, int(*compare)(void *, void *))
Check null-terminated array arr for entry content using comparison function compare.
int arr_len(void **arr)
Count number of elements in a null-terminated array.
void ** dedupe(void **arr, int(*compare)(void *, void *), void *(*copy)(void *))
Create new null-terminated array containing only unique values from arr, checked with compare,...
void * err(const char *str, void *retval)
Wrapper around perror() that always returns retval.
static void * copy(void *str)
Duplicate a path string and append a forward slash.
static int compare(void *a, void *b)
Compare path string a against path string b, which will always have a trailing forward slash.