Files
mars-libowfat/buffer/buffer_getline.3
leitner 82b0bb6f39 extend API To read line/token to stralloc to allow clearing the
stralloc first.
  add stralloc_zero to clear a stralloc
2004-11-25 20:07:31 +00:00

21 lines
729 B
Groff

.TH buffer_getline 3
.SH NAME
buffer_getline \- read line from buffer
.SH SYNTAX
.B #include <buffer.h>
int \fBbuffer_getline\fP(buffer* \fIb\fR,char* \fIx\fR,unsigned int \fIlen\fR);
.SH DESCRIPTION
buffer_getline copies data from \fIb\fR to \fIx\fR[0], \fIx\fR[1], ...,
\fIx\fR[\fIlen\fR-1] until \fIlen\fR bytes have been copied or a
new-line character ('\\n') is encountered. That character is also
copied.
buffer_getline returns the number of bytes read (excluding the '\\n') or
-1 on error (setting \fIerrno\fR appropriately).
Note that line is not 0-terminated to make reading lines with 0-bytes
possible through this interface.
.SH "SEE ALSO"
buffer_init(3), buffer_feed(3), buffer_peek(3), buffer_seek(3), buffer(3)