radare2/libr/include/btree.h
pancake 82eb30ad04 * Huge code refactoring to adapt interfaces for valaswig
- hg clone http://hg.youterm.com/valaswig
* typedef all structs as r_asm_item_t -> rAsmItem
  - Sync typedefs with classnames for vala and valaswig interfaces
  - Needs more work and testing
  - C code keeps fully compatible
* New script to build valaswig bindings (swig/libr-swig.sh)
  - Needs integration with 'make test'
  - This will help to create a decent unit testing framework
    to find bugs in bindings and enhace the design of APIs
    from a centralized way keeping compatibility for all the
    languages supported by swig (c#, python, java, ruby, perl, ..)
* Fix vala test programs build
2009-12-24 03:17:53 +01:00

29 lines
918 B
C

#ifndef _INCLUDE_BTREE_H_
#define _INCLUDE_BTREE_H_
#include "r_types.h"
struct btree_node
{
void *data;
int hits; // profiling
struct btree_node *left;
struct btree_node *right;
};
#define BTREE_CMP(x) int (* x )(const void *, const void *)
#define BTREE_DEL(x) int (* x )(void *)
#ifdef R_API
R_API void btree_init(struct btree_node **T);
R_API struct btree_node *btree_remove(struct btree_node *p, BTREE_DEL(del));
R_API void *btree_search(struct btree_node *proot, void *x, BTREE_CMP(cmp), int parent);
R_API int btree_del(struct btree_node *proot, void *x, BTREE_CMP(cmp), BTREE_DEL(del));
R_API void *btree_get(struct btree_node *proot, void *x, BTREE_CMP(cmp));
R_API void btree_insert(struct btree_node **T, struct btree_node *p, BTREE_CMP(cmp));
R_API void btree_add(struct btree_node **T, void *e, BTREE_CMP(cmp));
R_API void btree_cleartree(struct btree_node *proot, BTREE_DEL(del));
#endif
#endif