summaryrefslogtreecommitdiff
path: root/rbtree.h
blob: e6d5c824d1a5b0f39384094b8db4a31b24edf787 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#ifndef NASM_RBTREE_H
#define NASM_RBTREE_H

#include "compiler.h"
#include <inttypes.h>

/* 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(). */
struct rbtree {
    uint64_t key;
    struct rbtree *left, *right;
    bool red;
};

struct rbtree *rb_insert(struct rbtree *, struct rbtree *);
struct rbtree *rb_search(struct rbtree *, uint64_t);

#endif /* NASM_RBTREE_H */