From 879492ae4e15c02beebaaa163a9fd9959807e752 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Wed, 13 Jul 2016 13:29:39 +0200 Subject: Handle outbound messages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/ring.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/ring.h') diff --git a/src/ring.h b/src/ring.h index bf22226..7281d46 100644 --- a/src/ring.h +++ b/src/ring.h @@ -113,3 +113,15 @@ void* ring_peek(struct ring* this, size_t* n); */ void ring_pop(struct ring* this, size_t n); +/** + * Check whether there is more data waiting + * in a ring buffer + * + * @param this The ring buffer + * @return 1 if there is more data, 0 otherwise + */ +static inline int ring_have_more(struct ring* this) +{ + return this->buffer != NULL; +} + -- cgit v1.2.3-70-g09d2