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

# DecMPA_Callbacks Struct Reference
[Structures]

This structure contains pointers to the functions that are used to read the MP3 data during DecMPA_Decode. More...

`#include <decmpa.h>`

List of all members.

## Public Attributes

long(* | Read )(void *pContext, void *pBuffer, long nBytes)
| Pointer to the function that is used to read data.
int(* | Seek )(void *pContext, long DestPos)
| Pointer to function that seeks to the specified data stream position.
long(* | GetLength )(void *pContext)
| Pointer to a function that returns the length of the data stream.
long(* | GetPosition )(void *pContext)
| Pointer to a function that returns the current position in the data stream.

## Detailed Description

This structure contains pointers to the functions that are used to read the MP3 data during DecMPA_Decode.

## Member Data Documentation

long( * Read)(void* pContext,void* pBuffer,long nBytes)

| Pointer to the function that is used to read data. If this pointer is NULL, DecMPA will read from stdin and ignore the other callback functions.

Parameters:

  pContext | context pointer that was passed to DecMPA_CreateUsingCallbacks
  pBuffer | buffer that the data should be stored into
  nBytes | number of bytes to read

Returns :
  the number of bytes read or -1 if an error occurred. If the returned value is less than nBytes it is assumed that the end of the data stream was reached.

Note:
  the function that the pointer points to should have the calling convention DECMPA_CC, i.e. it should be defined as:

              long DECMPA_CC MyReadFuncName(void* pContext,void* pBuffer,long nBytes);

int( * Seek)(void* pContext,long DestPos)

| Pointer to function that seeks to the specified data stream position. This function pointer should be set to NULL if seeking is not supported.

Parameters:

  pContext | context pointer that was passed to DecMPA_CreateUsingCallbacks
  DestPos | destination position, in bytes.

Returns :
  nonzero if successful, 0 otherwise.

Note:
  the function that the pointer points to should have the calling convention DECMPA_CC, i.e. it should be defined as:

              int DECMPA_CC MySeekFuncName(void* pContext,long DestPos);

long( * GetLength)(void* pContext)

| Pointer to a function that returns the length of the data stream. This function pointer can be set to NULL if the length cannot be determined. Alternatively the function can return -1,

Parameters:

  pContext | context pointer that was passed to DecMPA_CreateUsingCallbacks

Returns :
  the length, in bytes. -1 if unknown.

Note:
  the function that the pointer points to should have the calling convention DECMPA_CC, i.e. it should be defined as:

              long DECMPA_CC MyGetLengthFuncName(void* pContext);

long( * GetPosition)(void* pContext)

| Pointer to a function that returns the current position in the data stream. This function pointer can only be NULL if Read is also NULL.

Parameters:

  pContext | context pointer that was passed to DecMPA_CreateUsingCallbacks

Returns :
  the current position, in bytes or -1 if an error occurred.

Note:
  the function that the pointer points to should have the calling convention DECMPA_CC, i.e. it should be defined as:

              long DECMPA_CC MyGetPositionFuncName(void* pContext);

The documentation for this struct was generated from the following file:

- decmpa.h