C Collections

cjson · Section 3

cjson_dictionary_next

cjson_dictionary_next - step a dictionary cursor onto the next member

C Collections (libccollections, -lccollections)

#include <ccollections/cjson.h>
 
bool cjson_dictionary_next(cjson_dictionary_iter *it);

Moves the cursor it, which cjson_dictionary_first(3) filled, to the
member that comes after the current one in insertion order.  After a
call that returns true, it->key and it->value describe that member.
cjson_dictionary_first(3) describes the order, how long it->key
lives and which changes the cursor survives.

it  A cursor that cjson_dictionary_first(3) filled.

true when it stands on the next member.
 
false when the previous call gave the last member, and on every call
after that, and the function then sets it->key and it->value to
NULL.  Also false when it is NULL.

The cursor survives an insert, the replacement of any value and the
removal of any member except the one this call is about to read.
cjson_dictionary_first(3) gives the exact rule.

cjson_dictionary_first(3), cjson_dictionary_remove(3)