diff options
author | iphydf <iphydf@users.noreply.github.com> | 2016-09-22 15:20:33 +0100 |
---|---|---|
committer | iphydf <iphydf@users.noreply.github.com> | 2016-09-24 23:36:50 +0100 |
commit | f60900c4b813abbce213db6de217837645c6590e (patch) | |
tree | 02e9223f1627f1c647b42fa3f623b7354b6c6331 /toxav/ring_buffer.h | |
parent | 15cb4261665bab4ef02a5b1b9db48b9477c9b87a (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.h | 18 |
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 */ | ||
8 | typedef struct RingBuffer RingBuffer; | ||
9 | bool rb_full(const RingBuffer *b); | ||
10 | bool rb_empty(const RingBuffer *b); | ||
11 | void *rb_write(RingBuffer *b, void *p); | ||
12 | bool rb_read(RingBuffer *b, void **p); | ||
13 | RingBuffer *rb_new(int size); | ||
14 | void rb_kill(RingBuffer *b); | ||
15 | uint16_t rb_size(const RingBuffer *b); | ||
16 | uint16_t rb_data(const RingBuffer *b, void **dest); | ||
17 | |||
18 | #endif /* RING_BUFFER_H */ | ||