File: buffer_getline.3

package info (click to toggle)
libowfat 0.22-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 3,148 kB
  • ctags: 976
  • sloc: ansic: 10,424; makefile: 42
file content (19 lines) | stat: -rw-r--r-- 712 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
.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,unsigned char* \fIx\fR,unsigned long 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.

Note that line is not 0-terminated to make reading lines with 0-bytes
possible through this interface.
.SH "RETURN VALUE"
Number of bytes read (without '\\n'), -1 on error (setting \fIerrno\fR).
.SH "SEE ALSO"
buffer_init(3), buffer_feed(3), buffer_peek(3), buffer_seek(3), buffer(3)