From 26f555c974cf49def75120dada596f421e15f1d4 Mon Sep 17 00:00:00 2001 From: Dennis Camera Date: Wed, 3 Aug 2022 17:41:14 +0200 Subject: Move helper functions out to src/util/ --- src/util/array.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/util/array.h (limited to 'src/util/array.h') diff --git a/src/util/array.h b/src/util/array.h new file mode 100644 index 0000000..2e09952 --- /dev/null +++ b/src/util/array.h @@ -0,0 +1,18 @@ +#ifndef _SK_UTIL_ARRAY_H +#define _SK_UTIL_ARRAY_H + +#include + +#define arraylen(a) (sizeof(a)/sizeof(*a)) + +/** + * anullidx: + * Returns the index of the first NULL element in an array. + * + * @param a: the array to search + * @returns the index of the first NULL element / the number of elements before + * NULL. + */ +size_t anullidx(void *a[]); + +#endif -- cgit v1.2.3