SPRAAK
Data Structures | Typedefs | Enumerations | Functions
+ Collaboration diagram for API_SprLibInternal::lib::core::filefmt:

Data Structures

class  SprStreamBZip
 
class  SprStreamGZip
 
struct  SprCoderCommon
 
struct  SprCoderDef
 Structure to define a certain (en/de)coding pair. More...
 
class  SprStreamCoder
 

Typedefs

typedef int(* SprEncodeFunc) (SprCoderCommon *info)
 Function to encode data in the framework defined in sphere.c. More...
 
typedef int(* SprDecodeFunc) (SprCoderCommon *info)
 Function to decode data in the framework defined in sphere.c. More...
 
typedef int(* SprCoderFiniFunc) (SprCoderCommon *info)
 
typedef int(* SprCoderIniFunc) (SprCoderCommon *info, SprStreamOpenParam *param, unsigned int rw_flags)
 

Enumerations

enum  { SPR_CODER_OK, SPR_CODER_ERR, SPR_CODER_EOF }
 

Functions

int spr_stream_check_coder_bzip2 (SprStreamOpenInfo *info, SprStreamOpenParam *param)
 
int spr_stream_open_coder_bzip2 (SprStreamOpenInfo *restrict info, SprStreamOpenParam *restrict param)
 
uint32_t spr_calc_crc32 (uint32_t crc, const uint8_t *restrict ptr, size_t size)
 
int spr_stream_check_coder_gzip (SprStreamOpenInfo *info, SprStreamOpenParam *param)
 
int spr_stream_open_coder_gzip (SprStreamOpenInfo *restrict info, SprStreamOpenParam *restrict param)
 
int spr_stream_check_coder_sphere (SprStreamOpenInfo *info, SprStreamOpenParam *param)
 
int spr_stream_open_coder_generic (SprStreamOpenInfo *restrict info, SprStreamOpenParam *restrict param)
 
int spr_kset_write_sphere (SprStream *restrict fd, SprKeySet *restrict keys)
 
SprKeySet * spr_kset_read_sphere (SprStream *restrict fd, SprKeySet *restrict keys)
 
SprKeySet * spr_kset_read_wav (SprStream *restrict fd, SprKeySet *restrict keys)
 
int spr_kset_write_wav (SprStream *restrict fd, SprKeySet *restrict keys, int mode)
 

Detailed Description

Typedef Documentation

§ SprEncodeFunc

typedef int(* SprEncodeFunc) (SprCoderCommon *info)

Function to encode data in the framework defined in sphere.c.

§ SprDecodeFunc

typedef int(* SprDecodeFunc) (SprCoderCommon *info)

Function to decode data in the framework defined in sphere.c.

§ SprCoderFiniFunc

typedef int(* SprCoderFiniFunc) (SprCoderCommon *info)

Function to close the (en/de)coding system in the framework defined in sphere.c.

§ SprCoderIniFunc

typedef int(* SprCoderIniFunc) (SprCoderCommon *info, SprStreamOpenParam *param, unsigned int rw_flags)

Function to initialize rhe (en/de)coding system in the framework defined in sphere.c.

Enumeration Type Documentation

§ anonymous enum

anonymous enum

Possible values of the SprEncodeFunc, SprDecodeFunc, SprCoderFiniFunc, en SprCoderIniFunc functions. SPR_CODER_EOF may only be sent if there in no more output data pending!

Enumerator
SPR_CODER_OK 
SPR_CODER_ERR 
SPR_CODER_EOF 

Function Documentation

§ spr_stream_check_coder_bzip2()

int spr_stream_check_coder_bzip2 ( SprStreamOpenInfo *  info,
SprStreamOpenParam *  param 
)

§ spr_stream_open_coder_bzip2()

int spr_stream_open_coder_bzip2 ( SprStreamOpenInfo *restrict  info,
SprStreamOpenParam *restrict  param 
)

§ spr_calc_crc32()

uint32_t spr_calc_crc32 ( uint32_t  crc,
const uint8_t *restrict  ptr,
size_t  size 
)

Calculate/update the CRC32 checksum for a block of (additional) data. The initial value of the CRC32 checksum should be 0.

Returns
The updated CCRC32 checksum.

§ spr_stream_check_coder_gzip()

int spr_stream_check_coder_gzip ( SprStreamOpenInfo *  info,
SprStreamOpenParam *  param 
)

§ spr_stream_open_coder_gzip()

int spr_stream_open_coder_gzip ( SprStreamOpenInfo *restrict  info,
SprStreamOpenParam *restrict  param 
)

§ spr_stream_check_coder_sphere()

int spr_stream_check_coder_sphere ( SprStreamOpenInfo *  info,
SprStreamOpenParam *  param 
)

§ spr_stream_open_coder_generic()

int spr_stream_open_coder_generic ( SprStreamOpenInfo *restrict  info,
SprStreamOpenParam *restrict  param 
)

Open the coder info->keys["COMPRESS"]. The coder must adhere to the framework defined in the file sphere.c.

§ spr_kset_write_sphere()

int spr_kset_write_sphere ( SprStream *restrict  fd,
SprKeySet *restrict  keys 
)

Write the key-set keys to the open stream fd using the SPHERE-header format.

Returns
0 on success, (-1) on failure.
Note
On success, the new size of the header is stored in the appropriate field in the key-set.

§ spr_kset_read_sphere()

SprKeySet* spr_kset_read_sphere ( SprStream *restrict  fd,
SprKeySet *restrict  keys 
)

Read the SPHERE header from the open stream fd and store all relevant information as keys in the key-set keys. The stream must be in read mode and the read pointer should be positioned right before the magic word (file header indicator). If keys equals NULL, the keyset internal to fd will be used (which will be allocated if needed). In other words, the only way to use a keyset different to the one inside fd is by specifying a non NULL keys argument.

Returns
The key-set on success and (NULL) on failure.
Note
On success, the new size of the header is stored in the appropriate field in the key-set.
On failure, a key-set given as input argument will not be freed.

§ spr_kset_read_wav()

SprKeySet* spr_kset_read_wav ( SprStream *restrict  fd,
SprKeySet *restrict  keys 
)

Read the RIFF-wav header from the open stream fd and store all relevant information as keys in the key-set keys. The stream must be in read mode and the read pointer should be positioned right before the magic word (file header indicator). If keys equals NULL, the keyset internal to fd will be used (which will be allocated if needed). In other words, the only way to use a keyset different to the one inside fd is by specifying a non NULL keys argument.

Returns
The key-set on success and (NULL) on failure.
Note
On success, the new size of the header is stored in the appropriate field in the key-set.
On failure, a key-set given as input argument will not be freed.

§ spr_kset_write_wav()

int spr_kset_write_wav ( SprStream *restrict  fd,
SprKeySet *restrict  keys,
int  mode 
)

Write the RIFF-wav header to the open stream fd. If keys equals NULL, the keyset internal to fd will be used. The flag mode determines how much space the header may occupy on disk:

SPR_KSET_MODE_FIT
the same amount space as from where the key-set was read (or to where it was last written to),
SPR_KSET_MODE_FIT_ERR
the same as SPR_KSET_MODE_FIT, but give an error if the header does not fit,
SPR_KSET_MODE_MIN,SPR_KSET_MODE_STD
the normal amount of space,
Returns
0 on success, (-1) on failure, and the required space needed if mode equals SPR_KSET_MODE_FIT and the header could not be written in the available space.
Note
On success, the new size of the header is stored in the appropriate field in the key-set.