silc_tree_enumerate

SYNOPSIS

    void *silc_tree_enumerate(SilcTree *tree, void *at);

DESCRIPTION

Enumerates the `tree' starting/continuing at the `at'. When `at' is NULL this will start enumeration from the root of the tree. The found entry must be given as `at' for next call to continue the enumeration in order. The enumeration is done in ascending order starting from the smallest value. If there are duplicates in the tree, their order is undefined. Returns NULL at the end of the enumeration.

EXAMPLE

 // Start enumerating from beginning in order
 for (entry = silc_tree_enumerate(tree, NULL); entry != NULL;
      entry = silc_tree_enumerate(tree, entry))
   printf("Client entry %s\n", entry->name);

 // Delete all entries from the tree
 while ((entry = silc_tree_enumerate(tree, NULL)))
   silc_tree_del(tree, entry);