X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=buffer_tree.h;h=927d3b6731197bc02260ece8e0cfdea9406d7544;hb=c87045a40b9462ebeb28cc169d7bb3721c9a81d3;hp=d340973691e7c7249f83fd34b77d4aa62e439fcf;hpb=0b101563e67c91bc660f6a16b5889901d9e8eeff;p=paraslash.git diff --git a/buffer_tree.h b/buffer_tree.h index d3409736..927d3b67 100644 --- a/buffer_tree.h +++ b/buffer_tree.h @@ -1,12 +1,22 @@ struct btr_node; -struct btr_node *btr_new_node(char *name, struct btr_node *parent); +typedef int (*btr_command_handler)(struct btr_node *btrn, + const char *command, char **result); + +struct btr_node *btr_new_node(const char *name, struct btr_node *parent, + btr_command_handler handler, void *context); void btr_del_node(struct btr_node *btrn); void btr_add_output(char *buf, size_t size, struct btr_node *btrn); -bool btr_is_leaf_node(struct btr_node *btrn); +bool btr_no_children(struct btr_node *btrn); size_t btr_bytes_pending(struct btr_node *btrn); size_t btr_get_input_queue_size(struct btr_node *btrn); bool btr_no_parent(struct btr_node *btrn); size_t btr_next_buffer(struct btr_node *btrn, char **bufp); void btr_consume(struct btr_node *btrn, size_t numbytes); +int btr_exec(struct btr_node *btrn, const char *command, char **value_result); +int btr_exec_up(struct btr_node *btrn, const char *command, char **value_result); +int btr_splice_out_node(struct btr_node *btrn); +void btr_pushdown(struct btr_node *btrn); +void *btr_context(struct btr_node *btrn); +int btr_merge(struct btr_node *btrn);