summaryrefslogtreecommitdiffstats
path: root/src/libnetdata/ringbuffer/ringbuffer_internal.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/libnetdata/ringbuffer/ringbuffer_internal.h')
-rw-r--r--src/libnetdata/ringbuffer/ringbuffer_internal.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/libnetdata/ringbuffer/ringbuffer_internal.h b/src/libnetdata/ringbuffer/ringbuffer_internal.h
new file mode 100644
index 000000000..0cc254aa8
--- /dev/null
+++ b/src/libnetdata/ringbuffer/ringbuffer_internal.h
@@ -0,0 +1,26 @@
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+#ifndef RINGBUFFER_INTERNAL_H
+#define RINGBUFFER_INTERNAL_H
+
+#include "ringbuffer.h"
+
+struct rbuf {
+ char *data;
+
+ // points to next byte where we can write
+ char *head;
+ // points to oldest (next to be poped) readable byte
+ char *tail;
+
+ // to avoid calculating data + size
+ // all the time
+ char *end;
+
+ size_t size;
+ size_t size_data;
+};
+
+typedef struct rbuf *rbuf_t;
+
+#endif