#include "para.h"
#include "list.h"
#include "string.h"
-//#include "buffer_tree.h"
+#include "buffer_tree.h"
struct btr_buffer {
/*
* Deallocate the reference, release the resources if refcount drops to zero.
*/
-void btr_drop_buffer_reference(struct btr_buffer_reference *br)
+static void btr_drop_buffer_reference(struct btr_buffer_reference *br)
{
struct btr_buffer *btrb = br->btrb;
add_btrb_to_children(btrb, btrn);
}
-void btr_pushdown_br(struct btr_buffer_reference *br, struct btr_node *btrn)
+static void btr_pushdown_br(struct btr_buffer_reference *br, struct btr_node *btrn)
{
add_btrb_to_children(br->btrb, btrn);
btr_drop_buffer_reference(br);
return list_first_entry(&btrn->input_queue, struct btr_buffer_reference, node);
}
+
static inline size_t br_available_bytes(struct btr_buffer_reference *br)
{
return br->btrb->size - br->consumed;
--- /dev/null
+
+struct btr_node;
+
+struct btr_node *btr_new_node(char *name, struct btr_node *parent);
+void btr_add_output(char *buf, size_t size, struct btr_node *btrn);
+bool btr_is_leaf_node(struct btr_node *btrn);