sc68fordevelopers  2.2.1
Files | Functions
ICE 2.4 depacker library.

ICE 2.4 depacker. More...

Files

file  unice68.h
 

ICE depacker.


Functions

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.

Detailed Description

ICE 2.4 depacker.

Author:
Benjamin Gerard <ben@sashipa.com>

Function Documentation

int unice68_ice_version ( void  )

Get ICE depacker version.

Returns:
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.

Parameters:
bufferbuffer with at least 12 bytes of data (ice header).
p_csizeOptionnal pointer to store compressed size. May be use to verify an expected compressed size. See function documentation for more details.
Returns:
uncompressed size
Return values:
>0Uncompressed size
-1Error, not a valid ICE packed buffer
<0Bitwise 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.

Parameters:
destdestination buffer (uncompressed data).
srcsource buffer (compressed data).
Returns:
error code
Return values:
0succcess
1failure
Warning:
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.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines