Parolin 0.7.9 6796
Console (soon DLLs) to do a tar like job
Loading...
Searching...
No Matches
roundtrip.c File Reference
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "zstd.h"
#include "testcard-dxt1.inl"

Functions

size_t ZSTD_compressBound (size_t maxSrc)
 
int ZSTD_maxCLevel (void)
 
size_t ZSTD_compress (void *dst, size_t dstLen, const void *src, size_t srcLen, int level)
 
unsigned ZSTD_isError (size_t code)
 
size_t ZSTD_decompress (void *dst, size_t dstLen, const void *src, size_t srcLen)
 
int main ()
 

Function Documentation

◆ main()

int main ( void )

Simple single-file test to compress rawData, decompress the result, then compare the decompressed version with the original.

◆ ZSTD_compress()

size_t ZSTD_compress ( void * dst,
size_t dstCapacity,
const void * src,
size_t srcSize,
int compressionLevel )

ZSTD_compress() : Compresses src content as a single zstd compressed frame into already allocated dst. Hint : compression runs faster if dstCapacity >= ZSTD_compressBound(srcSize).

Returns
: compressed size written into dst (<= `dstCapacity), or an error code if it fails (which can be tested using ZSTD_isError()).

◆ ZSTD_compressBound()

size_t ZSTD_compressBound ( size_t srcSize)

maximum compressed size in worst case single-pass scenario

◆ ZSTD_decompress()

size_t ZSTD_decompress ( void * dst,
size_t dstLen,
const void * src,
size_t srcLen )

Zstandard decompression functions. dst must point to a space at least as large as the reconstructed output.

For the case where the decompression library hasn't been included we add a dummy function to fake the process and stop the buffers being optimised out.

◆ ZSTD_isError()

unsigned ZSTD_isError ( size_t code)

tells if a size_t function result is an error code

ZSTD_isError() : tells if a return value is an error code symbol is required for external callers

◆ ZSTD_maxCLevel()

int ZSTD_maxCLevel ( void )

maximum compression level available