P_buf_init 3porty 2011-04-13 libporty manual

NAME

P_buf_init, P_buf_uninit

SYNPOSIS

#include <libporty/util/buf.h>

P_buf_t * P_buf_init (const char *sep );
void P_buf_uninit (P_buf_t buff );

Link with -lporty_util

DESCRIPTION

P_buf_init allocates and returns a new buffer that can be destroyed using P_buf_uninit . The buffer can be used to process streams splitting them up to messages (for example lines). *sep is a list of separator characters. If any of these appear in the stream, the current message (line) is closed and a new ne is started. Multiple adjacent separators cause empty messages to be read.

RETURN VALUE

P_buf_init returns pointer to the new buffer.

SEE ALSO

P_buf_init 3porty 2011-04-13 libporty manual