| 1 | #ifndef _BLOCKTREE_H |
| 2 | #define _BLOCKTREE_H |
| 3 | |
| 4 | #include "store.h" |
| 5 | #include "inttypes.h" |
| 6 | |
| 7 | typedef loff_t block_t; |
| 8 | |
| 9 | struct btnode { |
| 10 | u_int8_t d; |
| 11 | struct addr a; |
| 12 | }; |
| 13 | |
| 14 | struct btop { |
| 15 | block_t blk; |
| 16 | void *buf; |
| 17 | size_t len; |
| 18 | int (*fillfn)(void *buf, size_t len, void *pdata); |
| 19 | void *pdata; |
| 20 | }; |
| 21 | |
| 22 | ssize_t btget(struct store *st, struct btnode *tree, block_t bl, void *buf, size_t len, size_t blsize); |
| 23 | int btputmany(struct store *st, struct btnode *tree, struct btop *ops, int numops, size_t blsize); |
| 24 | int btput(struct store *st, struct btnode *tree, block_t bl, void *buf, size_t len, size_t blsize); |
| 25 | block_t btcount(struct store *st, struct btnode *tree, size_t blsize); |
| 26 | void btsortops(struct btop *ops, int numops); |
| 27 | void btmkop(struct btop *op, block_t bl, void *buf, size_t len); |
| 28 | |
| 29 | #endif |