src/internal/utils/kitringbuffer.c
int Kit_ReadRingBuffer(Kit_RingBuffer *rb, char *data, int len) {
    len = (len > rb->len) ? rb->len : len;
    if(rb->len > 0) {
        _ReadRingBufferData(rb, data, len);
        rb->len -= len;
        rb->rpos += len;
        if(rb->rpos >= rb->size) {
            rb->rpos = rb->rpos % rb->size;
        }
        return len;
    }
    return 0;
}
/**
  * Reads data from ringbuffer. If ringbuffer has less data than was requested,
  * only the available data will be read.
  * @param rb Ringbuffer to read from.
  * @param data Buffer to read into.
  * @param len How much data do we want
  * @return Amount of data that was actually read.
  */
Reads data from ringbuffer. If ringbuffer has less data than was requested,
only the available data will be read.
@param rb Ringbuffer to read from.
@param data Buffer to read into.
@param len How much data do we want
@return Amount of data that was actually read.
Reads data from ringbuffer . If ringbuffer has less data than was requested only the available data will be read . @param rb Ringbuffer to read from . @param data Buffer to read into . @param len How much data do we want @return Amount of data that was actually read .
int Kit_ReadRingBuffer(Kit_RingBuffer *rb, char *data, int len) {
    len = (len > rb->len) ? rb->len : len;
    if(rb->len > 0) {
        _ReadRingBufferData(rb, data, len);
        rb->len -= len;
        rb->rpos += len;
        if(rb->rpos >= rb->size) {
            rb->rpos = rb->rpos % rb->size;
        }
        return len;
    }
    return 0;
}
int Kit_ReadRingBuffer ( Kit_RingBuffer * rb , char * data , int len ) { len = ( len > rb -> len ) ? rb -> len : len ; if ( rb -> len > 0 ) { _ReadRingBufferData ( rb , data , len ) ; rb -> len -= len ; rb -> rpos += len ; if ( rb -> rpos >= rb -> size ) { rb -> rpos = rb -> rpos % rb -> size ; } return len ; } return 0 ; }
Reads data from ringbuffer.
Reads data from ringbuffer .