ring-buffer.c
static inline unsigned rbtail( ring_buffer_t *rb ) {
	unsigned r;

	if ( NULL == rb || 0 == rb->capacity ) {
		r = 0;
		goto out;
	}

	r = ( rb->head + rb->len ) % rb->capacity;

out:
	return r;
}
// the index of the next writable element
the index of the next writable element
the index of the next writable element
static inline unsigned rbtail( ring_buffer_t *rb ) {
	unsigned r;
	if ( NULL == rb || 0 == rb->capacity ) {
		r = 0;
		goto out;
	}
	r = ( rb->head + rb->len ) % rb->capacity;
out:
	return r;
}
static inline unsigned rbtail ( ring_buffer_t * rb ) { unsigned r ; if ( NULL == rb || 0 == rb -> capacity ) { r = 0 ; goto out ; } r = ( rb -> head + rb -> len ) % rb -> capacity ; out : return r ; }
the index of the next writable element
the index of the next writable element