# SimpleCompress

Compresses some data in memory.

### Synopsis

`Err SimpleCompress(void *source, uint32 sourceWords,void *result, uint32 resultWords);`

### Description

Compresses a chunk of memory to a different chunk of memory.

### Arguments

source
  A pointer to memory containing the data to be compressed. This pointer must be on a 4-byte boundary.

sourceWords
  The number of words of data to compress.

result
  A pointer to where the compressed data is to be deposited.

resultWords
  The number of words available in the result buffer. If the compressed data is larger than this size, an overflow will be reported.

### Return Value

If the return value is positive, it indicates the number of words copied to the result buffer. If the return value is negative, it indicates an error code. Possible error codes include:

COMP_ERR_NOMEM
  There was not enough memory to initialize the compressor.

COMP_ERR_OVERFLOW
  There was not enough room in the result buffer to hold all of the compressed data.

### Implementation

Convenience call implemented in compression.lib V24.

### Associated Files

compression.h

### See Also

``SimpleDecompress`()`