f4ebe841a5
FossilOrigin-Name: 8a43dd9d05a4cb73210243ddd8df2a26f16c7ef2c4d4e36ab446de1f65d88223
18 lines
300 B
C
18 lines
300 B
C
#include "avltree.h"
|
|
|
|
|
|
|
|
int avltree_foreach_lr(struct avlnode *n, int (*callback)(void *,void *),void *cbpriv)
|
|
{
|
|
if (!n)
|
|
return 1;
|
|
if (!avltree_foreach_lr(n->left,callback,cbpriv))
|
|
return 0;
|
|
if (!callback(cbpriv,n->data))
|
|
return 0;
|
|
return avltree_foreach_lr(n->right,callback,cbpriv);
|
|
|
|
}
|
|
|
|
|