aboutsummaryrefslogtreecommitdiff
path: root/include/utils/narray.h
blob: 814d87d65ef8cc247b704ec6b90a87d28494df91 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <stdlib.h>
#include <stdint.h>

#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_ */