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

brfile_write_cbfn


The Call-Back Function

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

The typedef

(See brfile.h for a precise declaration)

br_size_t brfile_write_cbfn(const void*,br_size_t,unsigned,void*) Write block

Specification


CBFnFileWrite()

Description:
An application defined call-back function writing a block to a file.

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

Arguments:
const void * buf

Buffer containing block to be written.

br_size_t size

Size of each element in block.

unsigned int nelems

Maximum number of elements to write.

void * f

Valid file handle - as returned by CBFnFileOpenWrite()378.

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

Effects:
Write up to nelems elements from buf to the file f.

Result:
br_size_t

Return the number of complete elements written, which may be less than nelems if an error occurs (such as running out of file space).

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



Generated with CERN WebMaker