master
h 26 lines 455 Bytes
Raw
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 #ifndef RINGBUFFER_INTERNAL_H
4 #define RINGBUFFER_INTERNAL_H
5
6 #include "ringbuffer.h"
7
8 struct rbuf {
9 char *data;
10
11 // points to next byte where we can write
12 char *head;
13 // points to oldest (next to be poped) readable byte
14 char *tail;
15
16 // to avoid calculating data + size
17 // all the time
18 char *end;
19
20 size_t size;
21 size_t size_data;
22 };
23
24 typedef struct rbuf *rbuf_t;
25
26 #endif