DevIL Documentation Home | Previous | Next

ilSetWrite

The ilSetWrite function changes the file writing functions used by OpenIL.


ILvoid ilSetWrite(
  fOpenWProc Open,
  fCloseWProc Close,
  fPutcProc Putc,
  fSeekWProc Seek,
  fTellWProc Tell
  fWriteProc Write
);

Parameters

Open
Pointer to a function to open a file.
Close
Pointer to a function to close a file.
Putc
Pointer to a function to write one byte to 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.
Write
Pointer to a function to write multiple bytes to a file.

Remarks

ilSetWrite was primarily designed to allow languages other than C/C++ access to OpenIL's robust file-writing 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 OpenIL. 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

ilResetWrite, ilSetRead, ilResetWrite