BOOL hb_LZSSxDecompressFile( HB_FHANDLE hInput, HB_FHANDLE hOutput ) { PHB_LZSSX_COMPR pCompr; BOOL fResult; pCompr = hb_LZSSxInit( hInput, NULL, 0, hOutput, NULL, 0 ); fResult = hb_LZSSxDecode( pCompr ); hb_LZSSxExit( pCompr ); return fResult; }
HB_BOOL hb_LZSSxDecompressFile( PHB_FILE pInput, PHB_FILE pOutput ) { PHB_LZSSX_COMPR pCompr; HB_BOOL fResult; pCompr = hb_LZSSxInit( pInput, NULL, 0, pOutput, NULL, 0 ); fResult = hb_LZSSxDecode( pCompr ); hb_LZSSxExit( pCompr ); return fResult; }
BOOL hb_LZSSxCompressFile( HB_FHANDLE hInput, HB_FHANDLE hOutput, ULONG * pulSize ) { PHB_LZSSX_COMPR pCompr; ULONG ulSize; pCompr = hb_LZSSxInit( hInput, NULL, 0, hOutput, NULL, 0 ); ulSize = hb_LZSSxEncode( pCompr ); hb_LZSSxExit( pCompr ); if( pulSize ) *pulSize = ulSize; return ulSize != ( ULONG ) -1; }
BOOL hb_LZSSxDecompressMem( BYTE * pSrcBuf, ULONG ulSrcLen, BYTE * pDstBuf, ULONG ulDstLen ) { PHB_LZSSX_COMPR pCompr; BOOL fResult; pCompr = hb_LZSSxInit( FS_ERROR, pSrcBuf, ulSrcLen, FS_ERROR, pDstBuf, ulDstLen ); fResult = hb_LZSSxDecode( pCompr ); hb_LZSSxExit( pCompr ); return fResult; }
HB_BOOL hb_LZSSxCompressFile( PHB_FILE pInput, PHB_FILE pOutput, HB_SIZE * pnSize ) { PHB_LZSSX_COMPR pCompr; HB_SIZE nSize; pCompr = hb_LZSSxInit( pInput, NULL, 0, pOutput, NULL, 0 ); nSize = hb_LZSSxEncode( pCompr ); hb_LZSSxExit( pCompr ); if( pnSize ) *pnSize = nSize; return nSize != ( HB_SIZE ) -1; }
HB_BOOL hb_LZSSxDecompressMem( const char * pSrcBuf, HB_SIZE nSrcLen, char * pDstBuf, HB_SIZE nDstLen ) { PHB_LZSSX_COMPR pCompr; HB_BOOL fResult; pCompr = hb_LZSSxInit( NULL, ( const HB_BYTE * ) pSrcBuf, nSrcLen, NULL, ( HB_BYTE * ) pDstBuf, nDstLen ); fResult = hb_LZSSxDecode( pCompr ); hb_LZSSxExit( pCompr ); return fResult; }
BOOL hb_LZSSxCompressMem( BYTE * pSrcBuf, ULONG ulSrcLen, BYTE * pDstBuf, ULONG ulDstLen, ULONG * pulSize ) { PHB_LZSSX_COMPR pCompr; ULONG ulSize; pCompr = hb_LZSSxInit( FS_ERROR, pSrcBuf, ulSrcLen, FS_ERROR, pDstBuf, ulDstLen ); ulSize = hb_LZSSxEncode( pCompr ); hb_LZSSxExit( pCompr ); if( pulSize ) *pulSize = ulSize; return ( ulSize <= ulDstLen ); }
HB_BOOL hb_LZSSxCompressMem( const char * pSrcBuf, HB_SIZE nSrcLen, char * pDstBuf, HB_SIZE nDstLen, HB_SIZE * pnSize ) { PHB_LZSSX_COMPR pCompr; HB_SIZE nSize; pCompr = hb_LZSSxInit( NULL, ( const HB_BYTE * ) pSrcBuf, nSrcLen, NULL, ( HB_BYTE * ) pDstBuf, nDstLen ); nSize = hb_LZSSxEncode( pCompr ); hb_LZSSxExit( pCompr ); if( pnSize ) *pnSize = nSize; return nSize <= nDstLen; }