rbtree.h 705 B

12345678910111213141516171819202122
  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_clear(struct RB_TREE *);
  6. void rbtree_destroy(struct RB_TREE *);
  7. int rbtree_insert(struct RB_TREE *, void *);
  8. int rbtree_remove(struct RB_TREE *, const void *);
  9. void *rbtree_find(struct RB_TREE *, const void *);
  10. /* tree traversal functions */
  11. int rbtree_init_trav(struct RB_TRAV *, struct RB_TREE *);
  12. void* rbtree_traverse(struct RB_TRAV *);
  13. void *rbtree_traverse_backwd(struct RB_TRAV *trav);
  14. void *rbtree_traverse_start(struct RB_TRAV *, const void *);
  15. /* debug tree from given node downwards */
  16. int rbtree_debug(struct RB_TREE *, struct RB_NODE *);
  17. #endif