#include <cat.h>
int catbuf_insert(cat_buffer *b, int offset, int length, const void *indata);
The current index pointer is affected only if the data is inserted before it, in which case the pointer is incremented by the length of the inserted data.
catbuf_delete(), catbuf_insert(), and catbuf_extract() are block read/write functions for data buffers.