aboutsummaryrefslogtreecommitdiffstats
path: root/man/rb_clear.3
blob: 66d03b4b51dd4d162e770c5bbc8d9268756394d2 (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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
.TH "rb_clear" "3" "25 January 2018 (v2.1.2)" "bofc.pl"
.SH NAME
.PP
.B rb_clear
- removes all data from ring buffer
.SH SYNOPSIS
.PP
.B "#include <librb.h>"
.PP
.BI "int rb_clear(struct rb *" rb ", int " clear ");"
.SH DESCRIPTION
.PP
Simply clears
.I rb
buffer from all data.
Function is pretty quick as this is just a matter of setting inside pointers.
If
.I clear
is set, function will also zero whole memory, this may be slow, depending on the
size of ring buffer.
.SH RETURN VALUES
.PP
Function will return 0 when ring buffer has been clear, or -1 when there was
error.
In case of an error,
.I rb
is not modified.
.SH ERRORS
.TP
.B EINVAL
.I rb
is invalid (null).
.SH SEE ALSO
.PP
.BR rb_overview (7),
.BR rb_new (3),
.BR rb_destroy (3),
.BR rb_stop (3),
.BR rb_read (3),
.BR rb_recv (3),
.BR rb_write (3),
.BR rb_send (3),
.BR rb_count (3),
.BR rb_space (3),
.BR rb_version (3)