DevIL Documentation Home | Previous | Next

ilSetRead

The ilSetRead function changes the reading file functions used by DevIL.


ILvoid ilSetRead(
  fOpenRProc Open,
  fCloseRProc Close,
  fEofProc Eof,
  fGetcProc Getc,
  fReadProc Read,
  fSeekRProc Seek,
  fTellRProc Tell
);

Parameters

Open
Pointer to a function to open a file.
Close
Pointer to a function to close a file.
Eof
Pointer to a function that returns IL_TRUE if the end of file is reached.
Getc
Pointer to a function to return one byte from a file.
Read
Pointer to a function to read multiple bytes from a file.
Seek
Pointer to a function to change position in a file.
Tell
Pointer to a function to report the position in a file.

Remarks

ilSetRead was primarily designed to allow languages other than C/C++ access to DevIL's file-reading functions, since other languages do not use stdio.h's FILE* struct. This function can also double usefully in instances where filetypes other than FILE* are used, such as Windows file handles and C++ istreams. Simply provide an alternative to each of the functions needed by DevIL. The "special" datatype ILHANDLE is passed to these functions when used, so any internal datatype used by the differing language (or file handle) can be used.

Error Codes

None

See Also

ilSetWrite, ilResetRead, ilResetWrite