NAME

catbuf_put - pass data to the filter stack

SYNOPSIS

#include <cat.h>

int catbuf_put(cat_session *s, int fd, cat_buffer *b);

DESCRIPTION

catbuf_put() stores data buffer b for file descriptor fd of session s. If a buffer for this file descriptor already exists in the session, the buffer will be deleted.

catbuf_put() and catbuf_get() comprise the interface with the filter stack. All data passed to or from file descriptors in a filter should use these functions. Hence, these functions work only in association with a session.

The buffer should not be accessed again, unless retrieved with catbuf_get().

RETURN VALUES

This function returns CAT_OK if successful, or a negative code on error.

SEE ALSO

cat, catbuf, catbuf_get