]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
Revert "Move decompress symbols into zstd_internal.h, remove dependency"
authorSen Huang <senhuang96@fb.com>
Thu, 7 Nov 2019 14:29:15 +0000 (09:29 -0500)
committerSen Huang <senhuang96@fb.com>
Fri, 8 Nov 2019 18:57:26 +0000 (13:57 -0500)
This reverts commit a152b4c67a5266f611db4a2eac4a79003852a795.

lib/common/zstd_internal.h
lib/decompress/zstd_decompress_internal.h
lib/dictBuilder/zdict.c

index db3ce1fc10f560bb02ffc7188b3468eadab0705f..dcdcbdb81cd787d740759a2c61819f019828f667 100644 (file)
@@ -251,34 +251,6 @@ void ZSTD_wildcopy(void* dst, const void* src, ptrdiff_t length, ZSTD_overlap_e
 /*-*******************************************
 *  Private declarations
 *********************************************/
-/**
- * ZSTD_seqSymbol, ZSTD_entropyDTables_t, ZSTD_loadDEntropy(), and SEQSYMBOL_TABLE_SIZE()
- * are used by ZDICT_getDictHeaderSize() and various functions in zstd_decompress.h
- */
-
- typedef struct {
-     U16  nextState;
-     BYTE nbAdditionalBits;
-     BYTE nbBits;
-     U32  baseValue;
- } ZSTD_seqSymbol;
-
-#define SEQSYMBOL_TABLE_SIZE(log)   (1 + (1 << (log)))
-
-typedef struct {
-    ZSTD_seqSymbol LLTable[SEQSYMBOL_TABLE_SIZE(LLFSELog)];    /* Note : Space reserved for FSE Tables */
-    ZSTD_seqSymbol OFTable[SEQSYMBOL_TABLE_SIZE(OffFSELog)];   /* is also used as temporary workspace while building hufTable during DDict creation */
-    ZSTD_seqSymbol MLTable[SEQSYMBOL_TABLE_SIZE(MLFSELog)];    /* and therefore must be at least HUF_DECOMPRESS_WORKSPACE_SIZE large */
-    HUF_DTable hufTable[HUF_DTABLE_SIZE(HufLog)];  /* can accommodate HUF_decompress4X */
-    U32 rep[ZSTD_REP_NUM];
-} ZSTD_entropyDTables_t;
-
-/*! ZSTD_loadDEntropy() :
- *  dict : must point at beginning of a valid zstd dictionary.
- * @return : size of entropy tables read (includes 8-byte magic number and dictionary ID) */
-size_t ZSTD_loadDEntropy(ZSTD_entropyDTables_t* entropy,
-                   const void* const dict, size_t const dictSize);
-
 typedef struct seqDef_s {
     U32 offset;
     U16 litLength;
index 1a71e23643c4cdf5bd87525201ce03f8f1a329a1..ccbdfa090faa2fa133f7281e9817b291ab70c55f 100644 (file)
@@ -64,6 +64,23 @@ static const U32 ML_base[MaxML+1] = {
      U32 tableLog;
  } ZSTD_seqSymbol_header;
 
+ typedef struct {
+     U16  nextState;
+     BYTE nbAdditionalBits;
+     BYTE nbBits;
+     U32  baseValue;
+ } ZSTD_seqSymbol;
+
+ #define SEQSYMBOL_TABLE_SIZE(log)   (1 + (1 << (log)))
+
+typedef struct {
+    ZSTD_seqSymbol LLTable[SEQSYMBOL_TABLE_SIZE(LLFSELog)];    /* Note : Space reserved for FSE Tables */
+    ZSTD_seqSymbol OFTable[SEQSYMBOL_TABLE_SIZE(OffFSELog)];   /* is also used as temporary workspace while building hufTable during DDict creation */
+    ZSTD_seqSymbol MLTable[SEQSYMBOL_TABLE_SIZE(MLFSELog)];    /* and therefore must be at least HUF_DECOMPRESS_WORKSPACE_SIZE large */
+    HUF_DTable hufTable[HUF_DTABLE_SIZE(HufLog)];  /* can accommodate HUF_decompress4X */
+    U32 rep[ZSTD_REP_NUM];
+} ZSTD_entropyDTables_t;
+
 typedef enum { ZSTDds_getFrameHeaderSize, ZSTDds_decodeFrameHeader,
                ZSTDds_decodeBlockHeader, ZSTDds_decompressBlock,
                ZSTDds_decompressLastBlock, ZSTDds_checkChecksum,
@@ -141,6 +158,12 @@ struct ZSTD_DCtx_s
  *  Shared internal functions
  *********************************************************/
 
+/*! ZSTD_loadDEntropy() :
+ *  dict : must point at beginning of a valid zstd dictionary.
+ * @return : size of entropy tables read */
+size_t ZSTD_loadDEntropy(ZSTD_entropyDTables_t* entropy,
+                   const void* const dict, size_t const dictSize);
+
 /*! ZSTD_checkContinuity() :
  *  check if next `dst` follows previous position, where decompression ended.
  *  If yes, do nothing (continue on current segment).
index 7ea0a2d48329e6e2986e4621b55dafd6f4aaee46..6db57b1448cb47d7e4535519082a2cc7107fe0dd 100644 (file)
@@ -48,6 +48,7 @@
 #  define ZDICT_STATIC_LINKING_ONLY
 #endif
 #include "zdict.h"
+#include "decompress/zstd_decompress_internal.h" /* ZSTD_entropyDTables_t */
 
 
 /*-*************************************
@@ -108,7 +109,6 @@ size_t ZDICT_getDictHeaderSize(const void* dictBuffer, size_t dictSize)
         if (!dummyEntropyTables) {
             return 0;
         }
-
         dummyEntropyTables->hufTable[0] = (HUF_DTable)((HufLog)*0x1000001);
         headerSize = ZSTD_loadDEntropy(dummyEntropyTables, dictBuffer, dictSize);
         free(dummyEntropyTables);