Ring buffer (or circular buffer) C library