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
843 B

  1. .TH buffer_getn 3
  2. .SH NAME
  3. buffer_getn \- read binary data from buffer
  4. .SH SYNTAX
  5. .B #include <buffer.h>
  6. int \fBbuffer_getn\fP(buffer* \fIb\fR,char* \fIx\fR,unsigned long int \fIlen\fR);
  7. .SH DESCRIPTION
  8. buffer_getn copies data to \fIx\fR[0], \fIx\fR[1], ...,
  9. \fIx\fR[\fIlen\fR-1] from the buffer, calling buffer_feed as needed, and
  10. returns \fIlen\fR.
  11. If a read error occurs, buffer_getn returns -1 and sets \fIerrno\fR
  12. appropriately. It may then have put any number between 0 and \fIlen\fR
  13. in the buffer, you can't tell. That makes this function only useful if
  14. you don't care when an error occurs. Use buffer_get otherwise.
  15. If the read operation signals end-of-file before \fIlen\fR bytes were
  16. read, buffer_getn returns the number of bytes read from the buffer
  17. before end-of-file.
  18. .SH "SEE ALSO"
  19. buffer_init(3), buffer_get(3), buffer(3)