NUMITEMS
Synopsis
#define NUMITEMS(type) (sizeof((type))/sizeof((type)[0]))
Description
This is a macro that returns the number of elements in an array. Note that only array definitions may be sized by this macro, not pointer definitions.
It is used wherever object templates are defined since the number of items in the template is always passed along with the template address into Cryptoki functions. Use of this macro is preferred to hard coding the number of items in the template that may change with code maintenance.