summaryrefslogtreecommitdiffstats
path: root/tools/ring-buffer.h
diff options
context:
space:
mode:
authorMatthias Vogelgesang <matthias.vogelgesang@gmail.com>2013-04-10 09:02:09 +0200
committerMatthias Vogelgesang <matthias.vogelgesang@gmail.com>2013-04-10 09:02:09 +0200
commit0ef77576760e3b384ff15f6155c6073ab96fc8c7 (patch)
tree0951d48033ece37fdacd9745529de2a6deb43a0b /tools/ring-buffer.h
parent617a46bff0cda0a30e30e5173f1666b2338bff25 (diff)
downloadlibuca-0ef77576760e3b384ff15f6155c6073ab96fc8c7.tar.gz
libuca-0ef77576760e3b384ff15f6155c6073ab96fc8c7.tar.bz2
libuca-0ef77576760e3b384ff15f6155c6073ab96fc8c7.tar.xz
libuca-0ef77576760e3b384ff15f6155c6073ab96fc8c7.zip
grab takes -n and -t parameters now
Diffstat (limited to 'tools/ring-buffer.h')
-rw-r--r--tools/ring-buffer.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/tools/ring-buffer.h b/tools/ring-buffer.h
new file mode 100644
index 0000000..a3758cb
--- /dev/null
+++ b/tools/ring-buffer.h
@@ -0,0 +1,29 @@
+#ifndef RING_BUFFER_H
+#define RING_BUFFER_H
+
+#include <glib.h>
+
+G_BEGIN_DECLS
+
+typedef struct {
+ guchar *data;
+ gsize block_size;
+ guint n_blocks_total;
+ guint n_blocks_used;
+ guint current_index;
+} RingBuffer;
+
+RingBuffer * ring_buffer_new (gsize block_size,
+ gsize n_blocks);
+void ring_buffer_free (RingBuffer *buffer);
+void ring_buffer_reset (RingBuffer *buffer);
+gsize ring_buffer_get_block_size (RingBuffer *buffer);
+gpointer ring_buffer_get_current_pointer (RingBuffer *buffer);
+gpointer ring_buffer_get_pointer (RingBuffer *buffer,
+ guint index);
+guint ring_buffer_get_num_blocks (RingBuffer *buffer);
+void ring_buffer_proceed (RingBuffer *buffer);
+
+G_END_DECLS
+
+#endif