2015-04-19 23:28:26 +02:00
|
|
|
#include "mavl.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int mavl_foreach_lr(struct mavlnode *n, int (*callback)(void *,void *),void *cbpriv)
|
|
|
|
{
|
|
|
|
if (!n)
|
|
|
|
return 1;
|
|
|
|
if (!mavl_foreach_lr(n->left,callback,cbpriv))
|
|
|
|
return 0;
|
2018-03-03 17:42:28 +01:00
|
|
|
if (!callback(cbpriv,&n->data))
|
2015-04-19 23:28:26 +02:00
|
|
|
return 0;
|
|
|
|
return mavl_foreach_lr(n->right,callback,cbpriv);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|