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.
 
 
 
 

27 lines
1.1 KiB

  1. .TH buffer_get 3
  2. .SH NAME
  3. buffer_get \- read binary data from buffer
  4. .SH SYNTAX
  5. .B #include <buffer.h>
  6. int \fBbuffer_get\fP(buffer* \fIb\fR,char* \fIx\fR,unsigned long int \fIlen\fR);
  7. .SH DESCRIPTION
  8. Normally buffer_get copies data to \fIx\fR[0], \fIx\fR[1], ...,
  9. \fIx\fR[\fIlen\fR-1] from the beginning of a string stored in
  10. preallocated space; removes these \fIlen\fR bytes from the string; and
  11. returns \fIlen\fR.
  12. If, however, the string has fewer than \fIlen\fR (but more than 0)
  13. bytes, buffer_get copies only that many bytes, and returns that number.
  14. If the string is empty, buffer_get first uses a \fBread operation\fR to
  15. feed data into the string. The \fBread operation\fR may indicate end of
  16. input, in which case buffer_get returns 0; or a read error, in which
  17. case buffer_get returns -1, setting \fIerrno\fR approporiately.
  18. The preallocated space and the \fBread operation\fR are specified by
  19. \fIb\fR. You must initialize \fBb\fR using buffer_init before calling
  20. buffer_get (or use the pre-initialized buffer_0).
  21. .SH "SEE ALSO"
  22. buffer_init(3), buffer_feed(3), buffer_peek(3), buffer_seek(3), buffer(3)