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.

24 lines
972 B

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