X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/90edb255effd0d29d94e662ca5bf3e9eda7ed122..9322ba2854211794c27fae9468768b80b767c211:/h/mh.h diff --git a/h/mh.h b/h/mh.h index 55825da0..67b71702 100644 --- a/h/mh.h +++ b/h/mh.h @@ -43,6 +43,9 @@ typedef unsigned char boolean; /* not int so we can pack in a structure */ #define NMH_UNUSED(i) i #endif +/* DIM gives the number of elements in the one-dimensional array a. */ +#define DIM(a) (sizeof (a) / sizeof (*(a))) + /* LEN gives the strlen() of string constant s, excluding the * terminating NUL. */ #define LEN(s) (sizeof (s) - 1)