Removed ZBUFF internal util function from public area

This commit is contained in:
Yann Collet 2016-06-04 19:16:49 +02:00
parent 5347aee8f7
commit ac110a1f21
3 changed files with 19 additions and 10 deletions

View File

@ -163,19 +163,10 @@ ZSTDLIB_API size_t ZBUFF_recommendedDOutSize(void);
#ifdef ZBUFF_STATIC_LINKING_ONLY #ifdef ZBUFF_STATIC_LINKING_ONLY
/* ************************************* /* *************************************
* Includes * Dependency
***************************************/ ***************************************/
#include "zstd_static.h" /* ZSTD_parameters */ #include "zstd_static.h" /* ZSTD_parameters */
/* internal util function */
#define ZBUFF_MIN(a,b) ((a)<(b) ? (a) : (b))
MEM_STATIC size_t ZBUFF_limitCopy(void* dst, size_t dstCapacity, const void* src, size_t srcSize)
{
size_t length = ZBUFF_MIN(dstCapacity, srcSize);
memcpy(dst, src, length);
return length;
}
/*-************************************* /*-*************************************
* Advanced functions * Advanced functions

View File

@ -183,6 +183,15 @@ size_t ZBUFF_compressInit(ZBUFF_CCtx* zbc, int compressionLevel)
} }
/* internal util function */
MEM_STATIC size_t ZBUFF_limitCopy(void* dst, size_t dstCapacity, const void* src, size_t srcSize)
{
size_t const length = MIN(dstCapacity, srcSize);
memcpy(dst, src, length);
return length;
}
/* *** Compression *** */ /* *** Compression *** */
static size_t ZBUFF_compressContinue_generic(ZBUFF_CCtx* zbc, static size_t ZBUFF_compressContinue_generic(ZBUFF_CCtx* zbc,

View File

@ -138,6 +138,15 @@ size_t ZBUFF_decompressInit(ZBUFF_DCtx* zbd)
} }
/* internal util function */
MEM_STATIC size_t ZBUFF_limitCopy(void* dst, size_t dstCapacity, const void* src, size_t srcSize)
{
size_t const length = MIN(dstCapacity, srcSize);
memcpy(dst, src, length);
return length;
}
/* *** Decompression *** */ /* *** Decompression *** */
size_t ZBUFF_decompressContinue(ZBUFF_DCtx* zbd, size_t ZBUFF_decompressContinue(ZBUFF_DCtx* zbd,