blob: 22cbde7d0ee15f9344309a0411853f7f92d15364 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
#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 start_index;
} RingBuffer;
RingBuffer * ring_buffer_new (gsize block_size,
gsize n_blocks);
void ring_buffer_free (RingBuffer *buffer);
void ring_buffer_reset (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
|