C Collections

cjson · Section 3

cjson_list_size, cjson_dictionary_size

cjson_list_size, cjson_dictionary_size - query composite node sizes

C Collections (libccollections, -lccollections)

#include <ccollections/cjson.h>
 
size_t cjson_list_size(cjson node);
size_t cjson_dictionary_size(cjson node);

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.

node  A CJSON_LIST node for cjson_list_size(), or a CJSON_DICTIONARY
      node for cjson_dictionary_size().

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.

cjson_list_get(3), cjson_dictionary_get(3)