QP_fread()

Synopsis

     #include <quintus/quintus.h>
     
     int QP_fread (ptr, size, nitems, stream)
     char      *ptr;
     int        size;
     int        nitems;
     QP_stream *stream;
     

Reads, into a block pointed to by ptr, nitems items of data from the named input stream stream, where an item of data is a sequence of bytes (not necessarily terminated by a NULL byte) of length size.

QP_fread() is similar to the library function fread(3S), however the return values differ slightly and stream is a Prolog stream rather than a stdio stream.

Return Value


the number of items read
Returned if the function succeeds
QP_ERROR
Otherwise

See Also

QP_fopen(), QP_getc(), QP_gets(), QP_putc(), QP_puts(), QP_printf() fli-ios