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

include/FLAC/callback.h File Reference

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

#include "ordinals.h"
#include <stdlib.h>

Go to the source code of this file.

Compounds

struct  FLAC__IOCallbacks

Typedefs

typedef void * FLAC__IOHandle
typedef size_t(* FLAC__IOCallback_Read )(void *ptr, size_t size, size_t nmemb, FLAC__IOHandle handle)
typedef size_t(* FLAC__IOCallback_Write )(const void *ptr, size_t size, size_t nmemb, FLAC__IOHandle handle)
typedef int(* FLAC__IOCallback_Seek )(FLAC__IOHandle handle, FLAC__int64 offset, int whence)
typedef FLAC__int64(* FLAC__IOCallback_Tell )(FLAC__IOHandle handle)
typedef int(* FLAC__IOCallback_Eof )(FLAC__IOHandle handle)
typedef int(* FLAC__IOCallback_Close )(FLAC__IOHandle handle)


Detailed Description

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

See the detailed documentation for callbacks in the callbacks module.


Typedef Documentation

typedef size_t(* FLAC__IOCallback_Read)(void *ptr, size_t size, size_t nmemb, FLAC__IOHandle handle)
 

Signature for the read callback. The signature and semantics match POSIX fread() implementations and can generally be used interchangeably.

Parameters:
ptr  The address of the read buffer.
size  The size of the records to be read.
nmemb  The number of records to be read.
handle  The handle to the data source.
Return values:
size_t  The number of records read.

typedef size_t(* FLAC__IOCallback_Write)(const void *ptr, size_t size, size_t nmemb, FLAC__IOHandle handle)
 

Signature for the write callback. The signature and semantics match POSIX fwrite() implementations and can generally be used interchangeably.

Parameters:
ptr  The address of the write buffer.
size  The size of the records to be written.
nmemb  The number of records to be written.
handle  The handle to the data source.
Return values:
size_t  The number of records written.

typedef int(* FLAC__IOCallback_Seek)(FLAC__IOHandle handle, FLAC__int64 offset, int whence)
 

Signature for the seek callback. The signature and semantics mostly match POSIX fseek() WITH ONE IMPORTANT EXCEPTION: the offset is a 64-bit type whereas fseek() is generally 'long' and 32-bits wide.

Parameters:
handle  The handle to the data source.
offset  The new position, relative to whence
whence  SEEK_SET, SEEK_CUR, or SEEK_END
Return values:
int  0 on success, -1 on error.

typedef FLAC__int64(* FLAC__IOCallback_Tell)(FLAC__IOHandle handle)
 

Signature for the tell callback. The signature and semantics mostly match POSIX ftell() WITH ONE IMPORTANT EXCEPTION: the offset is a 64-bit type whereas ftell() is generally 'long' and 32-bits wide.

Parameters:
handle  The handle to the data source.
Return values:
FLAC__int64  The current position on success, -1 on error.

typedef int(* FLAC__IOCallback_Eof)(FLAC__IOHandle handle)
 

Signature for the EOF callback. The signature and semantics mostly match POSIX feof() but WATCHOUT: on many systems, feof() is a macro, so in this case a wrapper function must be provided instead.

Parameters:
handle  The handle to the data source.
Return values:
int  0 if not at end of file, nonzero if at end of file.

typedef int(* FLAC__IOCallback_Close)(FLAC__IOHandle handle)
 

Signature for the close callback. The signature and semantics match POSIX fclose() implementations and can generally be used interchangeably.

Parameters:
handle  The handle to the data source.
Return values:
int  0 on success, EOF on error.


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