rb_clear(3)
kurwinet manual pages
rb_clear(3)
NAME
rb_clear - removes all data from ring buffer
SYNOPSIS
#include <librb.h>
int rb_clear(struct rb *rb, int clear);
DESCRIPTION
Simply clears rb buffer from all data. Function is pretty quick as this is just a matter of setting inside pointers. If clear is set, function will also zero whole memory, this may be slow, depending on the size of ring buffer.
RETURN VALUES
Function will return 0 when ring buffer has been clear, or -1 when there was error. In case of an error, rb is not modified.
ERRORS
- EINVAL
- rb is invalid (null).
SEE ALSO
rb_overview(7), rb_new(3), rb_destroy(3), rb_stop(3), rb_read(3), rb_recv(3), rb_write(3), rb_send(3), rb_count(3), rb_space(3), rb_version(3)
22 January 2018 (v2.1.1)
rb_clear(3)