BRender Technical Reference Manual:4 Data Structures (Alphabetical Reference):brfile_read_cbfn
Next|Prev|Up
The Call-Back Function
Specification
CBFnFileRead()

brfile_read_cbfn


The Call-Back Function

This type defines a function to read a block from a file, primarily intended for the read member of the br_filesystem
125 structure.

The typedef

(See brfile.h for a precise declaration)

br_size_t brfile_read_cbfn(void*,br_size_t,unsigned,void*) Read block

Specification


CBFnFileRead()

Description:
An application defined call-back function reading a block from a file.

Declaration:
br_size_t BR_CALLBACK CBFnFileRead(void* buf, br_size_t size, unsigned int nelems, void* f)

Arguments:
void * buf

Buffer to receive block.

br_size_t size

Size of each element in block.

unsigned int nelems

Maximum number of elements to read.

void * f

Valid file handle - as returned by CBFnFileOpenRead()376.

Preconditions:
BRender has completed initialisation. BRender is the only direct caller of this function.

Effects:
Read up to nelems elements of size bytes from the file f and store them in buf.

Result:
br_size_t

Return the number of complete elements read, which may be less than nelems if the end of file is encountered before all the elements could be read.

Example:
See stdfile.c for examples of filing system functions.



Generated with CERN WebMaker