2 Copyright © 1995-2013, The AROS Development Team. All rights reserved.
12 /*****************************************************************************
25 Read one line of characters from the stream into the buffer.
26 Reading will stop, when a newline ('\n') is encountered, EOF
27 or when the buffer is full. If a newline is read, then it is
28 put into the buffer. The last character in the buffer is always
29 '\0' (Therefore at most size-1 characters can be read in one go).
32 buffer - Write characters into this buffer
33 size - This is the size of the buffer in characters.
34 stream - Read from this stream
37 buffer or NULL in case of an error or EOF.
42 // Read a file line by line
46 while (fgets (line, sizeof (line), fh))
54 fopen(), gets(), fputs(), putc()
58 ******************************************************************************/
60 if (!(stream
->flags
& __STDCIO_STDIO_READ
))
62 SetIoErr(ERROR_READ_PROTECTED
);
64 stream
->flags
|= __STDCIO_STDIO_ERROR
;
68 buffer
= FGets (stream
->fh
, buffer
, size
);
76 errno
= __stdc_ioerr2errno(ioerr
);
77 stream
->flags
|= __STDCIO_STDIO_ERROR
;
81 stream
->flags
|= __STDCIO_STDIO_EOF
;