summaryrefslogtreecommitdiff
path: root/src/util/array.h
blob: 2e0995256280a96bc1de51395d3230d95ff7ec4c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#ifndef _SK_UTIL_ARRAY_H
#define _SK_UTIL_ARRAY_H

#include <stddef.h>

#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