avltree_init.c (427B)
1 /* ISC license. */ 2 3 #include <stdint.h> 4 #include <errno.h> 5 #include <skalibs/gensetdyn.h> 6 #include <skalibs/avlnode.h> 7 #include <skalibs/avltree.h> 8 9 void avltree_init (avltree *t, uint32_t base, uint32_t fracnum, uint32_t fracden, dtok_func_ref dtok, cmp_func_ref f, void *p) 10 { 11 gensetdyn_init(&t->x, sizeof(avlnode), base, fracnum, fracden) ; 12 t->root = UINT32_MAX ; 13 t->dtok = dtok ; 14 t->kcmp = f ; 15 t->external = p ; 16 }