]> git.tue.mpg.de Git - paraslash.git/commitdiff
btr: Rename btr_bytes_pending() and make it public.
authorAndre Noll <maan@systemlinux.org>
Sun, 14 Feb 2010 21:37:06 +0000 (22:37 +0100)
committerAndre Noll <maan@systemlinux.org>
Sun, 14 Feb 2010 21:37:06 +0000 (22:37 +0100)
The oggvorbis decoder needs to know this info, so make it public. As we have already
btr_get_input_queue_size() it is natural to rename btr_bytes_pending() to
btr_get_output_queue_size().

buffer_tree.c
buffer_tree.h

index 2a78959c5ad569bc6c950be20f6b0def1d801772..45650a241d65efb3858ecbea737002e7725ffb10 100644 (file)
@@ -756,12 +756,15 @@ void btr_splice_out_node(struct btr_node *btrn)
        assert(list_empty(&btrn->children));
 }
 
-/*
- * Return the size of the largest input queue.
+/**
+ * Return number of queued output bytes of a buffer tree node.
+ *
+ * \param btrn The node whose output queue size should be computed.
  *
- * Iterates over all children of the given node.
+ * This function iterates over all children of the given node and returns the
+ * size of the largest input queue.
  */
-static size_t btr_bytes_pending(struct btr_node *btrn)
+size_t btr_get_output_queue_size(struct btr_node *btrn)
 {
        size_t max_size = 0;
        struct btr_node *ch;
@@ -1103,7 +1106,7 @@ int btr_node_status(struct btr_node *btrn, size_t min_iqs,
        if (type != BTR_NT_LEAF) {
                if (btr_no_children(btrn))
                        return -E_BTR_NO_CHILD;
-               if (btr_bytes_pending(btrn) > BTRN_MAX_PENDING)
+               if (btr_get_output_queue_size(btrn) > BTRN_MAX_PENDING)
                        return 0;
        }
        if (type != BTR_NT_ROOT) {
index f8fed361f368a44084f2880b2ce4a1b0214f5a3a..8d7a964988e95b44ca7a13a729dbbaaf24bfc37f 100644 (file)
@@ -180,6 +180,7 @@ void btr_remove_node(struct btr_node *btrn);
 void btr_free_node(struct btr_node *btrn);
 void btr_add_output(char *buf, size_t size, struct btr_node *btrn);
 size_t btr_get_input_queue_size(struct btr_node *btrn);
+size_t btr_get_output_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);