mirror of
https://github.com/netwide-assembler/nasm.git
synced 2024-11-27 08:10:07 +08:00
ef11aa889b
Having the search argument and result be "const" is nice in theory, but causes problems in practice. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
20 lines
500 B
C
20 lines
500 B
C
#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 */
|