Home Download Musics Developers
API Sources Tools File Format Technicals

ICE 2.4 depacker library.

Detailed Description

ICE 2.4 depacker.

Benjamin Gerard <ben@sashipa.com>


file  unice68.h
 ICE depacker.


int unice68_ice_version (void)
 Get ICE depacker version.

int unice68_get_depacked_size (const void *buffer, int *p_csize)
 Test ICE and get compressed and uncompresed size.

int unice68_depacker (void *dest, const void *src)
 Depack an ICE buffer to another.

Function Documentation

int unice68_ice_version void   ) 

Get ICE depacker version.

version number (MAJOR*100+MINOR)

int unice68_get_depacked_size const void *  buffer,
int *  p_csize

Test ICE and get compressed and uncompresed size.

The unice68_get_depacked_size() function returns the uncompressed size of a ICE compressed buffer. If p_size is not 0 it is fill with the size of the compressed data found in header (useful for stream operation). If the value pointed by p_csize is not 0 the function assumes that it is an expected compressed size and compares it to header one. If it differs the function returns the bitwise NOT value of uncompressed data. This should be a minus value but not -1.

buffer buffer with at least 12 bytes of data (ice header).
p_csize Optionnal pointer to store compressed size. May be use to verify an expected compressed size. See function documentation for more details.
uncompressed size
Return values:
>0 Uncompressed size
-1 Error, not a valid ICE packed buffer
<0 Bitwise NOT of uncompressed size but verify failed.

int unice68_depacker void *  dest,
const void *  src

Depack an ICE buffer to another.

The unice68_depacker() depack src ICE compressed buffer to dest. The dest buffer is assumed to be already allocated with enought room.

dest destination buffer (uncompressed data).
src source buffer (compressed data).
error code
Return values:
0 succcess
1 failure
The original ICE depacker may allow to use the same buffer for compressed and uncompressed data. Anyway this has not been tested and you are encouraged to add guard bands.