Parolin 0.7.9 6796
Console (soon DLLs) to do a tar like job
Loading...
Searching...
No Matches
huf.h File Reference
#include "zstd_deps.h"

Go to the source code of this file.

Macros

#define HUF_H_298734234
 
#define HUF_PUBLIC_API
 
#define HUF_BLOCKSIZE_MAX   (128 * 1024)
 
#define HUF_WORKSPACE_SIZE   ((8 << 10) + 512 /* sorting scratch space */)
 
#define HUF_WORKSPACE_SIZE_U64   (HUF_WORKSPACE_SIZE / sizeof(U64))
 

Functions

HUF_PUBLIC_API size_t HUF_compress (void *dst, size_t dstCapacity, const void *src, size_t srcSize)
 
HUF_PUBLIC_API size_t HUF_decompress (void *dst, size_t originalSize, const void *cSrc, size_t cSrcSize)
 
HUF_PUBLIC_API size_t HUF_compressBound (size_t size)
 
HUF_PUBLIC_API unsigned HUF_isError (size_t code)
 
HUF_PUBLIC_API const char * HUF_getErrorName (size_t code)
 
HUF_PUBLIC_API size_t HUF_compress2 (void *dst, size_t dstCapacity, const void *src, size_t srcSize, unsigned maxSymbolValue, unsigned tableLog)
 
HUF_PUBLIC_API size_t HUF_compress4X_wksp (void *dst, size_t dstCapacity, const void *src, size_t srcSize, unsigned maxSymbolValue, unsigned tableLog, void *workSpace, size_t wkspSize)
 

Macro Definition Documentation

◆ HUF_BLOCKSIZE_MAX

#define HUF_BLOCKSIZE_MAX   (128 * 1024)

maximum input size for a single block compressed with HUF_compress

◆ HUF_H_298734234

#define HUF_H_298734234

◆ HUF_PUBLIC_API

#define HUF_PUBLIC_API

◆ HUF_WORKSPACE_SIZE

#define HUF_WORKSPACE_SIZE   ((8 << 10) + 512 /* sorting scratch space */)

HUF_compress4X_wksp() : Same as HUF_compress2(), but uses externally allocated workSpace. workspace must be at least as large as HUF_WORKSPACE_SIZE

◆ HUF_WORKSPACE_SIZE_U64

#define HUF_WORKSPACE_SIZE_U64   (HUF_WORKSPACE_SIZE / sizeof(U64))

Function Documentation

◆ HUF_compress()

HUF_PUBLIC_API size_t HUF_compress ( void * dst,
size_t dstCapacity,
const void * src,
size_t srcSize )

HUF_compress() : Compress content from buffer 'src', of size 'srcSize', into buffer 'dst'. 'dst' buffer must be already allocated. Compression runs faster if dstCapacity >= HUF_compressBound(srcSize). srcSize must be <= HUF_BLOCKSIZE_MAX == 128 KB.

Returns
: size of compressed data (<= dstCapacity). Special values : if return == 0, srcData is not compressible => Nothing is stored within dst !!! if HUF_isError(return), compression failed (more details using HUF_getErrorName())

◆ HUF_compress2()

HUF_PUBLIC_API size_t HUF_compress2 ( void * dst,
size_t dstCapacity,
const void * src,
size_t srcSize,
unsigned maxSymbolValue,
unsigned tableLog )

HUF_compress2() : Same as HUF_compress(), but offers control over maxSymbolValue and tableLog. maxSymbolValue must be <= HUF_SYMBOLVALUE_MAX . tableLog must be <= HUF_TABLELOG_MAX .

◆ HUF_compress4X_wksp()

HUF_PUBLIC_API size_t HUF_compress4X_wksp ( void * dst,
size_t dstCapacity,
const void * src,
size_t srcSize,
unsigned maxSymbolValue,
unsigned tableLog,
void * workSpace,
size_t wkspSize )

◆ HUF_compressBound()

HUF_PUBLIC_API size_t HUF_compressBound ( size_t size)

maximum compressed size (worst case)

◆ HUF_decompress()

static size_t HUF_decompress ( void * dst,
size_t originalSize,
const void * cSrc,
size_t cSrcSize )

HUF_decompress() : Decompress HUF data from buffer 'cSrc', of size 'cSrcSize', into already allocated buffer 'dst', of minimum size 'dstSize'. originalSize : must be the exact size of original (uncompressed) data. Note : in contrast with FSE, HUF_decompress can regenerate RLE (cSrcSize==1) and uncompressed (cSrcSize==dstSize) data, because it knows size to regenerate (originalSize).

Returns
: size of regenerated data (== originalSize), or an error code, which can be tested using HUF_isError()

◆ HUF_getErrorName()

HUF_PUBLIC_API const char * HUF_getErrorName ( size_t code)

provides error code string (useful for debugging)

◆ HUF_isError()

HUF_PUBLIC_API unsigned HUF_isError ( size_t code)

tells if a return value is an error code