summaryrefslogtreecommitdiff
path: root/toxav/ring_buffer.h
diff options
context:
space:
mode:
authoriphydf <iphydf@users.noreply.github.com>2016-09-22 15:20:33 +0100
committeriphydf <iphydf@users.noreply.github.com>2016-09-24 23:36:50 +0100
commitf60900c4b813abbce213db6de217837645c6590e (patch)
tree02e9223f1627f1c647b42fa3f623b7354b6c6331 /toxav/ring_buffer.h
parent15cb4261665bab4ef02a5b1b9db48b9477c9b87a (diff)
Move ring buffer out of toxcore/util into toxav.
Toxcore itself doesn't use this data structure. Only toxav does, so now toxav owns the code for it.
Diffstat (limited to 'toxav/ring_buffer.h')
-rw-r--r--toxav/ring_buffer.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/toxav/ring_buffer.h b/toxav/ring_buffer.h
new file mode 100644
index 00000000..42b4479d
--- /dev/null
+++ b/toxav/ring_buffer.h
@@ -0,0 +1,18 @@
1#ifndef RING_BUFFER_H
2#define RING_BUFFER_H
3
4#include <stdbool.h>
5#include <stdint.h>
6
7/* Ring buffer */
8typedef struct RingBuffer RingBuffer;
9bool rb_full(const RingBuffer *b);
10bool rb_empty(const RingBuffer *b);
11void *rb_write(RingBuffer *b, void *p);
12bool rb_read(RingBuffer *b, void **p);
13RingBuffer *rb_new(int size);
14void rb_kill(RingBuffer *b);
15uint16_t rb_size(const RingBuffer *b);
16uint16_t rb_data(const RingBuffer *b, void **dest);
17
18#endif /* RING_BUFFER_H */