rbtree.h 616 B

1234567891011121314151617181920
  1. #ifndef GRASS_RBTREEDEFS_H
  2. #define GRASS_RBTREEDEFS_H
  3. /* tree functions */
  4. struct RB_TREE *rbtree_create(rb_compare_fn *, size_t);
  5. void rbtree_destroy(struct RB_TREE *);
  6. int rbtree_insert(struct RB_TREE *, void *);
  7. int rbtree_remove(struct RB_TREE *, const void *);
  8. void *rbtree_find(struct RB_TREE *, const void *);
  9. /* tree traversal functions */
  10. int rbtree_init_trav(struct RB_TRAV *, struct RB_TREE *);
  11. void* rbtree_traverse(struct RB_TRAV *);
  12. void *rbtree_traverse_start(struct RB_TRAV *, const void *);
  13. /* debug tree from given node downwards */
  14. int rbtree_debug(struct RB_TREE *, struct RB_NODE *);
  15. #endif