Dependencies/Build/mac/include/faust/gui/ring-buffer.h
static void
ringbuffer_get_write_vector (const ringbuffer_t * rb,
				  ringbuffer_data_t * vec)
{
	size_t free_cnt;
	size_t cnt2;
	size_t w, r;

	w = rb->write_ptr;
	r = rb->read_ptr;

	if (w > r) {
		free_cnt = ((r - w + rb->size) & rb->size_mask) - 1;
	} else if (w < r) {
		free_cnt = (r - w) - 1;
	} else {
		free_cnt = rb->size - 1;
	}

	cnt2 = w + free_cnt;

	if (cnt2 > rb->size) {

		/* Two part vector: the rest of the buffer after the current write
		   ptr, plus some from the start of the buffer. */

		vec[0].buf = &(rb->buf[w]);
		vec[0].len = rb->size - w;
		vec[1].buf = rb->buf;
		vec[1].len = cnt2 & rb->size_mask;
	} else {
		vec[0].buf = &(rb->buf[w]);
		vec[0].len = free_cnt;
		vec[1].len = 0;
	}
}
/* The non-copying data writer. `vec' is an array of two places. Set
   the values at `vec' to hold the current writeable data at `rb'. If
   the writeable data is in one segment the second segment has zero
   length. */
The non-copying data writer. `vec' is an array of two places. Set
the values at `vec' to hold the current writeable data at `rb'. If
the writeable data is in one segment the second segment has zero
length.
The non - copying data writer . ` vec ' is an array of two places . Set the values at ` vec ' to hold the current writeable data at ` rb ' . If the writeable data is in one segment the second segment has zero length .
static void
ringbuffer_get_write_vector (const ringbuffer_t * rb,
				  ringbuffer_data_t * vec)
{
	size_t free_cnt;
	size_t cnt2;
	size_t w, r;
	w = rb->write_ptr;
	r = rb->read_ptr;
	if (w > r) {
		free_cnt = ((r - w + rb->size) & rb->size_mask) - 1;
	} else if (w < r) {
		free_cnt = (r - w) - 1;
	} else {
		free_cnt = rb->size - 1;
	}
	cnt2 = w + free_cnt;
	if (cnt2 > rb->size) {
		vec[0].buf = &(rb->buf[w]);
		vec[0].len = rb->size - w;
		vec[1].buf = rb->buf;
		vec[1].len = cnt2 & rb->size_mask;
	} else {
		vec[0].buf = &(rb->buf[w]);
		vec[0].len = free_cnt;
		vec[1].len = 0;
	}
}
static void ringbuffer_get_write_vector ( const ringbuffer_t * rb , ringbuffer_data_t * vec ) { size_t free_cnt ; size_t cnt2 ; size_t w , r ; w = rb -> write_ptr ; r = rb -> read_ptr ; if ( w > r ) { free_cnt = ( ( r - w + rb -> size ) & rb -> size_mask ) - 1 ; } else if ( w < r ) { free_cnt = ( r - w ) - 1 ; } else { free_cnt = rb -> size - 1 ; } cnt2 = w + free_cnt ; if ( cnt2 > rb -> size ) { vec [ 0 ] . buf = & ( rb -> buf [ w ] ) ; vec [ 0 ] . len = rb -> size - w ; vec [ 1 ] . buf = rb -> buf ; vec [ 1 ] . len = cnt2 & rb -> size_mask ; } else { vec [ 0 ] . buf = & ( rb -> buf [ w ] ) ; vec [ 0 ] . len = free_cnt ; vec [ 1 ] . len = 0 ; } }
The non-copying data writer.
The non - copying data writer .
/* Two part vector: the rest of the buffer after the current write
		   ptr, plus some from the start of the buffer. */