xt_ff_read(3)

NAME
xt_ff_read() - Read a fixed number of bytes from a fast file stream

LIBRARY
#include <xtend/file.h>
-lxtend

SYNOPSIS
size_t  xt_ff_read(xt_ff_t *stream, void * restrict ptr,
size_t size, size_t nmemb)

ARGUMENTS
stream  Pointer to an xt_ff_t structure
ptr     Memory location where data read from stream will be stored
size    Size of one object being read
nmemb   Number of objects to read

DESCRIPTION
xt_ff_read(3) reads a fixed number of bytes (size * nmemb) from stream, storing them at address ptr, which should point to an object (if nmemb == 1) or array of "nmemb" objects of size "size".

RETURN VALUES
The number of objects (not bytes) successfully read

EXAMPLES
my_type_t   list[NUM_OBJECTS];
xt_ff_t     *stream;
stream = xt_ff_open("myfile", O_RDONLY);
xt_ff_read(stream, list, sizeof(my_type_t), NUM_OBJECTS);

SEE ALSO
read(2), xt_ff_open(3)