00001 #ifdef __cplusplus
00002 extern "C" {
00003 #endif
00004
00005 #ifndef CDSA_RANDBST_H
00006 #define CDSA_RANDBST_H
00007
00008 #include <stdlib.h>
00009 #include <stdbool.h>
00010
00011 #include "cdsa_types.h"
00012
00050 typedef struct RandBst RandBst;
00051
00052 struct RandBst;
00053
00054
00060
00074 cdsa_status_t
00075 randbst_new(RandBst **tree, cdsa_compare_func_t compare, cdsa_destroy_map_func_t destroy);
00076
00086 cdsa_status_t randbst_destroy(RandBst **tree);
00087
00097 cdsa_status_t randbst_is_empty(const RandBst *const tree, bool *is_empty);
00098
00112 cdsa_status_t
00113 randbst_size(const RandBst *const tree, size_t *size);
00114
00115
00129 cdsa_status_t
00130 randbst_has_key(const RandBst *const tree, const void *const key, bool *has_key);
00131
00146 cdsa_status_t
00147 randbst_get(const RandBst *const tree, const void *const key, void *ptr);
00148
00149
00164 cdsa_status_t
00165 randbst_put(RandBst *const tree, const void *const key, const void *const value, void *prev_val);
00166
00181 cdsa_status_t
00182 randbst_remove(RandBst *const tree, void *const key, void *prev_val);
00183
00185
00191
00196
00197
00202
00203
00208
00209
00214
00215
00221
00222
00228
00229
00235
00236
00238
00239 #ifdef __cplusplus
00240 }
00241 #endif
00242
00243 #endif
00244