[MINOR] buffers: add peekchar and peekline functions for stream interfaces
authorWilly Tarreau <w@1wt.eu>
Tue, 1 Sep 2009 04:41:32 +0000 (06:41 +0200)
committerWilly Tarreau <w@1wt.eu>
Sat, 19 Sep 2009 12:53:47 +0000 (14:53 +0200)
commit4fe7a2ec6c75266cf961537c362f14d2e9814a58
tree59d45cf5848e5dec1dd97fbc0bfd2521e2ded7fe
parentaeac31979e1042591c0992a358373eb22c44d607
[MINOR] buffers: add peekchar and peekline functions for stream interfaces

The buffer_si_peekline() function is sort of a fgets() to be used from a
stream interface. It returns a complete line whenever possible, and does
not update the buffer's pointer, so that the reader is free to consume
what it wants to.

buffer_si_peekchar() only returns one character, and also needs a call
to buffer_skip() once the character is definitely consumed.
include/proto/buffers.h
src/buffers.c