Dependencies/Build/mac/include/faust/gui/ring-buffer.h
static void
ringbuffer_get_read_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 = w - r;
	} else {
		free_cnt = (w - r + rb->size) & rb->size_mask;
	}

	cnt2 = r + 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[r]);
		vec[0].len = rb->size - r;
		vec[1].buf = rb->buf;
		vec[1].len = cnt2 & rb->size_mask;

	} else {

		/* Single part vector: just the rest of the buffer */

		vec[0].buf = &(rb->buf[r]);
		vec[0].len = free_cnt;
		vec[1].len = 0;
	}
}
/* The non-copying data reader. `vec' is an array of two places. Set
   the values at `vec' to hold the current readable data at `rb'. If
   the readable data is in one segment the second segment has zero
   length. */
The non-copying data reader. `vec' is an array of two places. Set
the values at `vec' to hold the current readable data at `rb'. If
the readable data is in one segment the second segment has zero
length.
The non - copying data reader . ` vec ' is an array of two places . Set the values at ` vec ' to hold the current readable data at ` rb ' . If the readable data is in one segment the second segment has zero length .
static void
ringbuffer_get_read_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 = w - r;
	} else {
		free_cnt = (w - r + rb->size) & rb->size_mask;
	}
	cnt2 = r + free_cnt;
	if (cnt2 > rb->size) {
		vec[0].buf = &(rb->buf[r]);
		vec[0].len = rb->size - r;
		vec[1].buf = rb->buf;
		vec[1].len = cnt2 & rb->size_mask;
	} else {
		vec[0].buf = &(rb->buf[r]);
		vec[0].len = free_cnt;
		vec[1].len = 0;
	}
}
static void ringbuffer_get_read_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 = w - r ; } else { free_cnt = ( w - r + rb -> size ) & rb -> size_mask ; } cnt2 = r + free_cnt ; if ( cnt2 > rb -> size ) { vec [ 0 ] . buf = & ( rb -> buf [ r ] ) ; vec [ 0 ] . len = rb -> size - r ; vec [ 1 ] . buf = rb -> buf ; vec [ 1 ] . len = cnt2 & rb -> size_mask ; } else { vec [ 0 ] . buf = & ( rb -> buf [ r ] ) ; vec [ 0 ] . len = free_cnt ; vec [ 1 ] . len = 0 ; } }
The non-copying data reader.
The non - copying data reader .
/* Two part vector: the rest of the buffer after the current write
		   ptr, plus some from the start of the buffer. */ /* Single part vector: just the rest of the buffer */