catbuf_split - split a data buffer
#include <cat.h>
cat_buffer *catbuf_split(cat_buffer *b, int offset);
catbuf_split() splits buffer b at index offset. Everything after and including the position offset is removed from buffer b and inserted into the new buffer returned by this function.
The new buffer will be associated with the same session as the original
buffer.
catbuf_join() is the corresponding operation to merge two buffers.
Returns a pointer to the new buffer, starting at offset, or NULL if the operation failed.
cat, catbuf, catbuf_join