rb_clear(3)

bofc 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_init(3), rb_destroy(3), rb_cleanup(3), rb_discard(3), rb_stop(3), rb_stop_signal(3), rb_read(3), rb_recv(3), rb_write(3), rb_send(3), rb_posix_read(3), rb_posix_recv(3), rb_posix_write(3), rb_posix_send(3), rb_count(3), rb_space(3), rb_header_size(3), rb_array_size(3), rb_version(3)

bofc.pl

23 October 2018 (v1.1.0)

rb_clear(3)