aboutsummaryrefslogtreecommitdiffstats
path: root/src/ringbuf.h
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2008-06-30 02:42:55 +0000
committerEric Wong <normalperson@yhbt.net>2008-06-30 02:42:55 +0000
commit9873e07c5abf787d7805b4266a243e56240354dc (patch)
tree033498fb06470eb882c97fcedf52dc3f532fbbf8 /src/ringbuf.h
parentaa828c1b2576f19a7d0de11a791ecd7f93c206dc (diff)
downloadmpd-9873e07c5abf787d7805b4266a243e56240354dc.tar.gz
mpd-9873e07c5abf787d7805b4266a243e56240354dc.tar.xz
mpd-9873e07c5abf787d7805b4266a243e56240354dc.zip
ringbuf: get_{write,read}_vector returns total bytes in both vec elts
This will eliminate unnecessary calls to ringbuf_{read,write}_space git-svn-id: https://svn.musicpd.org/mpd/trunk@7389 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to '')
-rw-r--r--src/ringbuf.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/ringbuf.h b/src/ringbuf.h
index dc3509363..1465e8fa2 100644
--- a/src/ringbuf.h
+++ b/src/ringbuf.h
@@ -85,8 +85,9 @@ void ringbuf_free(struct ringbuf * rb);
* @param rb a pointer to the ringbuffer structure.
* @param vec a pointer to a 2 element array of struct iovec.
*
+ * @return total number of bytes readable into both vec elements
*/
-void ringbuf_get_read_vector(const struct ringbuf * rb, struct iovec * vec);
+size_t ringbuf_get_read_vector(const struct ringbuf * rb, struct iovec * vec);
/**
* Fill a data structure with a description of the current writable
@@ -106,8 +107,10 @@ void ringbuf_get_read_vector(const struct ringbuf * rb, struct iovec * vec);
*
* @param rb a pointer to the ringbuffer structure.
* @param vec a pointer to a 2 element array of struct iovec.
+ *
+ * @return total number of bytes writable in both vec elements
*/
-void ringbuf_get_write_vector(const struct ringbuf * rb, struct iovec * vec);
+size_t ringbuf_get_write_vector(const struct ringbuf * rb, struct iovec * vec);
/**
* Read data from the ringbuffer.