diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2010-01-12 13:14:19 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2010-01-12 13:14:19 +0100 |
commit | e5d1c949ac4c15e353160a5006ac3a8cea14dac5 (patch) | |
tree | f71b9e585ce08a14f6f10c65d5f85bde13732a79 /lf_ringbuffer.h | |
parent | 1b393afeafa57a1a9baf72834b4f75388361931e (diff) | |
download | lock_free-e5d1c949ac4c15e353160a5006ac3a8cea14dac5.zip lock_free-e5d1c949ac4c15e353160a5006ac3a8cea14dac5.tar.gz |
add _read_size and _write_size to lf_ringbuffer
Diffstat (limited to 'lf_ringbuffer.h')
-rw-r--r-- | lf_ringbuffer.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lf_ringbuffer.h b/lf_ringbuffer.h index a5dc0cb..feb5f17 100644 --- a/lf_ringbuffer.h +++ b/lf_ringbuffer.h @@ -54,6 +54,12 @@ void lf_ringbuffer_destroy( lf_ringbuffer_t *r ); /* return 1 if is empty */ int lf_ringbuffer_empty( lf_ringbuffer_t *r ); +/* return the count of filled buffers */ +size_t lf_ringbuffer_read_size( lf_ringbuffer_t *r ); + +/* return the count of available buffers */ +size_t lf_ringbuffer_write_size( lf_ringbuffer_t *r ); + /* write data into the ring buffer * return 0 on success * return -1 if IS_NOT_BLOCKING and buffer is full |