Add comment documentation for source group methods
[alure.git] / src / ringbuf.h
blob198c5465f44a0f233644057f9dec4fb39572a393
1 #ifndef RINGBUF_H
2 #define RINGBUF_H
4 #include <stdlib.h>
6 typedef struct ll_ringbuffer ll_ringbuffer_t;
7 typedef struct ll_ringbuffer_data {
8 char *buf;
9 size_t len;
10 } ll_ringbuffer_data_t;
12 ll_ringbuffer_t *ll_ringbuffer_create(size_t sz, size_t elem_sz);
13 void ll_ringbuffer_free(ll_ringbuffer_t *rb);
14 void ll_ringbuffer_get_read_vector(const ll_ringbuffer_t *rb, ll_ringbuffer_data_t *vec);
15 void ll_ringbuffer_get_write_vector(const ll_ringbuffer_t *rb, ll_ringbuffer_data_t *vec);
16 size_t ll_ringbuffer_read(ll_ringbuffer_t *rb, char *dest, size_t cnt);
17 size_t ll_ringbuffer_peek(ll_ringbuffer_t *rb, char *dest, size_t cnt);
18 void ll_ringbuffer_read_advance(ll_ringbuffer_t *rb, size_t cnt);
19 size_t ll_ringbuffer_read_space(const ll_ringbuffer_t *rb);
20 int ll_ringbuffer_mlock(ll_ringbuffer_t *rb);
21 void ll_ringbuffer_reset(ll_ringbuffer_t *rb);
22 size_t ll_ringbuffer_write(ll_ringbuffer_t *rb, const char *src, size_t cnt);
23 void ll_ringbuffer_write_advance(ll_ringbuffer_t *rb, size_t cnt);
24 size_t ll_ringbuffer_write_space(const ll_ringbuffer_t *rb);
26 #endif /* RINGBUF_H */