-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbugets.mn
21 lines (17 loc) · 923 Bytes
/
bugets.mn
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
bugets
_fd_ _opt_buf_ _maxlen_ _opt_eof_
#include <jelio.h>
Reads input from filedescripor _fd_ until linefeed or end-of-file is encountered.
If _opt_buf_ is NULL the function proceeds as normal but no data is stored.
_maxlen_ is the size of the buffer _opt_buf_.
The linefeed character is stored in the buffer if it was encountered (and _maxlen_ was not reached).
If the amount of read data exceeds _maxlen_ the overflow is flushed and lost.
If _opt_eof_ if given *_opt_eof_ is set to nonzero if end of file is encountered.
Data read into _opt_buf_ is always null-terminated.
The data from filedescriptor _fd_ is buffered internally. The buffer can be freed by a call to buclose().
Returns the number of characters written into the buffer _opt_buf_. If _opt_buf_ is NULL returns the number of characters that would have been written into _opt_buf_.
The trailing zero is not counted.
buclose ,
dgets ,
buscanv ,
sscanv