cjson · Section 3
cjson_list_size, cjson_dictionary_size
NAME
cjson_list_size, cjson_dictionary_size - query composite node sizes
LIBRARY
C Collections (libccollections, -lccollections)
SYNOPSIS
#include <ccollections/cjson.h> size_t cjson_list_size(cjson node); size_t cjson_dictionary_size(cjson node);
DESCRIPTION
cjson_list_size() returns the number of child nodes of a CJSON_LIST node, and cjson_dictionary_size() the number of key-value pairs of a CJSON_DICTIONARY node. Both call ccol__fatal_err() when node is NULL and when node is not of the type that the function reads.
PARAMETERS
node A CJSON_LIST node for cjson_list_size(), or a CJSON_DICTIONARY
node for cjson_dictionary_size().
RETURN VALUE
The number of elements or keys, which is 0 for an empty list or dictionary. Neither function returns when node is NULL or of the wrong type.