From ee441d5d2b0334df0e164f9f8c2b095ef9c275f4 Mon Sep 17 00:00:00 2001 From: Yann Collet Date: Tue, 7 Nov 2017 16:15:23 -0800 Subject: [PATCH] renamed zstd_compress.h into zstd_compress_internal.h to emphasize the fact that all definitions it contains must remain private, accross lib/compress modules. --- lib/compress/zstd_compress.c | 2 +- lib/compress/{zstd_compress.h => zstd_compress_internal.h} | 2 +- lib/compress/zstd_double_fast.c | 1 + lib/compress/zstd_double_fast.h | 5 +++-- lib/compress/zstd_fast.c | 1 + lib/compress/zstd_fast.h | 5 +++-- lib/compress/zstd_lazy.c | 1 + lib/compress/zstd_lazy.h | 5 +++-- lib/compress/zstd_ldm.h | 5 +++-- lib/compress/zstd_opt.c | 3 ++- lib/compress/zstd_opt.h | 4 ++-- lib/compress/zstdmt_compress.c | 2 +- 12 files changed, 22 insertions(+), 14 deletions(-) rename lib/compress/{zstd_compress.h => zstd_compress_internal.h} (99%) diff --git a/lib/compress/zstd_compress.c b/lib/compress/zstd_compress.c index 808418a6..a1162e3a 100644 --- a/lib/compress/zstd_compress.c +++ b/lib/compress/zstd_compress.c @@ -26,7 +26,7 @@ #include "fse.h" #define HUF_STATIC_LINKING_ONLY #include "huf.h" -#include "zstd_compress.h" +#include "zstd_compress_internal.h" #include "zstd_fast.h" #include "zstd_double_fast.h" #include "zstd_lazy.h" diff --git a/lib/compress/zstd_compress.h b/lib/compress/zstd_compress_internal.h similarity index 99% rename from lib/compress/zstd_compress.h rename to lib/compress/zstd_compress_internal.h index bb508795..e01d532c 100644 --- a/lib/compress/zstd_compress.h +++ b/lib/compress/zstd_compress_internal.h @@ -9,7 +9,7 @@ */ /* This header contains definitions - * that shall only be used by modules from within lib/compress. + * that shall **only** be used by modules within lib/compress. */ #ifndef ZSTD_COMPRESS_H diff --git a/lib/compress/zstd_double_fast.c b/lib/compress/zstd_double_fast.c index 876a3604..fee5127c 100644 --- a/lib/compress/zstd_double_fast.c +++ b/lib/compress/zstd_double_fast.c @@ -8,6 +8,7 @@ * You may select, at your option, one of the above-listed licenses. */ +#include "zstd_compress_internal.h" #include "zstd_double_fast.h" diff --git a/lib/compress/zstd_double_fast.h b/lib/compress/zstd_double_fast.h index 3dba6c71..75e04158 100644 --- a/lib/compress/zstd_double_fast.h +++ b/lib/compress/zstd_double_fast.h @@ -11,12 +11,13 @@ #ifndef ZSTD_DOUBLE_FAST_H #define ZSTD_DOUBLE_FAST_H -#include "zstd_compress.h" - #if defined (__cplusplus) extern "C" { #endif +#include "mem.h" /* U32 */ +#include "zstd.h" /* ZSTD_CCtx, size_t */ + void ZSTD_fillDoubleHashTable(ZSTD_CCtx* cctx, const void* end, const U32 mls); size_t ZSTD_compressBlock_doubleFast(ZSTD_CCtx* ctx, const void* src, size_t srcSize); size_t ZSTD_compressBlock_doubleFast_extDict(ZSTD_CCtx* ctx, const void* src, size_t srcSize); diff --git a/lib/compress/zstd_fast.c b/lib/compress/zstd_fast.c index 2e057017..7b56c3d6 100644 --- a/lib/compress/zstd_fast.c +++ b/lib/compress/zstd_fast.c @@ -8,6 +8,7 @@ * You may select, at your option, one of the above-listed licenses. */ +#include "zstd_compress_internal.h" #include "zstd_fast.h" diff --git a/lib/compress/zstd_fast.h b/lib/compress/zstd_fast.h index 4205141a..d8b77719 100644 --- a/lib/compress/zstd_fast.h +++ b/lib/compress/zstd_fast.h @@ -11,12 +11,13 @@ #ifndef ZSTD_FAST_H #define ZSTD_FAST_H -#include "zstd_compress.h" - #if defined (__cplusplus) extern "C" { #endif +#include "mem.h" /* U32 */ +#include "zstd.h" /* ZSTD_CCtx, size_t */ + void ZSTD_fillHashTable(ZSTD_CCtx* zc, const void* end, const U32 mls); size_t ZSTD_compressBlock_fast(ZSTD_CCtx* ctx, const void* src, size_t srcSize); diff --git a/lib/compress/zstd_lazy.c b/lib/compress/zstd_lazy.c index 2a7f6a0f..d80e06f7 100644 --- a/lib/compress/zstd_lazy.c +++ b/lib/compress/zstd_lazy.c @@ -8,6 +8,7 @@ * You may select, at your option, one of the above-listed licenses. */ +#include "zstd_compress_internal.h" #include "zstd_lazy.h" diff --git a/lib/compress/zstd_lazy.h b/lib/compress/zstd_lazy.h index a9c4daed..74e1fd69 100644 --- a/lib/compress/zstd_lazy.h +++ b/lib/compress/zstd_lazy.h @@ -11,12 +11,13 @@ #ifndef ZSTD_LAZY_H #define ZSTD_LAZY_H -#include "zstd_compress.h" - #if defined (__cplusplus) extern "C" { #endif +#include "mem.h" /* U32 */ +#include "zstd.h" /* ZSTD_CCtx, size_t */ + U32 ZSTD_insertAndFindFirstIndex (ZSTD_CCtx* zc, const BYTE* ip, U32 mls); void ZSTD_updateTree(ZSTD_CCtx* zc, const BYTE* const ip, const BYTE* const iend, const U32 nbCompares, const U32 mls); void ZSTD_updateTree_extDict(ZSTD_CCtx* zc, const BYTE* const ip, const BYTE* const iend, const U32 nbCompares, const U32 mls); diff --git a/lib/compress/zstd_ldm.h b/lib/compress/zstd_ldm.h index d6d3d42c..8f12c677 100644 --- a/lib/compress/zstd_ldm.h +++ b/lib/compress/zstd_ldm.h @@ -10,12 +10,13 @@ #ifndef ZSTD_LDM_H #define ZSTD_LDM_H -#include "zstd_compress.h" - #if defined (__cplusplus) extern "C" { #endif +#include "zstd_compress_internal.h" /* ldmParams_t, U32 */ +#include "zstd.h" /* ZSTD_CCtx, size_t */ + /*-************************************* * Long distance matching ***************************************/ diff --git a/lib/compress/zstd_opt.c b/lib/compress/zstd_opt.c index e349bb99..f416c15f 100644 --- a/lib/compress/zstd_opt.c +++ b/lib/compress/zstd_opt.c @@ -8,8 +8,9 @@ * You may select, at your option, one of the above-listed licenses. */ +#include "zstd_compress_internal.h" #include "zstd_opt.h" -#include "zstd_lazy.h" +#include "zstd_lazy.h" /* ZSTD_updateTree, ZSTD_updateTree_extDict */ #define ZSTD_LITFREQ_ADD 2 diff --git a/lib/compress/zstd_opt.h b/lib/compress/zstd_opt.h index 816a1fab..82e810c2 100644 --- a/lib/compress/zstd_opt.h +++ b/lib/compress/zstd_opt.h @@ -11,12 +11,12 @@ #ifndef ZSTD_OPT_H #define ZSTD_OPT_H -#include "zstd_compress.h" - #if defined (__cplusplus) extern "C" { #endif +#include "zstd.h" /* ZSTD_CCtx, size_t */ + size_t ZSTD_compressBlock_btopt(ZSTD_CCtx* ctx, const void* src, size_t srcSize); size_t ZSTD_compressBlock_btultra(ZSTD_CCtx* ctx, const void* src, size_t srcSize); diff --git a/lib/compress/zstdmt_compress.c b/lib/compress/zstdmt_compress.c index eb17f970..0b9173f3 100644 --- a/lib/compress/zstdmt_compress.c +++ b/lib/compress/zstdmt_compress.c @@ -24,7 +24,7 @@ #include /* memcpy, memset */ #include "pool.h" /* threadpool */ #include "threading.h" /* mutex */ -#include "zstd_compress.h" /* MIN, ERROR, ZSTD_*, ZSTD_highbit32 */ +#include "zstd_compress_internal.h" /* MIN, ERROR, ZSTD_*, ZSTD_highbit32 */ #include "zstdmt_compress.h"