Switch audiod over to the buffer tree API.
[paraslash.git] / buffer_tree.h
1
2 struct btr_node;
3
4 typedef int (*btr_command_handler)(struct btr_node *btrn,
5 const char *command, char **result);
6
7 enum btr_node_type {
8 BTR_NT_ROOT,
9 BTR_NT_INTERNAL,
10 BTR_NT_LEAF,
11 };
12
13 struct btr_node *btr_new_node(const char *name, struct btr_node *parent,
14 btr_command_handler handler, void *context);
15 void btr_remove_node(struct btr_node *btrn);
16 void btr_free_node(struct btr_node *btrn);
17 void btr_add_output(char *buf, size_t size, struct btr_node *btrn);
18 bool btr_no_children(struct btr_node *btrn);
19 size_t btr_bytes_pending(struct btr_node *btrn);
20 size_t btr_get_input_queue_size(struct btr_node *btrn);
21 bool btr_no_parent(struct btr_node *btrn);
22 size_t btr_next_buffer(struct btr_node *btrn, char **bufp);
23 void btr_consume(struct btr_node *btrn, size_t numbytes);
24 int btr_exec(struct btr_node *btrn, const char *command, char **value_result);
25 int btr_exec_up(struct btr_node *btrn, const char *command, char **value_result);
26 void btr_splice_out_node(struct btr_node *btrn);
27 void btr_pushdown(struct btr_node *btrn);
28 void *btr_context(struct btr_node *btrn);
29 void btr_merge(struct btr_node *btrn, size_t dest_size);
30 bool btr_eof(struct btr_node *btrn);
31 void btr_log_tree(struct btr_node *btrn, int loglevel);
32 int btr_pushdown_one(struct btr_node *btrn);
33 bool btr_inplace_ok(struct btr_node *btrn);
34 int btr_node_status(struct btr_node *btrn, size_t min_iqs,
35 enum btr_node_type type);
36 void btr_get_node_start(struct btr_node *btrn, struct timeval *tv);