Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

FLAC/callback.h: I/O callback structures
[FLAC C API]

This module defines the structures for describing I/O callbacks to the other FLAC interfaces. More...

The purpose of the I/O callback functions is to create a common way for the metadata interfaces to handle I/O.

Originally the metadata interfaces required filenames as the way of specifying FLAC files to operate on. This is problematic in some environments so there is an additional option to specify a set of callbacks for doing I/O on the FLAC file, instead of the filename.

In addition to the callbacks, a FLAC__IOHandle type is defined as an opaque structure for a data source.

The callback function prototypes are similar (but not identical) to the stdio functions fread, fwrite, fseek, ftell, feof, and fclose. If you use stdio streams to implement the callbacks, you can pass fread, fwrite, and fclose anywhere a FLAC__IOCallback_Read, FLAC__IOCallback_Write, or FLAC__IOCallback_Close is required, and a FILE* anywhere a FLAC__IOHandle is required.

Warning:
You generally can NOT directly use fseek or ftell for FLAC__IOCallback_Seek or FLAC__IOCallback_Tell since on most systems these use 32-bit offsets and FLAC requires 64-bit offsets to deal with large files. You will have to find an equivalent function (e.g. ftello), or write a wrapper. The same is true for feof() since this is usually implemented as a macro, not as a function whose address can be taken.

Generated on Sat Jul 31 16:18:52 2004 for FLAC by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002