Nugget
Loading...
Searching...
No Matches
Functions
lz4.h File Reference
#include <stddef.h>
#include <stdint.h>
Include dependency graph for lz4.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void lz4_decompress_block (const void *source, const void *sourceEnd, void *dest)
 Decompress a block of lz4 compressed data.
 

Function Documentation

◆ lz4_decompress_block()

void lz4_decompress_block ( const void source,
const void sourceEnd,
void dest 
)

Decompress a block of lz4 compressed data.

This function decompresses a block of lz4 compressed data. The source pointer should point to the start of the compressed data, and sourceEnd should point to the end of the compressed data. The dest pointer should point to a buffer that is large enough to hold the decompressed data, as the function does not perform any bounds checking. The function can decompress data in place, and the way the compression works allows for all of the compressed data to be at the end of the same buffer used to store the decompressed data. In this case, the whole of the compressed data will be completely overwritten by the decompressed data.

Note
The function does not check for the validity of the compressed data. If the data is corrupted, this will likely result in a crash or an infinite loop. The caller is responsible for ensuring that the data is valid and that the destination buffer is large enough to hold the decompressed data.
Parameters
sourceThe pointer to the start of the compressed data.
sourceEndThe pointer to the end of the compressed data.
destThe pointer to the destination buffer where the decompressed data will be stored.