#ifndef _EYTZINGER_H
#define _EYTZINGER_H
#include <linux/bitops.h>
#include <linux/log2.h>
#ifdef EYTZINGER_DEBUG
#define EYTZINGER_BUG_ON …
#else
#define EYTZINGER_BUG_ON(cond) …
#endif
static inline unsigned eytzinger1_child(unsigned i, unsigned child)
{ … }
static inline unsigned eytzinger1_left_child(unsigned i)
{ … }
static inline unsigned eytzinger1_right_child(unsigned i)
{ … }
static inline unsigned eytzinger1_first(unsigned size)
{ … }
static inline unsigned eytzinger1_last(unsigned size)
{ … }
static inline unsigned eytzinger1_next(unsigned i, unsigned size)
{ … }
static inline unsigned eytzinger1_prev(unsigned i, unsigned size)
{ … }
static inline unsigned eytzinger1_extra(unsigned size)
{ … }
static inline unsigned __eytzinger1_to_inorder(unsigned i, unsigned size,
unsigned extra)
{ … }
static inline unsigned __inorder_to_eytzinger1(unsigned i, unsigned size,
unsigned extra)
{ … }
static inline unsigned eytzinger1_to_inorder(unsigned i, unsigned size)
{ … }
static inline unsigned inorder_to_eytzinger1(unsigned i, unsigned size)
{ … }
#define eytzinger1_for_each(_i, _size) …
static inline unsigned eytzinger0_child(unsigned i, unsigned child)
{ … }
static inline unsigned eytzinger0_left_child(unsigned i)
{ … }
static inline unsigned eytzinger0_right_child(unsigned i)
{ … }
static inline unsigned eytzinger0_first(unsigned size)
{ … }
static inline unsigned eytzinger0_last(unsigned size)
{ … }
static inline unsigned eytzinger0_next(unsigned i, unsigned size)
{ … }
static inline unsigned eytzinger0_prev(unsigned i, unsigned size)
{ … }
static inline unsigned eytzinger0_extra(unsigned size)
{ … }
static inline unsigned __eytzinger0_to_inorder(unsigned i, unsigned size,
unsigned extra)
{ … }
static inline unsigned __inorder_to_eytzinger0(unsigned i, unsigned size,
unsigned extra)
{ … }
static inline unsigned eytzinger0_to_inorder(unsigned i, unsigned size)
{ … }
static inline unsigned inorder_to_eytzinger0(unsigned i, unsigned size)
{ … }
#define eytzinger0_for_each(_i, _size) …
static inline int eytzinger0_find_le(void *base, size_t nr, size_t size,
cmp_func_t cmp, const void *search)
{ … }
static inline int eytzinger0_find_gt(void *base, size_t nr, size_t size,
cmp_func_t cmp, const void *search)
{ … }
static inline int eytzinger0_find_ge(void *base, size_t nr, size_t size,
cmp_func_t cmp, const void *search)
{ … }
#define eytzinger0_find(base, nr, size, _cmp, search) …
void eytzinger0_sort_r(void *, size_t, size_t,
cmp_r_func_t, swap_r_func_t, const void *);
void eytzinger0_sort(void *, size_t, size_t, cmp_func_t, swap_func_t);
#endif