c84a93058e575ed6a8fdbc79c49160b2d0271985
[paraslash.git] / buffer_tree.h
1
2 struct btr_node;
3
4 typedef int (*btr_command_handler)(const char *command, char **result);
5
6 struct btr_node *btr_new_node(char *name, struct btr_node *parent,
7 btr_command_handler handler);
8 void btr_del_node(struct btr_node *btrn);
9 void btr_add_output(char *buf, size_t size, struct btr_node *btrn);
10 bool btr_no_children(struct btr_node *btrn);
11 size_t btr_bytes_pending(struct btr_node *btrn);
12 size_t btr_get_input_queue_size(struct btr_node *btrn);
13 bool btr_no_parent(struct btr_node *btrn);
14 size_t btr_next_buffer(struct btr_node *btrn, char **bufp);
15 void btr_consume(struct btr_node *btrn, size_t numbytes);
16 int btr_exec(struct btr_node *btrn, const char *command, char **value_result);
17 int btr_exec_up(struct btr_node *btrn, const char *command, char **value_result);