Add buffer_tree.h.
authorAndre Noll <maan@systemlinux.org>
Mon, 28 Dec 2009 20:33:29 +0000 (21:33 +0100)
committerAndre Noll <maan@systemlinux.org>
Mon, 28 Dec 2009 20:33:29 +0000 (21:33 +0100)
buffer_tree.c
buffer_tree.h [new file with mode: 0644]

index 9a59fff..b3aea0e 100644 (file)
@@ -4,7 +4,7 @@
 #include "para.h"
 #include "list.h"
 #include "string.h"
-//#include "buffer_tree.h"
+#include "buffer_tree.h"
 
 
 struct btr_buffer {
@@ -77,7 +77,7 @@ static struct btr_buffer *new_btrb(char *buf, size_t size)
 /*
  * 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;
 
@@ -111,7 +111,7 @@ void btr_add_output(char *buf, size_t size, struct btr_node *btrn)
        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);
@@ -150,6 +150,7 @@ struct btr_buffer_reference *btr_next_br(struct btr_node *btrn)
        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;
diff --git a/buffer_tree.h b/buffer_tree.h
new file mode 100644 (file)
index 0000000..18b9e8a
--- /dev/null
@@ -0,0 +1,6 @@
+
+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);