Mercurial > molko
comparison src/util.h @ 47:f053a9f38c0e
core: implement basic scrolling, closes #2459
author | David Demelier <markand@malikania.fr> |
---|---|
date | Thu, 16 Jan 2020 13:32:20 +0100 |
parents | 9d1421c09dfb |
children |
comparison
equal
deleted
inserted
replaced
46:b815621df3e3 | 47:f053a9f38c0e |
---|---|
18 | 18 |
19 #ifndef MOLKO_UTIL_H | 19 #ifndef MOLKO_UTIL_H |
20 #define MOLKO_UTIL_H | 20 #define MOLKO_UTIL_H |
21 | 21 |
22 #include <stddef.h> | 22 #include <stddef.h> |
23 | |
24 /** | |
25 * Get the number of elements in a static array. | |
26 * | |
27 * \param x the array | |
28 * \return the number of elements | |
29 */ | |
30 #define nelem(x) sizeof ((x)) / sizeof ((x)[0]) | |
23 | 31 |
24 /** | 32 /** |
25 * Wrapper around malloc(3) that exits on allocation failure. | 33 * Wrapper around malloc(3) that exits on allocation failure. |
26 * | 34 * |
27 * \param size the size | 35 * \param size the size |