I use the convention "size = number of bytes" (as in sizeof), "count = number of elements" and so my sizeof(x)/sizeof(x[0]) macro is actually called COUNT.
In the BSDs (and some other code bases) the macro is spelled nitems and is common enough to be considered idiomatic.
Thank you. I did not know about this, I've been using the long version. nitems is defined in sys/param.h in OpenBSD and FreeBSD in case anyone is interested.
I always call my version lengthof() to match sizeof.
I use lengthof for lengths of string literals.
I always call mine "countof" to match the "sizeof" naming convention.