31 lines
759 B
C
31 lines
759 B
C
#ifndef VIETER_TREE
|
|
#define VIETER_TREE
|
|
|
|
#include <stdint.h>
|
|
#include <stdlib.h>
|
|
|
|
typedef struct vieter_tree vieter_tree;
|
|
|
|
typedef enum vieter_tree_error {
|
|
vieter_tree_ok = 0,
|
|
vieter_tree_already_present = 1,
|
|
vieter_tree_not_present = 2
|
|
} vieter_tree_error;
|
|
|
|
vieter_tree *vieter_tree_init();
|
|
|
|
void vieter_tree_free(vieter_tree *tree);
|
|
|
|
vieter_tree_error vieter_tree_insert(vieter_tree *tree, uint64_t key,
|
|
void *data);
|
|
|
|
vieter_tree_error vieter_tree_search(void **out, vieter_tree *tree,
|
|
uint64_t key);
|
|
|
|
vieter_tree_error vieter_tree_remove(void **out, vieter_tree *tree,
|
|
uint64_t key);
|
|
|
|
uint64_t vieter_tree_size(vieter_tree *tree);
|
|
|
|
#endif
|