BRender Technical Reference Manual:4 Data Structures (Alphabetical Reference):br_filesystem
Next|Prev|Up
The Structure
Members
Operations
BrFilesystemSet()
Copy/Assign
Access & Maintenance
Referencing & Lifetime
Initialisation
Construction & Destruction
Supplementary

br_filesystem


The Structure

BRender routes all filing system calls through an instance of this structure. The syntax of each call-back function corresponds exactly with the standard C library calls. This allows the user to tailor BRender's file system characteristics to suit any platform.

See BrFilesystemSet()127 for details of how to specify a particular filing system handler.

The typedef

(See brfile.h for precise declaration and ordering)

Informational

brfile_attributes_cbfn * attributes Function to inquire capabilities of filing system

Filing functions

brfile_open_read_cbfn * open_read Function to open a file for reading

brfile_open_write_cbfn * open_write Function to open a file for writing

brfile_close_cbfn * close Function to close an opened file

brfile_eof_cbfn * eof Function to check for end of file

brfile_getchr_cbfn * getchr Function to read one character

brfile_putchr_cbfn * putchr Function to write one character

brfile_read_cbfn * read Function to read a block

brfile_write_cbfn * write Function to write a block

brfile_getline_cbfn * getline Function to read a line of text

brfile_putline_cbfn * putline Function to write a line of text

brfile_advance_cbfn * advance Function to advance through a stream

Supplementary

char * identifier Name of filing system

Members

Informational

brfile_attributes_cbfn *attributes

This is a pointer to the function to obtain attributes of the filing system (see brfile_attributes_cbfn371). This is called by BrFileAttributes()57 (See Filing System Support, page 57).

Filing Functions

brfile_open_read_cbfn * open_read

This is a pointer to the function to open a file for reading (see brfile_open_read_cbfn376). This is called by BrFileOpenRead()60 (See Filing System Support, page 57).

brfile_open_write_cbfn * open_write

This is a pointer to the function to open a file for writing (see brfile_open_write_cbfn378). This is called by BrFileOpenWrite()57 (See Filing System Support, page 57).

brfile_close_cbfn * close

This is a pointer to the function to close a file (see brfile_close_cbfn372). This is called by BrFileClose()63 (See Filing System Support, page 57).

brfile_eof_cbfn * eof

This is a pointer to the function to check for end of file (see brfile_eof_cbfn373). This is called by BrFileEof()62 (See Filing System Support, page 57).

brfile_getchr_cbfn * getchr

This is a pointer to the function to read one character (see brfile_getchr_cbfn374). This is called by BrFileGetChar()62 (See Filing System Support, page 57).

brfile_putchr_cbfn * putchr

This is a pointer to the function to write one character (see brfile_putchr_cbfn379). This is called by BrFilePutChar()59 (See Filing System Support, page 57).

brfile_read_cbfn * read

This is a pointer to the function to read a block (see brfile_read_cbfn381). This is called by BrFileRead()60 (See Filing System Support, page 57).

brfile_write_cbfn * write

This is a pointer to the function to write a block (see brfile_write_cbfn382). This is called by BrFileWrite()58 (See Filing System Support, page 57).

brfile_getline_cbfn * getline

This is a pointer to the function to read a line of text (see brfile_getline_cbfn375). This is called by BrFileGetLine()61 (See Filing System Support, page 57).

brfile_putline_cbfn * putline

This is a pointer to the function to write a line of text (see brfile_putline_cbfn380). This is called by BrFilePutLine()59 (See Filing System Support, page 57).

brfile_advance_cbfn * advance

This is a pointer to the function to advance through a stream (see brfile_getchr_cbfn374). This is called by BrFileGetChar()62 (See Filing System Support, page 57).

Supplementary

char * identifier

Pointer to unique, zero terminated, character string (or Null if not required). A string constant is recommended.

Operations


BrFilesystemSet()

Description:
Install a new file system.

Declaration:
const br_filesystem* BrFilesystemSet(const br_filesystem* newfs)

Arguments:
const br_filesystem * newfs

A pointer to an instance of a br_filesystem125 structure.

Result:
const br_filesystem *

Returns a pointer to the old br_filesystem125 structure.


Copy/Assign

Beware of copying the structure if identifier has been allocated from the heap.

Access & Maintenance

While the structure is the current handler (most recently passed to BrFilesystemSet()127) the members should not be changed. No maintenance required.

Referencing & Lifetime

The structure must remain valid until a new handler is passed to BrFilesystemSet()127.

Initialisation

The members should be set before the structure is passed to BrFilesystemSet()127.

Construction & Destruction

The structure should ideally be statically constructed.

Supplementary

The identifier may be used to determine the current handler in use.


Generated with
CERN WebMaker