#include <cat.h>
int catbuf_copy(cat_buffer *b, int pos, int length, void *outbuf)
catbuf_copy() copies length, a number of bytes, from position pos in a buffer without changing the current index. The result is store in outbuf,which must be a sufficiently large area of memory allocated by the caller.
If length is negative, the entire buffer, from pos to the end of the buffer, will be copied.
A corresponding static write operation is performed by catbuf_overwrite().