From 5d29fe79d30f430ae326d9dc57ccfaed6fe61328 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Tue, 8 Mar 2016 16:10:33 +0100 Subject: Another full update of current work --- include/utils/narray.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 include/utils/narray.h (limited to 'include/utils/narray.h') diff --git a/include/utils/narray.h b/include/utils/narray.h new file mode 100644 index 0000000..814d87d --- /dev/null +++ b/include/utils/narray.h @@ -0,0 +1,21 @@ +#include +#include + +#ifndef _IOE_NARRAY_H_ +#define _IOE_NARRAY_H_ +#ifdef CONFIG_IOE_NARRAY + +void narray_add(void ***array, void *data); +void narray_remove(void ***array, void *data); +size_t narray_size(void ***array); +inline void narray_free(void ***array) { + if (array != NULL) { + free(*array); + *array = NULL; + } +} + +#define fornarray(array, i, data) for (i = 0; (data = array[i]) != 0; i++) + +#endif /* CONFIG_IOE_NARRAY */ +#endif /* _IOE_NARRAY_H_ */ -- cgit v1.2.3