NAME

catbuf_new - create a new data buffer

SYNOPSIS

#include <cat.h>

cat_buffer *catbuf_new(cat_session *session, int length, void *data);

DESCRIPTION

catbuf_new() creates a new buffer, optionally inserting specified data into it. The data is not copied and becomes the property of the buffer.

To create an empty buffer, use a zero length. To create a buffer of a specified size and with undefined contents, set data to NULL.

The data, if non-NULL, must have been dynamically allocated.

RETURN VALUES

Returns a pointer to the newly created cat_buffer or NULL if the operation failed.

SEE ALSO

cat, catbuf, catbuf_free