Decompress API - Decompress a block of data

Decompresses a block of data. The src parameter points to a block of data that is srcLen bytes in size. The tgt parameter points to a buffer that is tgtSize bytes in size. The plug-in library decompresses the data at address src and writes the uncompressed data to the buffer at address tgt. The actual size of the uncompressed data is returned as tgtLen. If the library returned a value of 1 for piInfo->useCRC, the CRC of the uncompressed block is returned as tgtCRC. If the library returned a value of 0 for piInfo->useCRC, tgtLen will be a null pointer.

Authorization

None

Required connection

None

API include file

sqlucompr.h

API and data structure syntax

int Decompress(
      struct COMPR_CB *pCB,
      const char *src,
      db2int32 srcSize,
      char *tgt,
      db2int32 tgtSize,
      db2int32 *tgtLen,
      db2Uint32 *tgtCRC);

Decompress API parameters

pCB
Input. This is the control block that was returned by the InitDecompression API call.
src
Input. Pointer to the block of data to be decompressed.
srcLen
Input. Size in bytes of the block of data to be decompressed.
tgt
Input and output. Target buffer for decompressed data. Db2® will supply this target buffer and the plug-in will decompress the data at src and write decompressed data here.
tgtSize
Input. Size in bytes of the target buffer.
tgtLen
Output. Actual amount in bytes of decompressed data stored in tgt.
tgtCRC
Output. If the library returned a value of 1 for piInfo->useCRC, the CRC value of the uncompressed block is returned as tgtCRC. If the library returned a value of 0 for piInfo->useCRC, tgtCRC will be a null pointer.