aboutsummaryrefslogtreecommitdiffstats
path: root/src/ring.h
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2016-07-13 13:29:39 +0200
committerMattias Andrée <maandree@kth.se>2016-07-13 13:29:39 +0200
commit879492ae4e15c02beebaaa163a9fd9959807e752 (patch)
treec7fe0c943dbbbf55bb85fe0cf3b0e4da48024dd1 /src/ring.h
parentAdd ring[.ch] (diff)
downloadcoopgammad-879492ae4e15c02beebaaa163a9fd9959807e752.tar.gz
coopgammad-879492ae4e15c02beebaaa163a9fd9959807e752.tar.bz2
coopgammad-879492ae4e15c02beebaaa163a9fd9959807e752.tar.xz
Handle outbound messages
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'src/ring.h')
-rw-r--r--src/ring.h12
1 files changed, 12 insertions, 0 deletions
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;
+}
+