]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - buffer_tree.h
buffer_tree: Add code to splice out a node of the buffer tree.
[paraslash.git] / buffer_tree.h
index b066ad9e3862c5006dd6ecf73cf40b8dfa657aa1..69886c7932b8c1f96ca59b7a6418ffe519e593fd 100644 (file)
@@ -1,8 +1,18 @@
 
 struct btr_node;
 
-struct btr_node *btr_new_node(char *name, struct btr_node *parent);
+typedef int (*btr_command_handler)(const char *command, char **result);
+
+struct btr_node *btr_new_node(char *name, struct btr_node *parent,
+               btr_command_handler handler);
 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);