Mirror of :pserver:cvs@cvs.fefe.de:/cvs libowfat https://www.fefe.de/libowfat/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
972 B

.TH buffer_get_token_pred 3
buffer_get_token_pred \- read token from buffer
.B #include <buffer.h>
int \fBbuffer_get_token_pred\fP(buffer* \fIb\fR,char* \fIx\fR,unsigned long int \fIlen\fR,
int (*\fIpredicate\fR)(const char* \fIs\fR,unsigned long int \fIlen\fR));
buffer_get_token_pred copies data from \fIb\fR to \fIx\fR[0],
\fIx\fR[1], ..., \fIx\fR[\fIlen\fR-1] until \fIlen\fR bytes have been
read or \fIpredicate\fR called on the destination string returns
\fIpredicate\fR can also return 0 (indicating further input is required
to complete the token) or -1 (abort and return -1; use this if
\fIpredicate\fR wants to enfore a maximum message size or does timeout
handling or detects a malformed message).
buffer_get_token_pred returns the number of bytes copied or -1 on
error (setting \fIerrno\fR appropriately).
buffer_init(3), buffer_feed(3), buffer_peek(3), buffer_seek(3), buffer(3)