diff --git a/build/VS2008/fullbench/fullbench.vcproj b/build/VS2008/fullbench/fullbench.vcproj
index 5752643f9..5e349dce9 100644
--- a/build/VS2008/fullbench/fullbench.vcproj
+++ b/build/VS2008/fullbench/fullbench.vcproj
@@ -463,7 +463,7 @@
>
-
+
diff --git a/build/VS2010/fuzzer/fuzzer.vcxproj b/build/VS2010/fuzzer/fuzzer.vcxproj
index 842757281..91974ec7f 100644
--- a/build/VS2010/fuzzer/fuzzer.vcxproj
+++ b/build/VS2010/fuzzer/fuzzer.vcxproj
@@ -196,7 +196,7 @@
-
+
@@ -211,7 +211,7 @@
-
+
diff --git a/build/VS2010/libzstd-dll/libzstd-dll.vcxproj b/build/VS2010/libzstd-dll/libzstd-dll.vcxproj
index 79ae9d327..a0aa897ce 100644
--- a/build/VS2010/libzstd-dll/libzstd-dll.vcxproj
+++ b/build/VS2010/libzstd-dll/libzstd-dll.vcxproj
@@ -61,7 +61,7 @@
-
+
diff --git a/build/VS2010/libzstd/libzstd.vcxproj b/build/VS2010/libzstd/libzstd.vcxproj
index c4df5ddaa..17c08d703 100644
--- a/build/VS2010/libzstd/libzstd.vcxproj
+++ b/build/VS2010/libzstd/libzstd.vcxproj
@@ -61,7 +61,7 @@
-
+
diff --git a/build/VS2010/zstd/zstd.vcxproj b/build/VS2010/zstd/zstd.vcxproj
index e389f9693..46e22f42e 100644
--- a/build/VS2010/zstd/zstd.vcxproj
+++ b/build/VS2010/zstd/zstd.vcxproj
@@ -70,14 +70,14 @@
-
+
-
+
diff --git a/build/cmake/lib/CMakeLists.txt b/build/cmake/lib/CMakeLists.txt
index 179c97624..d58c652a1 100644
--- a/build/cmake/lib/CMakeLists.txt
+++ b/build/cmake/lib/CMakeLists.txt
@@ -162,8 +162,8 @@ endif ()
# install target
install(FILES
"${LIBRARY_DIR}/zstd.h"
- "${LIBRARY_DIR}/dictBuilder/zdict.h"
- "${LIBRARY_DIR}/common/zstd_errors.h"
+ "${LIBRARY_DIR}/zdict.h"
+ "${LIBRARY_DIR}/zstd_errors.h"
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
install(TARGETS ${library_targets}
diff --git a/build/meson/lib/meson.build b/build/meson/lib/meson.build
index 358022980..2cbd39cf2 100644
--- a/build/meson/lib/meson.build
+++ b/build/meson/lib/meson.build
@@ -124,5 +124,5 @@ pkgconfig.generate(libzstd,
url: 'http://www.zstd.net/')
install_headers(join_paths(zstd_rootdir, 'lib/zstd.h'),
- join_paths(zstd_rootdir, 'lib/dictBuilder/zdict.h'),
- join_paths(zstd_rootdir, 'lib/common/zstd_errors.h'))
+ join_paths(zstd_rootdir, 'lib/zdict.h'),
+ join_paths(zstd_rootdir, 'lib/zstd_errors.h'))
diff --git a/contrib/VS2005/fullbench/fullbench.vcproj b/contrib/VS2005/fullbench/fullbench.vcproj
index c67490c6f..98f859376 100644
--- a/contrib/VS2005/fullbench/fullbench.vcproj
+++ b/contrib/VS2005/fullbench/fullbench.vcproj
@@ -390,7 +390,7 @@
>
=' \
--rewrite-include '=' \
--rewrite-include '"\.\./zstd.h"=' \
- --rewrite-include '"(\.\./common/)?zstd_errors.h"=' \
+ --rewrite-include '"(\.\./)?zstd_errors.h"=' \
--sed 's,/\*\*\*,/* *,g' \
--sed 's,/\*\*,/*,g' \
-DZSTD_NO_INTRINSICS \
@@ -54,7 +54,7 @@ libzstd:
-DZSTD_TRACE=0 \
-DZSTD_NO_TRACE
mv linux/lib/zstd/zstd.h linux/include/linux/zstd_lib.h
- mv linux/lib/zstd/common/zstd_errors.h linux/include/linux/
+ mv linux/lib/zstd/zstd_errors.h linux/include/linux/
cp linux_zstd.h linux/include/linux/zstd.h
cp zstd_compress_module.c linux/lib/zstd
cp zstd_decompress_module.c linux/lib/zstd
@@ -80,7 +80,7 @@ import-upstream:
cp -r ../../lib/common $(LINUX)/lib/zstd
cp -r ../../lib/compress $(LINUX)/lib/zstd
cp -r ../../lib/decompress $(LINUX)/lib/zstd
- mv $(LINUX)/lib/zstd/common/zstd_errors.h $(LINUX)/include/linux
+ mv $(LINUX)/lib/zstd/zstd_errors.h $(LINUX)/include/linux
rm $(LINUX)/lib/zstd/common/threading.*
rm $(LINUX)/lib/zstd/common/pool.*
rm $(LINUX)/lib/zstd/common/xxhash.*
diff --git a/lib/BUCK b/lib/BUCK
index 637c20d66..60c6bbb54 100644
--- a/lib/BUCK
+++ b/lib/BUCK
@@ -65,9 +65,7 @@ cxx_library(
name='zdict',
header_namespace='',
visibility=['PUBLIC'],
- exported_headers=subdir_glob([
- ('dictBuilder', 'zdict.h'),
- ]),
+ exported_headers=['zdict.h'],
headers=subdir_glob([
('dictBuilder', 'divsufsort.h'),
('dictBuilder', 'cover.h'),
@@ -131,10 +129,10 @@ cxx_library(
name='errors',
header_namespace='',
visibility=['PUBLIC'],
- exported_headers=subdir_glob([
- ('common', 'error_private.h'),
- ('common', 'zstd_errors.h'),
- ]),
+ exported_headers=[
+ 'zstd_errors.h',
+ 'common/error_private.h',
+ ]
srcs=['common/error_private.c'],
)
diff --git a/lib/Makefile b/lib/Makefile
index 6a26e6c79..4371710a1 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -435,8 +435,8 @@ install-includes:
[ -e $(DESTDIR)$(INCLUDEDIR) ] || $(INSTALL) -d -m 755 $(DESTDIR)$(INCLUDEDIR)/
@echo Installing includes
$(INSTALL_DATA) zstd.h $(DESTDIR)$(INCLUDEDIR)
- $(INSTALL_DATA) common/zstd_errors.h $(DESTDIR)$(INCLUDEDIR)
- $(INSTALL_DATA) dictBuilder/zdict.h $(DESTDIR)$(INCLUDEDIR)
+ $(INSTALL_DATA) zstd_errors.h $(DESTDIR)$(INCLUDEDIR)
+ $(INSTALL_DATA) zdict.h $(DESTDIR)$(INCLUDEDIR)
.PHONY: uninstall
uninstall:
diff --git a/lib/README.md b/lib/README.md
index db9170a75..cbf3f01b1 100644
--- a/lib/README.md
+++ b/lib/README.md
@@ -42,8 +42,8 @@ Zstandard's stable API is exposed within [lib/zstd.h](zstd.h).
Optional advanced features are exposed via :
-- `lib/common/zstd_errors.h` : translates `size_t` function results
- into a `ZSTD_ErrorCode`, for accurate error handling.
+- `lib/zstd_errors.h` : translates `size_t` function results
+ into a `ZSTD_ErrorCode`, for accurate error handling.
- `ZSTD_STATIC_LINKING_ONLY` : if this macro is defined _before_ including `zstd.h`,
it unlocks access to the experimental API,
diff --git a/lib/common/error_private.h b/lib/common/error_private.h
index ae964cf4d..6d8b9f776 100644
--- a/lib/common/error_private.h
+++ b/lib/common/error_private.h
@@ -21,8 +21,8 @@ extern "C" {
/* ****************************************
* Dependencies
******************************************/
-#include "zstd_deps.h" /* size_t */
-#include "zstd_errors.h" /* enum list */
+#include "../zstd_errors.h" /* enum list */
+#include "zstd_deps.h" /* size_t */
/* ****************************************
diff --git a/lib/dictBuilder/cover.c b/lib/dictBuilder/cover.c
index ac297c554..8364444d1 100644
--- a/lib/dictBuilder/cover.c
+++ b/lib/dictBuilder/cover.c
@@ -26,15 +26,16 @@
#include /* memset */
#include /* clock */
+#ifndef ZDICT_STATIC_LINKING_ONLY
+# define ZDICT_STATIC_LINKING_ONLY
+#endif
+
#include "../common/mem.h" /* read */
#include "../common/pool.h"
#include "../common/threading.h"
-#include "cover.h"
#include "../common/zstd_internal.h" /* includes zstd.h */
-#ifndef ZDICT_STATIC_LINKING_ONLY
-#define ZDICT_STATIC_LINKING_ONLY
-#endif
-#include "zdict.h"
+#include "../zdict.h"
+#include "cover.h"
/*-*************************************
* Constants
diff --git a/lib/dictBuilder/cover.h b/lib/dictBuilder/cover.h
index 494110321..1aacdddd6 100644
--- a/lib/dictBuilder/cover.h
+++ b/lib/dictBuilder/cover.h
@@ -8,6 +8,10 @@
* You may select, at your option, one of the above-listed licenses.
*/
+#ifndef ZDICT_STATIC_LINKING_ONLY
+# define ZDICT_STATIC_LINKING_ONLY
+#endif
+
#include /* fprintf */
#include /* malloc, free, qsort */
#include /* memset */
@@ -16,10 +20,7 @@
#include "../common/pool.h"
#include "../common/threading.h"
#include "../common/zstd_internal.h" /* includes zstd.h */
-#ifndef ZDICT_STATIC_LINKING_ONLY
-#define ZDICT_STATIC_LINKING_ONLY
-#endif
-#include "zdict.h"
+#include "../zdict.h"
/**
* COVER_best_t is used for two purposes:
diff --git a/lib/dictBuilder/fastcover.c b/lib/dictBuilder/fastcover.c
index 4a1d5f8f8..ed789f92f 100644
--- a/lib/dictBuilder/fastcover.c
+++ b/lib/dictBuilder/fastcover.c
@@ -16,16 +16,17 @@
#include /* memset */
#include /* clock */
+#ifndef ZDICT_STATIC_LINKING_ONLY
+# define ZDICT_STATIC_LINKING_ONLY
+#endif
+
#include "../common/mem.h" /* read */
#include "../common/pool.h"
#include "../common/threading.h"
-#include "cover.h"
#include "../common/zstd_internal.h" /* includes zstd.h */
#include "../compress/zstd_compress_internal.h" /* ZSTD_hash*() */
-#ifndef ZDICT_STATIC_LINKING_ONLY
-#define ZDICT_STATIC_LINKING_ONLY
-#endif
-#include "zdict.h"
+#include "../zdict.h"
+#include "cover.h"
/*-*************************************
diff --git a/lib/dictBuilder/zdict.c b/lib/dictBuilder/zdict.c
index a5e5e51f4..459cbe4d1 100644
--- a/lib/dictBuilder/zdict.c
+++ b/lib/dictBuilder/zdict.c
@@ -41,18 +41,19 @@
#include /* fprintf, fopen, ftello64 */
#include /* clock */
-#include "../common/mem.h" /* read */
-#include "../common/fse.h" /* FSE_normalizeCount, FSE_writeNCount */
-#define HUF_STATIC_LINKING_ONLY
-#include "../common/huf.h" /* HUF_buildCTable, HUF_writeCTable */
-#include "../common/zstd_internal.h" /* includes zstd.h */
-#include "../common/xxhash.h" /* XXH64 */
-#include "divsufsort.h"
#ifndef ZDICT_STATIC_LINKING_ONLY
# define ZDICT_STATIC_LINKING_ONLY
#endif
-#include "zdict.h"
+#define HUF_STATIC_LINKING_ONLY
+
+#include "../common/mem.h" /* read */
+#include "../common/fse.h" /* FSE_normalizeCount, FSE_writeNCount */
+#include "../common/huf.h" /* HUF_buildCTable, HUF_writeCTable */
+#include "../common/zstd_internal.h" /* includes zstd.h */
+#include "../common/xxhash.h" /* XXH64 */
#include "../compress/zstd_compress_internal.h" /* ZSTD_loadCEntropy() */
+#include "../zdict.h"
+#include "divsufsort.h"
/*-*************************************
diff --git a/lib/dictBuilder/zdict.h b/lib/zdict.h
similarity index 100%
rename from lib/dictBuilder/zdict.h
rename to lib/zdict.h
diff --git a/lib/zstd.h b/lib/zstd.h
index ac5722101..8f88bd122 100644
--- a/lib/zstd.h
+++ b/lib/zstd.h
@@ -815,7 +815,7 @@ ZSTDLIB_API size_t ZSTD_DStreamOutSize(void); /*!< recommended size for output
/*! ZSTD_compress_usingDict() :
* Compression at an explicit compression level using a Dictionary.
* A dictionary can be any arbitrary data segment (also called a prefix),
- * or a buffer with specified information (see dictBuilder/zdict.h).
+ * or a buffer with specified information (see zdict.h).
* Note : This function loads the dictionary, resulting in significant startup delay.
* It's intended for a dictionary used only once.
* Note 2 : When `dict == NULL || dictSize < 8` no dictionary is used. */
@@ -1845,7 +1845,7 @@ ZSTDLIB_API size_t ZSTD_CCtx_refPrefix_advanced(ZSTD_CCtx* cctx, const void* pre
/* ZSTD_c_splitBlocks
* Default is 0 == disabled. Set to 1 to enable block splitting.
- *
+ *
* Will attempt to split blocks in order to improve compression ratio at the cost of speed.
*/
#define ZSTD_c_splitBlocks ZSTD_c_experimentalParam13
@@ -1853,11 +1853,11 @@ ZSTDLIB_API size_t ZSTD_CCtx_refPrefix_advanced(ZSTD_CCtx* cctx, const void* pre
/* ZSTD_c_useRowMatchFinder
* Default is ZSTD_urm_auto.
* Controlled with ZSTD_useRowMatchFinderMode_e enum.
- *
+ *
* By default, in ZSTD_urm_auto, when finalizing the compression parameters, the library
* will decide at runtime whether to use the row-based matchfinder based on support for SIMD
* instructions as well as the windowLog.
- *
+ *
* Set to ZSTD_urm_disableRowMatchFinder to never use row-based matchfinder.
* Set to ZSTD_urm_enableRowMatchFinder to force usage of row-based matchfinder.
*/
diff --git a/lib/common/zstd_errors.h b/lib/zstd_errors.h
similarity index 100%
rename from lib/common/zstd_errors.h
rename to lib/zstd_errors.h
diff --git a/programs/benchzstd.c b/programs/benchzstd.c
index c40f0a24c..ccf705d29 100644
--- a/programs/benchzstd.c
+++ b/programs/benchzstd.c
@@ -36,7 +36,7 @@
#include "datagen.h" /* RDG_genBuffer */
#include "../lib/common/xxhash.h"
#include "benchzstd.h"
-#include "../lib/common/zstd_errors.h"
+#include "../lib/zstd_errors.h"
/* *************************************
diff --git a/programs/dibio.h b/programs/dibio.h
index dfc8f27a1..f65ed9b8e 100644
--- a/programs/dibio.h
+++ b/programs/dibio.h
@@ -19,7 +19,7 @@
* Dependencies
***************************************/
#define ZDICT_STATIC_LINKING_ONLY
-#include "../lib/dictBuilder/zdict.h" /* ZDICT_params_t */
+#include "../lib/zdict.h" /* ZDICT_params_t */
/*-*************************************
diff --git a/programs/fileio.c b/programs/fileio.c
index fab7918d7..604084cc7 100644
--- a/programs/fileio.c
+++ b/programs/fileio.c
@@ -44,7 +44,7 @@
#define ZSTD_STATIC_LINKING_ONLY /* ZSTD_magicNumber, ZSTD_frameHeaderSize_max */
#include "../lib/zstd.h"
-#include "../lib/common/zstd_errors.h" /* ZSTD_error_frameParameter_windowTooLarge */
+#include "../lib/zstd_errors.h" /* ZSTD_error_frameParameter_windowTooLarge */
#if defined(ZSTD_GZCOMPRESS) || defined(ZSTD_GZDECOMPRESS)
# include