man buffer_peek () - return pointer to string in buffer

NAME

buffer_peek - return pointer to string in buffer

SYNTAX

#include <buffer.h>

int buffer_peek(buffer* b);

DESCRIPTION

buffer_peek returns a pointer to the first byte of the string in the buffer.

EXAMPLE

buffer_feed, buffer_peek and buffer_seek can be used for efficient reading loops, nearly the same speed as calling op directly:

for (;;) { r = buffer_feed(&b); if (r <= 0) return r; x = buffer_peek(&b); dosomething(x,r); buffer_seek(&b,r); }

SEE ALSO