vrb_space_ptr(3) return pointer to empty space

LIBRARY

-lvrb

SYNOPSIS

#include <vrb.h>

size_t vrb_space_ptr(vrb_p vrb);

DESCRIPTION

vrb_space_ptr returns the pointer to the beginning of the contiguous block of empty space within the virtual ring buffer where data may be placed. The pointer has meaning only if there is space in the buffer. If there is no space in the buffer, an arbitrary pointer is returned that must not be used. Use vrb_space_len(3) or vrb_is_full(3) to determine if vrb_space_ptr(3) has a meaningful pointer.

The caller may access all of this space, and should call vrb_give(3) to indicate how much data has been placed into the buffer.

ARGUMENTS

vrb_p vrb
specifies the virtual ring buffer to obtain the empty space pointer from. If a NULL or invalid pointer is given, results are unpredictable and are likely to be disasterous.

RETURN VALUE

size_t
The pointer to the empty space in the virtual ring buffer is returned.