NAME

catbuf_dup - duplicate a buffer

SYNOPSIS

#include <cat.h>

cat_buffer *catbuf_dup(cat_session *sess, cat_buffer *buf);

DESCRIPTION

catbuf_dup() creates and returns a copy of a buffer. A new buffer is allocated and the data from buf is copied to the new buffer. buf is unaffected by the operation.

The new buffer will be associated with session sess.

RETURN VALUES

Returns a pointer to a copy of the supplied buffer if successful, and a NULL pointer otherwise. The returned buffer should be freed with the catbuf_free() function.

SEE ALSO

cat, catbuf