1 /*********************** -*- Mode: C -*- ***********************
2 * File : bintree_iterator_next.c
3 *---------------------------------------------------------------
4 * Description
5 * ===========
6 * This operation returns the next "clientnode" in an iteration.
7 *
8 * iter - the iterator instance to invoke this operation upon.
9 *
10 * RETURNS
11 * "clientnode" instance or NULL if the iteration has reached the end of the
12 * tree.
13 *---------------------------------------------------------------
14 * Author : Graeme McKerrell
15 * Created On : Wed Jan 28 10:34:26 2004
16 * Status : TESTED
17 *---------------------------------------------------------------
18 * HISTORY
19 * 7-Dec-2004 Graeme McKerrell
20 * Renamed to the "lub_" namespace
21 * 5-May-2004 Graeme McKerrell
22 * updates following review
23 * 9-Feb-2004 Graeme McKerrell
24 * updated to use new key structure
25 * 28-Jan-2004 Graeme McKerrell
26 * Initial version
27 *---------------------------------------------------------------
28 * Copyright (C) 2004 3Com Corporation. All Rights Reserved.
29 **************************************************************** */
30 #include "private.h"
31
32 /*--------------------------------------------------------- */
lub_bintree_iterator_next(lub_bintree_iterator_t * this)33 void *lub_bintree_iterator_next(lub_bintree_iterator_t * this)
34 {
35 void *clientnode = lub_bintree_findnext(this->tree, &this->key);
36
37 /* make sure that next time we've move onward */
38 lub_bintree_iterator_init(this, this->tree, clientnode);
39
40 return clientnode;
41 }
42
43 /*--------------------------------------------------------- */
44