Reorganize headers again

This commit is contained in:
Nils O. Selåsdal
2012-11-15 18:26:03 +01:00
parent 4dca24953f
commit 61eda493bf
23 changed files with 2341 additions and 0 deletions
+42
View File
@@ -0,0 +1,42 @@
#ifndef RBTREE_H_
#define RBTREE_H_
#ifdef __cplusplus
extern "C" {
#endif
typedef enum RBColor RBColor;
enum RBColor {
Red,
Black
};
typedef struct RBNode RBNode;
struct RBNode {
unsigned char color; //Red/Black
RBNode *parent;
RBNode *right;
RBNode *left;
void *data;
};
typedef struct RBTree RBTree;
struct RBTree {
RBNode *node;
int (*compare)(const void *a, const void *b);
};
void uc_rb_remove(RBTree *root, RBNode *node);
RBNode *uc_rb_find(RBTree *root, const void *val);
RBNode *uc_rb_insert(RBTree *root, RBNode *child);
RBNode *uc_rb_first(const RBTree *root);
RBNode *uc_rb_next(RBNode *node);
RBNode *uc_rb_last(const RBTree *root);
#ifdef __cplusplus
}
#endif
#endif