silc_tree_del

SYNOPSIS

    SilcBool silc_tree_del(SilcTree *tree, void *entry);

DESCRIPTION

Delete entry from the `tree'. If the `entry' is not the actual entry context that was added to the tree but is merely a temporary context it must be memset'ed to zero (0) initially. The deletion routine will assume that the given `entry' is the actual added entry context if its SilcTreeHeader structure is not zeroed when deleting the entry. If it is zeroed the deletion will first try to find the entry from the tree and then delete the found entry. See example for both cases.

Return FALSE if the entry does not exist in the tree. Returns TRUE after successful deletion.

EXAMPLE

 // Delete the entry, we have access to the originally added context
 silc_tree_del(tree, client_entry);

 // Delete client entry with ID 100
 FooEntry tmp;
 memset(&tmp, 0, sizeof(tmp));
 tmp.id = 100;
 silc_tree_del(tree, &tmp);

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