1 /* ISC license. */
2 
3 #include <errno.h>
4 #include <skalibs/avlnode.h>
5 
avlnode_iter_withcancel(avlnode * tree,uint32_t max,uint32_t root,avliterfunc_t_ref f,avliterfunc_t_ref cancelf,void * stuff)6 int avlnode_iter_withcancel (avlnode *tree, uint32_t max, uint32_t root, avliterfunc_t_ref f, avliterfunc_t_ref cancelf, void *stuff)
7 {
8   uint32_t cut = avlnode_iter_nocancel(tree, max, max, root, f, stuff) ;
9   if (cut != max)
10   {
11     int e = errno ;
12     avlnode_iter_nocancel(tree, max, cut, root, cancelf, stuff) ;
13     errno = e ;
14     return 0 ;
15   }
16   return 1 ;
17 }
18