Symisc Systems

Libcox C/C++ API Reference - Array Type Processing

Star Follow @symisc


unsigned int libcox_array_count(libcox_value *pArray);

Return the total number of entries in a given array.


This routine return the total number of entries in a given libcox array. The libcox_value must be of type array obtained by a prior successful call to libcox_context_new_array() or passed as parameter to the foreign command.

Call libcox_value_is_array() to check if the given libcox_value is of the expected type. Also note that this routine is not thread-safe.



libcox_value to query which must be of type array.

Return value

This function return the total number of entries on success. 0 (zero) is returned if the target array is empty or the given libcox_value is not of the expected type (i.e: A scalar value such as an integer, Boolean, double, etc.).

See also

libcox_array_walk, libcox_array_insert, libcox_array_fetch.