
------------------------------------------------------------------------------
6.30 Read data from a stream. <Main,Alarm,Comm>
------------------------------------------------------------------------------
[Name]
fread
[Syntax]
#include <stdio.h>
size_t fread( void *buffer, size_t size, size_t count,
FILE *stream ) ;
[Arguments]
buffer Pointer to a data buffer.
size Item size in byte.
count Maximum number of item to be read.
stream Pointer to a FILE structure.
[Return]
Returns number of items which has been read actually. If this value
is less than "count", any error or the end of file before reading
"count" times might be detected. If any error, the file pointer is
undefined. The value read partially is undefined. Use "feof" and
"ferror" functions to distinguish an error from EOF. If "size" or
"count" is zero, returns zero and doesn't change contents of buffer.
[Description]
Reads "count" elements of "size" bytes item from an input stream,
and stores into "buffer". The file pointer linked to "stream" (if
exists) is incremented by bytes number which has been read actually.
If the specified stream is opened with text mode, a pair of carriage
return and line feed (CR+LF) is replaced with a line feed character
(LF). This conversion doesn't affect the file pointer and the return
value.