NAME

catbuf_split - split a data buffer

SYNOPSIS

#include <cat.h>

cat_buffer *catbuf_split(cat_buffer *b, int offset);

DESCRIPTION

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.

RETURN VALUES

Returns a pointer to the new buffer, starting at offset, or NULL if the operation failed.

SEE ALSO

cat, catbuf, catbuf_join