tree.h 697 B

1234567891011121314151617181920212223242526
  1. #ifndef MUPDF_FITZ_TREE_H
  2. #define MUPDF_FITZ_TREE_H
  3. #include "mupdf/fitz/system.h"
  4. #include "mupdf/fitz/context.h"
  5. /*
  6. AA-tree to look up things by strings.
  7. */
  8. typedef struct fz_tree_s fz_tree;
  9. void *fz_tree_lookup(fz_context *ctx, fz_tree *node, const char *key);
  10. /*
  11. Insert a new key/value pair and rebalance the tree.
  12. Return the new root of the tree after inserting and rebalancing.
  13. May be called with a NULL root to create a new tree.
  14. */
  15. fz_tree *fz_tree_insert(fz_context *ctx, fz_tree *root, const char *key, void *value);
  16. void fz_drop_tree(fz_context *ctx, fz_tree *node, void (*dropfunc)(fz_context *ctx, void *value));
  17. void fz_debug_tree(fz_context *ctx, fz_tree *root);
  18. #endif