2 * Copyright 2004-2008, François Revol, <revol@free.fr>.
3 * Distributed under the terms of the MIT License.
10 size_t current
; /* index of next byte to read */
11 size_t avail
; /* number of bytes in */
12 unsigned char data
[0];
15 void rb_init(struct ring_buffer
*rb
, size_t size
);
16 void rb_clear(struct ring_buffer
*rb
);
17 size_t rb_can_write(struct ring_buffer
*rb
);
18 size_t rb_can_read(struct ring_buffer
*rb
);
19 size_t rb_write(struct ring_buffer
*rb
, void *data
, size_t len
);
20 size_t rb_read(struct ring_buffer
*rb
, void *data
, size_t len
);