Iterators are used to scan the sections in a given file,
or the keys in a given section. Applications can use this
feature to store lists of data, by dynamically generating
key or section names to save and later iterating over
them to discover what was saved. The functions are
summarized in Figure 6 in the
section called Section Iterators.
An iterator is an opaque data type; you pass gnome_config_init_iterator() the name of
a section to iterate over and receive an iterator in
return. You then call
gnome_config_iterator_next() to obtain key-value
pairs from the section. The key and value returned from
gnome_config_iterator_next()
must be freed with g_free(),
and the return value of
gnome_config_iterator_next() is a pointer to the
next iterator. When
gnome_config_iterator_next() returns NULL, all key-value pairs have been
traversed.