2008-10-30 14:29:23 +08:00
|
|
|
#ifndef NASM_RBTREE_H
|
|
|
|
#define NASM_RBTREE_H
|
|
|
|
|
|
|
|
#include "compiler.h"
|
|
|
|
#include <inttypes.h>
|
|
|
|
|
2008-10-31 01:58:28 +08:00
|
|
|
/* This structure should be embedded in a larger data structure;
|
|
|
|
the final output from rb_search() can then be converted back
|
|
|
|
to the larger data structure via container_of(). */
|
2008-10-30 14:29:23 +08:00
|
|
|
struct rbtree {
|
|
|
|
uint64_t key;
|
|
|
|
struct rbtree *left, *right;
|
|
|
|
bool red;
|
|
|
|
};
|
|
|
|
|
2008-10-31 01:58:28 +08:00
|
|
|
struct rbtree *rb_insert(struct rbtree *, struct rbtree *);
|
2008-11-07 11:54:05 +08:00
|
|
|
struct rbtree *rb_search(struct rbtree *, uint64_t);
|
2008-10-30 14:29:23 +08:00
|
|
|
|
|
|
|
#endif /* NASM_RBTREE_H */
|