Logo Search packages:      
Sourcecode: jamin version File versions

size_t jack_ringbuffer_write_space ( const jack_ringbuffer_t *  rb  ) 

Return the number of bytes available for writing.

Parameters:
rb a pointer to the ringbuffer structure.
Returns:
the amount of free space (in bytes) available for writing.

Definition at line 116 of file ringbuffer.c.

{
  size_t w, r;

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

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


Generated by  Doxygen 1.6.0   Back to index