character ring buffer library