cyaml · Section 3
cyaml_dictionary_next
NAME
cyaml_dictionary_next - step a dictionary cursor onto the next member
LIBRARY
C Collections (libccollections, -lccollections)
SYNOPSIS
#include <ccollections/cyaml.h> bool cyaml_dictionary_next(cyaml_dictionary_iter *it);
DESCRIPTION
Moves the cursor it, which cyaml_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. The cursor has held that member since it reached the current one, so any change that leaves that successor in place keeps it valid: A replacement of any value, the removal of any other member, and an insert. Removing the successor or destroying the dictionary invalidates it. cyaml_dictionary_first(3) describes the order, how long it->key and it->value live, and each of those changes.
PARAMETERS
it A cursor that cyaml_dictionary_first(3) filled.
RETURN VALUE
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.
NOTES
Removing the current member with cyaml_dictionary_remove(3) leaves the cursor valid, but removing the successor or destroying the dictionary doesn't. cyaml_dictionary_first(3) lists every change and its effect.