summaryrefslogtreecommitdiff
path: root/src/libdatastruct/avlnode-internal.h
blob: 03426957871b65d5d5827472c05628bdb8270396 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/* ISC license. */

#ifndef AVLNODE_INTERNAL_H
#define AVLNODE_INTERNAL_H

#include <skalibs/avlnode.h>

#define avlnode_ufroms(c) ((c) > 0)
#define avlnode_sfromu(h) ((h) ? 1 : -1)

extern unsigned int avlnode_rotate (avlnode_ref, unsigned int, unsigned int, int) ;
extern unsigned int avlnode_doublerotate (avlnode_ref, unsigned int, unsigned int, int) ;
#define avlnode_rotate_maydouble(s, max, r, h, isdouble) ((isdouble) ? avlnode_doublerotate(s, max, r, h) : avlnode_rotate(s, max, r, h))

#endif