Merge pull request #2103 from felixhandte/relative-includes
Migrate Includes to Relative Paths
This commit is contained in:
@@ -41,11 +41,15 @@ usage() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Tests that the grep implementation works as expected (older OSX grep fails)
|
# Tests that the grep implementation works as expected (older OSX grep fails)
|
||||||
test_grep() {
|
test_deps() {
|
||||||
if ! echo '#include "foo"' | grep -Eq '^\s*#\s*include\s*".+"'; then
|
if ! echo '#include "foo"' | grep -Eq '^\s*#\s*include\s*".+"'; then
|
||||||
echo "Aborting: the grep implementation fails to parse include lines"
|
echo "Aborting: the grep implementation fails to parse include lines"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
if ! echo '"foo.h"' | sed -E 's/"([^"]+)"/\1/' | grep -Eq '^foo\.h$'; then
|
||||||
|
echo "Aborting: sed is unavailable or non-functional"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Tests if list $1 has item $2 (returning zero on a match)
|
# Tests if list $1 has item $2 (returning zero on a match)
|
||||||
@@ -66,41 +70,75 @@ write_line() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Adds the contents of $1 with any of its includes inlined
|
log_line() {
|
||||||
add_file() {
|
echo $@ >&2
|
||||||
# Match the path
|
}
|
||||||
local file=
|
|
||||||
for root in $ROOTS; do
|
# Find this file!
|
||||||
if [ -f "$root/$1" ]; then
|
resolve_include() {
|
||||||
file="$root/$1"
|
local srcdir=$1
|
||||||
|
local inc=$2
|
||||||
|
for root in $srcdir $ROOTS; do
|
||||||
|
if [ -f "$root/$inc" ]; then
|
||||||
|
# Try to reduce the file path into a canonical form (so that multiple)
|
||||||
|
# includes of the same file are successfully deduplicated, even if they
|
||||||
|
# are expressed differently.
|
||||||
|
local relpath="$(realpath --relative-to . "$root/$inc" 2>/dev/null)"
|
||||||
|
if [ "$relpath" != "" ]; then # not all realpaths support --relative-to
|
||||||
|
echo "$relpath"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
local relpath="$(realpath "$root/$inc" 2>/dev/null)"
|
||||||
|
if [ "$relpath" != "" ]; then # not all distros have realpath...
|
||||||
|
echo "$relpath"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
# Worst case, fall back to just the root + relative include path. The
|
||||||
|
# problem with this is that it is possible to emit multiple different
|
||||||
|
# resolved paths to the same file, depending on exactly how its included.
|
||||||
|
# Since the main loop below keeps a list of the resolved paths it's
|
||||||
|
# already included, in order to avoid repeated includes, this failure to
|
||||||
|
# produce a canonical/reduced path can lead to multiple inclusions of the
|
||||||
|
# same file. But it seems like the resulting single file library still
|
||||||
|
# works (hurray include guards!), so I guess it's ok.
|
||||||
|
echo "$root/$inc"
|
||||||
|
return 0
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
|
# Adds the contents of $1 with any of its includes inlined
|
||||||
|
add_file() {
|
||||||
|
local file=$1
|
||||||
if [ -n "$file" ]; then
|
if [ -n "$file" ]; then
|
||||||
if [ -n "$DESTN" ]; then
|
log_line "Processing: $file"
|
||||||
# Log but only if not writing to stdout
|
# Get directory of the current so we can resolve relative includes
|
||||||
echo "Processing: $file"
|
local srcdir="$(dirname "$file")"
|
||||||
fi
|
|
||||||
# Read the file
|
# Read the file
|
||||||
local line=
|
local line=
|
||||||
while IFS= read -r line; do
|
while IFS= read -r line; do
|
||||||
if echo "$line" | grep -Eq '^\s*#\s*include\s*".+"'; then
|
if echo "$line" | grep -Eq '^\s*#\s*include\s*".+"'; then
|
||||||
# We have an include directive so strip the (first) file
|
# We have an include directive so strip the (first) file
|
||||||
local inc=$(echo "$line" | grep -Eo '".*"' | grep -Eo '\w*(\.?\w+)+' | head -1)
|
local inc=$(echo "$line" | grep -Eo '".*"' | sed -E 's/"([^"]+)"/\1/' | head -1)
|
||||||
|
local res_inc="$(resolve_include "$srcdir" "$inc")"
|
||||||
if list_has_item "$XINCS" "$inc"; then
|
if list_has_item "$XINCS" "$inc"; then
|
||||||
# The file was excluded so error if the source attempts to use it
|
# The file was excluded so error if the source attempts to use it
|
||||||
write_line "#error Using excluded file: $inc"
|
write_line "#error Using excluded file: $inc"
|
||||||
|
log_line "Excluding: $inc"
|
||||||
else
|
else
|
||||||
if ! list_has_item "$FOUND" "$inc"; then
|
if ! list_has_item "$FOUND" "$res_inc"; then
|
||||||
# The file was not previously encountered
|
# The file was not previously encountered
|
||||||
FOUND="$FOUND $inc"
|
FOUND="$FOUND $res_inc"
|
||||||
if list_has_item "$KINCS" "$inc"; then
|
if list_has_item "$KINCS" "$inc"; then
|
||||||
# But the include was flagged to keep as included
|
# But the include was flagged to keep as included
|
||||||
write_line "/**** *NOT* inlining $inc ****/"
|
write_line "/**** *NOT* inlining $inc ****/"
|
||||||
write_line "$line"
|
write_line "$line"
|
||||||
|
log_line "Not Inlining: $inc"
|
||||||
else
|
else
|
||||||
# The file was neither excluded nor seen before so inline it
|
# The file was neither excluded nor seen before so inline it
|
||||||
write_line "/**** start inlining $inc ****/"
|
write_line "/**** start inlining $inc ****/"
|
||||||
add_file "$inc"
|
add_file "$res_inc"
|
||||||
write_line "/**** ended inlining $inc ****/"
|
write_line "/**** ended inlining $inc ****/"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
@@ -122,6 +160,7 @@ add_file() {
|
|||||||
done < "$file"
|
done < "$file"
|
||||||
else
|
else
|
||||||
write_line "#error Unable to find \"$1\""
|
write_line "#error Unable to find \"$1\""
|
||||||
|
log_line "Error: Unable to find: \"$1\""
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -154,8 +193,8 @@ if [ -n "$1" ]; then
|
|||||||
if [ -n "$DESTN" ]; then
|
if [ -n "$DESTN" ]; then
|
||||||
printf "" > "$DESTN"
|
printf "" > "$DESTN"
|
||||||
fi
|
fi
|
||||||
test_grep
|
test_deps
|
||||||
add_file $1
|
add_file "$1"
|
||||||
else
|
else
|
||||||
echo "Input file not found: \"$1\""
|
echo "Input file not found: \"$1\""
|
||||||
exit 1
|
exit 1
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ ZSTD_SRC_ROOT="../../lib"
|
|||||||
|
|
||||||
# Amalgamate the sources
|
# Amalgamate the sources
|
||||||
echo "Amalgamating files... this can take a while"
|
echo "Amalgamating files... this can take a while"
|
||||||
./combine.sh -r "$ZSTD_SRC_ROOT" -r "$ZSTD_SRC_ROOT/common" -r "$ZSTD_SRC_ROOT/decompress" -o zstddeclib.c zstddeclib-in.c
|
./combine.sh -r "$ZSTD_SRC_ROOT" -o zstddeclib.c zstddeclib-in.c
|
||||||
# Did combining work?
|
# Did combining work?
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "Combine script: FAILED"
|
echo "Combine script: FAILED"
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ ZSTD_SRC_ROOT="../../lib"
|
|||||||
|
|
||||||
# Amalgamate the sources
|
# Amalgamate the sources
|
||||||
echo "Amalgamating files... this can take a while"
|
echo "Amalgamating files... this can take a while"
|
||||||
./combine.sh -r "$ZSTD_SRC_ROOT" -r "$ZSTD_SRC_ROOT/common" -r "$ZSTD_SRC_ROOT/compress" -r "$ZSTD_SRC_ROOT/decompress" -k zstd.h -o zstd.c zstd-in.c
|
./combine.sh -r "$ZSTD_SRC_ROOT" -k zstd.h -o zstd.c zstd-in.c
|
||||||
# Did combining work?
|
# Did combining work?
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "Combine script: FAILED"
|
echo "Combine script: FAILED"
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* Generate using:
|
* Generate using:
|
||||||
* \code
|
* \code
|
||||||
* combine.sh -r ../../lib -r ../../lib/common -r ../../lib/compress -r ../../lib/decompress -k zstd.h -o zstd.c zstd-in.c
|
* combine.sh -r ../../lib -k zstd.h -o zstd.c zstd-in.c
|
||||||
* \endcode
|
* \endcode
|
||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
@@ -46,34 +46,31 @@
|
|||||||
#define ZSTD_MULTITHREAD
|
#define ZSTD_MULTITHREAD
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* lib/common */
|
#include "common/debug.c"
|
||||||
#include "debug.c"
|
#include "common/entropy_common.c"
|
||||||
#include "entropy_common.c"
|
#include "common/error_private.c"
|
||||||
#include "error_private.c"
|
#include "common/fse_decompress.c"
|
||||||
#include "fse_decompress.c"
|
#include "common/threading.c"
|
||||||
#include "threading.c"
|
#include "common/pool.c"
|
||||||
#include "pool.c"
|
#include "common/zstd_common.c"
|
||||||
#include "zstd_common.c"
|
|
||||||
|
|
||||||
/* lib/compress */
|
#include "compress/fse_compress.c"
|
||||||
#include "fse_compress.c"
|
#include "compress/hist.c"
|
||||||
#include "hist.c"
|
#include "compress/huf_compress.c"
|
||||||
#include "huf_compress.c"
|
#include "compress/zstd_compress_literals.c"
|
||||||
#include "zstd_compress_literals.c"
|
#include "compress/zstd_compress_sequences.c"
|
||||||
#include "zstd_compress_sequences.c"
|
#include "compress/zstd_compress_superblock.c"
|
||||||
#include "zstd_compress_superblock.c"
|
#include "compress/zstd_compress.c"
|
||||||
#include "zstd_compress.c"
|
#include "compress/zstd_double_fast.c"
|
||||||
#include "zstd_double_fast.c"
|
#include "compress/zstd_fast.c"
|
||||||
#include "zstd_fast.c"
|
#include "compress/zstd_lazy.c"
|
||||||
#include "zstd_lazy.c"
|
#include "compress/zstd_ldm.c"
|
||||||
#include "zstd_ldm.c"
|
#include "compress/zstd_opt.c"
|
||||||
#include "zstd_opt.c"
|
|
||||||
#ifdef ZSTD_MULTITHREAD
|
#ifdef ZSTD_MULTITHREAD
|
||||||
#include "zstdmt_compress.c"
|
#include "compress/zstdmt_compress.c"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* lib/decompress */
|
#include "decompress/huf_decompress.c"
|
||||||
#include "huf_decompress.c"
|
#include "decompress/zstd_ddict.c"
|
||||||
#include "zstd_ddict.c"
|
#include "decompress/zstd_decompress.c"
|
||||||
#include "zstd_decompress.c"
|
#include "decompress/zstd_decompress_block.c"
|
||||||
#include "zstd_decompress_block.c"
|
|
||||||
|
|||||||
Executable → Regular
+10
-12
@@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* Generate using:
|
* Generate using:
|
||||||
* \code
|
* \code
|
||||||
* combine.sh -r ../../lib -r ../../lib/common -r ../../lib/decompress -o zstddeclib.c zstddeclib-in.c
|
* combine.sh -r ../../lib -o zstddeclib.c zstddeclib-in.c
|
||||||
* \endcode
|
* \endcode
|
||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
@@ -42,15 +42,13 @@
|
|||||||
#define ZSTD_NOBENCH
|
#define ZSTD_NOBENCH
|
||||||
#define ZSTD_STRIP_ERROR_STRINGS
|
#define ZSTD_STRIP_ERROR_STRINGS
|
||||||
|
|
||||||
/* lib/common */
|
#include "common/debug.c"
|
||||||
#include "debug.c"
|
#include "common/entropy_common.c"
|
||||||
#include "entropy_common.c"
|
#include "common/error_private.c"
|
||||||
#include "error_private.c"
|
#include "common/fse_decompress.c"
|
||||||
#include "fse_decompress.c"
|
#include "common/zstd_common.c"
|
||||||
#include "zstd_common.c"
|
|
||||||
|
|
||||||
/* lib/decompress */
|
#include "decompress/huf_decompress.c"
|
||||||
#include "huf_decompress.c"
|
#include "decompress/zstd_ddict.c"
|
||||||
#include "zstd_ddict.c"
|
#include "decompress/zstd_decompress.c"
|
||||||
#include "zstd_decompress.c"
|
#include "decompress/zstd_decompress_block.c"
|
||||||
#include "zstd_decompress_block.c"
|
|
||||||
|
|||||||
+1
-2
@@ -20,7 +20,7 @@ LIBVER := $(shell echo $(LIBVER_SCRIPT))
|
|||||||
VERSION?= $(LIBVER)
|
VERSION?= $(LIBVER)
|
||||||
CCVER := $(shell $(CC) --version)
|
CCVER := $(shell $(CC) --version)
|
||||||
|
|
||||||
CPPFLAGS+= -I. -I./common -DXXH_NAMESPACE=ZSTD_
|
CPPFLAGS+= -DXXH_NAMESPACE=ZSTD_
|
||||||
ifeq ($(OS),Windows_NT) # MinGW assumed
|
ifeq ($(OS),Windows_NT) # MinGW assumed
|
||||||
CPPFLAGS += -D__USE_MINGW_ANSI_STDIO # compatibility with %zu formatting
|
CPPFLAGS += -D__USE_MINGW_ANSI_STDIO # compatibility with %zu formatting
|
||||||
endif
|
endif
|
||||||
@@ -149,7 +149,6 @@ ifneq ($(ZSTD_LEGACY_SUPPORT), 0)
|
|||||||
ifeq ($(shell test $(ZSTD_LEGACY_SUPPORT) -lt 8; echo $$?), 0)
|
ifeq ($(shell test $(ZSTD_LEGACY_SUPPORT) -lt 8; echo $$?), 0)
|
||||||
ZSTD_FILES += $(shell ls legacy/*.c | $(GREP) 'v0[$(ZSTD_LEGACY_SUPPORT)-7]')
|
ZSTD_FILES += $(shell ls legacy/*.c | $(GREP) 'v0[$(ZSTD_LEGACY_SUPPORT)-7]')
|
||||||
endif
|
endif
|
||||||
CPPFLAGS += -I./legacy
|
|
||||||
endif
|
endif
|
||||||
CPPFLAGS += -DZSTD_LEGACY_SUPPORT=$(ZSTD_LEGACY_SUPPORT)
|
CPPFLAGS += -DZSTD_LEGACY_SUPPORT=$(ZSTD_LEGACY_SUPPORT)
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -18,7 +18,7 @@ extern "C" {
|
|||||||
|
|
||||||
#include <stddef.h> /* size_t */
|
#include <stddef.h> /* size_t */
|
||||||
#define ZSTD_STATIC_LINKING_ONLY /* ZSTD_customMem */
|
#define ZSTD_STATIC_LINKING_ONLY /* ZSTD_customMem */
|
||||||
#include "zstd.h"
|
#include "../zstd.h"
|
||||||
|
|
||||||
typedef struct POOL_ctx_s POOL_ctx;
|
typedef struct POOL_ctx_s POOL_ctx;
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
#include "debug.h" /* assert, DEBUGLOG, RAWLOG, g_debuglevel */
|
#include "debug.h" /* assert, DEBUGLOG, RAWLOG, g_debuglevel */
|
||||||
#include "error_private.h"
|
#include "error_private.h"
|
||||||
#define ZSTD_STATIC_LINKING_ONLY
|
#define ZSTD_STATIC_LINKING_ONLY
|
||||||
#include "zstd.h"
|
#include "../zstd.h"
|
||||||
#define FSE_STATIC_LINKING_ONLY
|
#define FSE_STATIC_LINKING_ONLY
|
||||||
#include "fse.h"
|
#include "fse.h"
|
||||||
#define HUF_STATIC_LINKING_ONLY
|
#define HUF_STATIC_LINKING_ONLY
|
||||||
|
|||||||
@@ -17,14 +17,14 @@
|
|||||||
****************************************************************/
|
****************************************************************/
|
||||||
#include <stdlib.h> /* malloc, free, qsort */
|
#include <stdlib.h> /* malloc, free, qsort */
|
||||||
#include <string.h> /* memcpy, memset */
|
#include <string.h> /* memcpy, memset */
|
||||||
#include "compiler.h"
|
#include "../common/compiler.h"
|
||||||
#include "mem.h" /* U32, U16, etc. */
|
#include "../common/mem.h" /* U32, U16, etc. */
|
||||||
#include "debug.h" /* assert, DEBUGLOG */
|
#include "../common/debug.h" /* assert, DEBUGLOG */
|
||||||
#include "hist.h" /* HIST_count_wksp */
|
#include "hist.h" /* HIST_count_wksp */
|
||||||
#include "bitstream.h"
|
#include "../common/bitstream.h"
|
||||||
#define FSE_STATIC_LINKING_ONLY
|
#define FSE_STATIC_LINKING_ONLY
|
||||||
#include "fse.h"
|
#include "../common/fse.h"
|
||||||
#include "error_private.h"
|
#include "../common/error_private.h"
|
||||||
|
|
||||||
|
|
||||||
/* **************************************************************
|
/* **************************************************************
|
||||||
|
|||||||
+3
-3
@@ -14,9 +14,9 @@
|
|||||||
****************************************************************** */
|
****************************************************************** */
|
||||||
|
|
||||||
/* --- dependencies --- */
|
/* --- dependencies --- */
|
||||||
#include "mem.h" /* U32, BYTE, etc. */
|
#include "../common/mem.h" /* U32, BYTE, etc. */
|
||||||
#include "debug.h" /* assert, DEBUGLOG */
|
#include "../common/debug.h" /* assert, DEBUGLOG */
|
||||||
#include "error_private.h" /* ERROR */
|
#include "../common/error_private.h" /* ERROR */
|
||||||
#include "hist.h"
|
#include "hist.h"
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -25,14 +25,14 @@
|
|||||||
****************************************************************/
|
****************************************************************/
|
||||||
#include <string.h> /* memcpy, memset */
|
#include <string.h> /* memcpy, memset */
|
||||||
#include <stdio.h> /* printf (debug) */
|
#include <stdio.h> /* printf (debug) */
|
||||||
#include "compiler.h"
|
#include "../common/compiler.h"
|
||||||
#include "bitstream.h"
|
#include "../common/bitstream.h"
|
||||||
#include "hist.h"
|
#include "hist.h"
|
||||||
#define FSE_STATIC_LINKING_ONLY /* FSE_optimalTableLog_internal */
|
#define FSE_STATIC_LINKING_ONLY /* FSE_optimalTableLog_internal */
|
||||||
#include "fse.h" /* header compression */
|
#include "../common/fse.h" /* header compression */
|
||||||
#define HUF_STATIC_LINKING_ONLY
|
#define HUF_STATIC_LINKING_ONLY
|
||||||
#include "huf.h"
|
#include "../common/huf.h"
|
||||||
#include "error_private.h"
|
#include "../common/error_private.h"
|
||||||
|
|
||||||
|
|
||||||
/* **************************************************************
|
/* **************************************************************
|
||||||
|
|||||||
@@ -13,13 +13,13 @@
|
|||||||
***************************************/
|
***************************************/
|
||||||
#include <limits.h> /* INT_MAX */
|
#include <limits.h> /* INT_MAX */
|
||||||
#include <string.h> /* memset */
|
#include <string.h> /* memset */
|
||||||
#include "cpu.h"
|
#include "../common/cpu.h"
|
||||||
#include "mem.h"
|
#include "../common/mem.h"
|
||||||
#include "hist.h" /* HIST_countFast_wksp */
|
#include "hist.h" /* HIST_countFast_wksp */
|
||||||
#define FSE_STATIC_LINKING_ONLY /* FSE_encodeSymbol */
|
#define FSE_STATIC_LINKING_ONLY /* FSE_encodeSymbol */
|
||||||
#include "fse.h"
|
#include "../common/fse.h"
|
||||||
#define HUF_STATIC_LINKING_ONLY
|
#define HUF_STATIC_LINKING_ONLY
|
||||||
#include "huf.h"
|
#include "../common/huf.h"
|
||||||
#include "zstd_compress_internal.h"
|
#include "zstd_compress_internal.h"
|
||||||
#include "zstd_compress_sequences.h"
|
#include "zstd_compress_sequences.h"
|
||||||
#include "zstd_compress_literals.h"
|
#include "zstd_compress_literals.h"
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
/*-*************************************
|
/*-*************************************
|
||||||
* Dependencies
|
* Dependencies
|
||||||
***************************************/
|
***************************************/
|
||||||
#include "zstd_internal.h"
|
#include "../common/zstd_internal.h"
|
||||||
#include "zstd_cwksp.h"
|
#include "zstd_cwksp.h"
|
||||||
#ifdef ZSTD_MULTITHREAD
|
#ifdef ZSTD_MULTITHREAD
|
||||||
# include "zstdmt_compress.h"
|
# include "zstdmt_compress.h"
|
||||||
|
|||||||
@@ -11,8 +11,8 @@
|
|||||||
#ifndef ZSTD_COMPRESS_SEQUENCES_H
|
#ifndef ZSTD_COMPRESS_SEQUENCES_H
|
||||||
#define ZSTD_COMPRESS_SEQUENCES_H
|
#define ZSTD_COMPRESS_SEQUENCES_H
|
||||||
|
|
||||||
#include "fse.h" /* FSE_repeat, FSE_CTable */
|
#include "../common/fse.h" /* FSE_repeat, FSE_CTable */
|
||||||
#include "zstd_internal.h" /* symbolEncodingType_e, ZSTD_strategy */
|
#include "../common/zstd_internal.h" /* symbolEncodingType_e, ZSTD_strategy */
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
ZSTD_defaultDisallowed = 0,
|
ZSTD_defaultDisallowed = 0,
|
||||||
|
|||||||
@@ -11,12 +11,13 @@
|
|||||||
/*-*************************************
|
/*-*************************************
|
||||||
* Dependencies
|
* Dependencies
|
||||||
***************************************/
|
***************************************/
|
||||||
#include "hist.h" /* HIST_countFast_wksp */
|
#include "zstd_compress_superblock.h"
|
||||||
|
|
||||||
|
#include "../common/zstd_internal.h" /* ZSTD_getSequenceLength */
|
||||||
|
#include "hist.h" /* HIST_countFast_wksp */
|
||||||
#include "zstd_compress_internal.h"
|
#include "zstd_compress_internal.h"
|
||||||
#include "zstd_compress_sequences.h"
|
#include "zstd_compress_sequences.h"
|
||||||
#include "zstd_compress_literals.h"
|
#include "zstd_compress_literals.h"
|
||||||
#include "zstd_compress_superblock.h"
|
|
||||||
#include "zstd_internal.h" /* ZSTD_getSequenceLength */
|
|
||||||
|
|
||||||
/*-*************************************
|
/*-*************************************
|
||||||
* Superblock entropy buffer structs
|
* Superblock entropy buffer structs
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
* Dependencies
|
* Dependencies
|
||||||
***************************************/
|
***************************************/
|
||||||
|
|
||||||
#include "zstd.h" /* ZSTD_CCtx */
|
#include "../zstd.h" /* ZSTD_CCtx */
|
||||||
|
|
||||||
/*-*************************************
|
/*-*************************************
|
||||||
* Target Compressed Block Size
|
* Target Compressed Block Size
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
/*-*************************************
|
/*-*************************************
|
||||||
* Dependencies
|
* Dependencies
|
||||||
***************************************/
|
***************************************/
|
||||||
#include "zstd_internal.h"
|
#include "../common/zstd_internal.h"
|
||||||
|
|
||||||
#if defined (__cplusplus)
|
#if defined (__cplusplus)
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "mem.h" /* U32 */
|
#include "../common/mem.h" /* U32 */
|
||||||
#include "zstd_compress_internal.h" /* ZSTD_CCtx, size_t */
|
#include "zstd_compress_internal.h" /* ZSTD_CCtx, size_t */
|
||||||
|
|
||||||
void ZSTD_fillDoubleHashTable(ZSTD_matchState_t* ms,
|
void ZSTD_fillDoubleHashTable(ZSTD_matchState_t* ms,
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "mem.h" /* U32 */
|
#include "../common/mem.h" /* U32 */
|
||||||
#include "zstd_compress_internal.h"
|
#include "zstd_compress_internal.h"
|
||||||
|
|
||||||
void ZSTD_fillHashTable(ZSTD_matchState_t* ms,
|
void ZSTD_fillHashTable(ZSTD_matchState_t* ms,
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
#include "zstd_ldm.h"
|
#include "zstd_ldm.h"
|
||||||
|
|
||||||
#include "debug.h"
|
#include "../common/debug.h"
|
||||||
#include "zstd_fast.h" /* ZSTD_fillHashTable() */
|
#include "zstd_fast.h" /* ZSTD_fillHashTable() */
|
||||||
#include "zstd_double_fast.h" /* ZSTD_fillDoubleHashTable() */
|
#include "zstd_double_fast.h" /* ZSTD_fillDoubleHashTable() */
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "zstd_compress_internal.h" /* ldmParams_t, U32 */
|
#include "zstd_compress_internal.h" /* ldmParams_t, U32 */
|
||||||
#include "zstd.h" /* ZSTD_CCtx, size_t */
|
#include "../zstd.h" /* ZSTD_CCtx, size_t */
|
||||||
|
|
||||||
/*-*************************************
|
/*-*************************************
|
||||||
* Long distance matching
|
* Long distance matching
|
||||||
|
|||||||
@@ -22,9 +22,9 @@
|
|||||||
/* ====== Dependencies ====== */
|
/* ====== Dependencies ====== */
|
||||||
#include <string.h> /* memcpy, memset */
|
#include <string.h> /* memcpy, memset */
|
||||||
#include <limits.h> /* INT_MAX, UINT_MAX */
|
#include <limits.h> /* INT_MAX, UINT_MAX */
|
||||||
#include "mem.h" /* MEM_STATIC */
|
#include "../common/mem.h" /* MEM_STATIC */
|
||||||
#include "pool.h" /* threadpool */
|
#include "../common/pool.h" /* threadpool */
|
||||||
#include "threading.h" /* mutex */
|
#include "../common/threading.h" /* mutex */
|
||||||
#include "zstd_compress_internal.h" /* MIN, ERROR, ZSTD_*, ZSTD_highbit32 */
|
#include "zstd_compress_internal.h" /* MIN, ERROR, ZSTD_*, ZSTD_highbit32 */
|
||||||
#include "zstd_ldm.h"
|
#include "zstd_ldm.h"
|
||||||
#include "zstdmt_compress.h"
|
#include "zstdmt_compress.h"
|
||||||
|
|||||||
@@ -40,7 +40,7 @@
|
|||||||
/* === Dependencies === */
|
/* === Dependencies === */
|
||||||
#include <stddef.h> /* size_t */
|
#include <stddef.h> /* size_t */
|
||||||
#define ZSTD_STATIC_LINKING_ONLY /* ZSTD_parameters */
|
#define ZSTD_STATIC_LINKING_ONLY /* ZSTD_parameters */
|
||||||
#include "zstd.h" /* ZSTD_inBuffer, ZSTD_outBuffer, ZSTDLIB_API */
|
#include "../zstd.h" /* ZSTD_inBuffer, ZSTD_outBuffer, ZSTDLIB_API */
|
||||||
|
|
||||||
|
|
||||||
/* === Constants === */
|
/* === Constants === */
|
||||||
|
|||||||
@@ -16,12 +16,12 @@
|
|||||||
* Dependencies
|
* Dependencies
|
||||||
****************************************************************/
|
****************************************************************/
|
||||||
#include <string.h> /* memcpy, memset */
|
#include <string.h> /* memcpy, memset */
|
||||||
#include "compiler.h"
|
#include "../common/compiler.h"
|
||||||
#include "bitstream.h" /* BIT_* */
|
#include "../common/bitstream.h" /* BIT_* */
|
||||||
#include "fse.h" /* to compress headers */
|
#include "../common/fse.h" /* to compress headers */
|
||||||
#define HUF_STATIC_LINKING_ONLY
|
#define HUF_STATIC_LINKING_ONLY
|
||||||
#include "huf.h"
|
#include "../common/huf.h"
|
||||||
#include "error_private.h"
|
#include "../common/error_private.h"
|
||||||
|
|
||||||
/* **************************************************************
|
/* **************************************************************
|
||||||
* Macros
|
* Macros
|
||||||
|
|||||||
@@ -15,17 +15,17 @@
|
|||||||
* Dependencies
|
* Dependencies
|
||||||
*********************************************************/
|
*********************************************************/
|
||||||
#include <string.h> /* memcpy, memmove, memset */
|
#include <string.h> /* memcpy, memmove, memset */
|
||||||
#include "cpu.h" /* bmi2 */
|
#include "../common/cpu.h" /* bmi2 */
|
||||||
#include "mem.h" /* low level memory routines */
|
#include "../common/mem.h" /* low level memory routines */
|
||||||
#define FSE_STATIC_LINKING_ONLY
|
#define FSE_STATIC_LINKING_ONLY
|
||||||
#include "fse.h"
|
#include "../common/fse.h"
|
||||||
#define HUF_STATIC_LINKING_ONLY
|
#define HUF_STATIC_LINKING_ONLY
|
||||||
#include "huf.h"
|
#include "../common/huf.h"
|
||||||
#include "zstd_decompress_internal.h"
|
#include "zstd_decompress_internal.h"
|
||||||
#include "zstd_ddict.h"
|
#include "zstd_ddict.h"
|
||||||
|
|
||||||
#if defined(ZSTD_LEGACY_SUPPORT) && (ZSTD_LEGACY_SUPPORT>=1)
|
#if defined(ZSTD_LEGACY_SUPPORT) && (ZSTD_LEGACY_SUPPORT>=1)
|
||||||
# include "zstd_legacy.h"
|
# include "../legacy/zstd_legacy.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
* Dependencies
|
* Dependencies
|
||||||
*********************************************************/
|
*********************************************************/
|
||||||
#include <stddef.h> /* size_t */
|
#include <stddef.h> /* size_t */
|
||||||
#include "zstd.h" /* ZSTD_DDict, and several public functions */
|
#include "../zstd.h" /* ZSTD_DDict, and several public functions */
|
||||||
|
|
||||||
|
|
||||||
/*-*******************************************************
|
/*-*******************************************************
|
||||||
|
|||||||
@@ -56,19 +56,19 @@
|
|||||||
* Dependencies
|
* Dependencies
|
||||||
*********************************************************/
|
*********************************************************/
|
||||||
#include <string.h> /* memcpy, memmove, memset */
|
#include <string.h> /* memcpy, memmove, memset */
|
||||||
#include "cpu.h" /* bmi2 */
|
#include "../common/cpu.h" /* bmi2 */
|
||||||
#include "mem.h" /* low level memory routines */
|
#include "../common/mem.h" /* low level memory routines */
|
||||||
#define FSE_STATIC_LINKING_ONLY
|
#define FSE_STATIC_LINKING_ONLY
|
||||||
#include "fse.h"
|
#include "../common/fse.h"
|
||||||
#define HUF_STATIC_LINKING_ONLY
|
#define HUF_STATIC_LINKING_ONLY
|
||||||
#include "huf.h"
|
#include "../common/huf.h"
|
||||||
#include "zstd_internal.h" /* blockProperties_t */
|
#include "../common/zstd_internal.h" /* blockProperties_t */
|
||||||
#include "zstd_decompress_internal.h" /* ZSTD_DCtx */
|
#include "zstd_decompress_internal.h" /* ZSTD_DCtx */
|
||||||
#include "zstd_ddict.h" /* ZSTD_DDictDictContent */
|
#include "zstd_ddict.h" /* ZSTD_DDictDictContent */
|
||||||
#include "zstd_decompress_block.h" /* ZSTD_decompressBlock_internal */
|
#include "zstd_decompress_block.h" /* ZSTD_decompressBlock_internal */
|
||||||
|
|
||||||
#if defined(ZSTD_LEGACY_SUPPORT) && (ZSTD_LEGACY_SUPPORT>=1)
|
#if defined(ZSTD_LEGACY_SUPPORT) && (ZSTD_LEGACY_SUPPORT>=1)
|
||||||
# include "zstd_legacy.h"
|
# include "../legacy/zstd_legacy.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -15,14 +15,14 @@
|
|||||||
* Dependencies
|
* Dependencies
|
||||||
*********************************************************/
|
*********************************************************/
|
||||||
#include <string.h> /* memcpy, memmove, memset */
|
#include <string.h> /* memcpy, memmove, memset */
|
||||||
#include "compiler.h" /* prefetch */
|
#include "../common/compiler.h" /* prefetch */
|
||||||
#include "cpu.h" /* bmi2 */
|
#include "../common/cpu.h" /* bmi2 */
|
||||||
#include "mem.h" /* low level memory routines */
|
#include "../common/mem.h" /* low level memory routines */
|
||||||
#define FSE_STATIC_LINKING_ONLY
|
#define FSE_STATIC_LINKING_ONLY
|
||||||
#include "fse.h"
|
#include "../common/fse.h"
|
||||||
#define HUF_STATIC_LINKING_ONLY
|
#define HUF_STATIC_LINKING_ONLY
|
||||||
#include "huf.h"
|
#include "../common/huf.h"
|
||||||
#include "zstd_internal.h"
|
#include "../common/zstd_internal.h"
|
||||||
#include "zstd_decompress_internal.h" /* ZSTD_DCtx */
|
#include "zstd_decompress_internal.h" /* ZSTD_DCtx */
|
||||||
#include "zstd_ddict.h" /* ZSTD_DDictDictContent */
|
#include "zstd_ddict.h" /* ZSTD_DDictDictContent */
|
||||||
#include "zstd_decompress_block.h"
|
#include "zstd_decompress_block.h"
|
||||||
|
|||||||
@@ -16,8 +16,8 @@
|
|||||||
* Dependencies
|
* Dependencies
|
||||||
*********************************************************/
|
*********************************************************/
|
||||||
#include <stddef.h> /* size_t */
|
#include <stddef.h> /* size_t */
|
||||||
#include "zstd.h" /* DCtx, and some public functions */
|
#include "../zstd.h" /* DCtx, and some public functions */
|
||||||
#include "zstd_internal.h" /* blockProperties_t, and some public functions */
|
#include "../common/zstd_internal.h" /* blockProperties_t, and some public functions */
|
||||||
#include "zstd_decompress_internal.h" /* ZSTD_seqSymbol */
|
#include "zstd_decompress_internal.h" /* ZSTD_seqSymbol */
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -19,8 +19,8 @@
|
|||||||
/*-*******************************************************
|
/*-*******************************************************
|
||||||
* Dependencies
|
* Dependencies
|
||||||
*********************************************************/
|
*********************************************************/
|
||||||
#include "mem.h" /* BYTE, U16, U32 */
|
#include "../common/mem.h" /* BYTE, U16, U32 */
|
||||||
#include "zstd_internal.h" /* ZSTD_seqSymbol */
|
#include "../common/zstd_internal.h" /* ZSTD_seqSymbol */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ extern "C" {
|
|||||||
* Dependencies
|
* Dependencies
|
||||||
***************************************/
|
***************************************/
|
||||||
#include <stddef.h> /* size_t */
|
#include <stddef.h> /* size_t */
|
||||||
#include "zstd.h" /* ZSTD_CStream, ZSTD_DStream, ZSTDLIB_API */
|
#include "../zstd.h" /* ZSTD_CStream, ZSTD_DStream, ZSTDLIB_API */
|
||||||
|
|
||||||
|
|
||||||
/* ***************************************************************
|
/* ***************************************************************
|
||||||
@@ -186,7 +186,7 @@ ZBUFF_DEPRECATED("use ZSTD_DStreamOutSize") size_t ZBUFF_recommendedDOutSize(voi
|
|||||||
|
|
||||||
/*--- Dependency ---*/
|
/*--- Dependency ---*/
|
||||||
#define ZSTD_STATIC_LINKING_ONLY /* ZSTD_parameters, ZSTD_customMem */
|
#define ZSTD_STATIC_LINKING_ONLY /* ZSTD_parameters, ZSTD_customMem */
|
||||||
#include "zstd.h"
|
#include "../zstd.h"
|
||||||
|
|
||||||
|
|
||||||
/*--- Custom memory allocator ---*/
|
/*--- Custom memory allocator ---*/
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
/*-*************************************
|
/*-*************************************
|
||||||
* Dependencies
|
* Dependencies
|
||||||
***************************************/
|
***************************************/
|
||||||
#include "error_private.h"
|
#include "../common/error_private.h"
|
||||||
#include "zbuff.h"
|
#include "zbuff.h"
|
||||||
|
|
||||||
/*-****************************************
|
/*-****************************************
|
||||||
|
|||||||
@@ -26,11 +26,11 @@
|
|||||||
#include <string.h> /* memset */
|
#include <string.h> /* memset */
|
||||||
#include <time.h> /* clock */
|
#include <time.h> /* clock */
|
||||||
|
|
||||||
#include "mem.h" /* read */
|
#include "../common/mem.h" /* read */
|
||||||
#include "pool.h"
|
#include "../common/pool.h"
|
||||||
#include "threading.h"
|
#include "../common/threading.h"
|
||||||
#include "cover.h"
|
#include "cover.h"
|
||||||
#include "zstd_internal.h" /* includes zstd.h */
|
#include "../common/zstd_internal.h" /* includes zstd.h */
|
||||||
#ifndef ZDICT_STATIC_LINKING_ONLY
|
#ifndef ZDICT_STATIC_LINKING_ONLY
|
||||||
#define ZDICT_STATIC_LINKING_ONLY
|
#define ZDICT_STATIC_LINKING_ONLY
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -12,10 +12,10 @@
|
|||||||
#include <stdlib.h> /* malloc, free, qsort */
|
#include <stdlib.h> /* malloc, free, qsort */
|
||||||
#include <string.h> /* memset */
|
#include <string.h> /* memset */
|
||||||
#include <time.h> /* clock */
|
#include <time.h> /* clock */
|
||||||
#include "mem.h" /* read */
|
#include "../common/mem.h" /* read */
|
||||||
#include "pool.h"
|
#include "../common/pool.h"
|
||||||
#include "threading.h"
|
#include "../common/threading.h"
|
||||||
#include "zstd_internal.h" /* includes zstd.h */
|
#include "../common/zstd_internal.h" /* includes zstd.h */
|
||||||
#ifndef ZDICT_STATIC_LINKING_ONLY
|
#ifndef ZDICT_STATIC_LINKING_ONLY
|
||||||
#define ZDICT_STATIC_LINKING_ONLY
|
#define ZDICT_STATIC_LINKING_ONLY
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -16,11 +16,11 @@
|
|||||||
#include <string.h> /* memset */
|
#include <string.h> /* memset */
|
||||||
#include <time.h> /* clock */
|
#include <time.h> /* clock */
|
||||||
|
|
||||||
#include "mem.h" /* read */
|
#include "../common/mem.h" /* read */
|
||||||
#include "pool.h"
|
#include "../common/pool.h"
|
||||||
#include "threading.h"
|
#include "../common/threading.h"
|
||||||
#include "cover.h"
|
#include "cover.h"
|
||||||
#include "zstd_internal.h" /* includes zstd.h */
|
#include "../common/zstd_internal.h" /* includes zstd.h */
|
||||||
#ifndef ZDICT_STATIC_LINKING_ONLY
|
#ifndef ZDICT_STATIC_LINKING_ONLY
|
||||||
#define ZDICT_STATIC_LINKING_ONLY
|
#define ZDICT_STATIC_LINKING_ONLY
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -37,18 +37,18 @@
|
|||||||
#include <stdio.h> /* fprintf, fopen, ftello64 */
|
#include <stdio.h> /* fprintf, fopen, ftello64 */
|
||||||
#include <time.h> /* clock */
|
#include <time.h> /* clock */
|
||||||
|
|
||||||
#include "mem.h" /* read */
|
#include "../common/mem.h" /* read */
|
||||||
#include "fse.h" /* FSE_normalizeCount, FSE_writeNCount */
|
#include "../common/fse.h" /* FSE_normalizeCount, FSE_writeNCount */
|
||||||
#define HUF_STATIC_LINKING_ONLY
|
#define HUF_STATIC_LINKING_ONLY
|
||||||
#include "huf.h" /* HUF_buildCTable, HUF_writeCTable */
|
#include "../common/huf.h" /* HUF_buildCTable, HUF_writeCTable */
|
||||||
#include "zstd_internal.h" /* includes zstd.h */
|
#include "../common/zstd_internal.h" /* includes zstd.h */
|
||||||
#include "xxhash.h" /* XXH64 */
|
#include "../common/xxhash.h" /* XXH64 */
|
||||||
#include "divsufsort.h"
|
#include "divsufsort.h"
|
||||||
#ifndef ZDICT_STATIC_LINKING_ONLY
|
#ifndef ZDICT_STATIC_LINKING_ONLY
|
||||||
# define ZDICT_STATIC_LINKING_ONLY
|
# define ZDICT_STATIC_LINKING_ONLY
|
||||||
#endif
|
#endif
|
||||||
#include "zdict.h"
|
#include "zdict.h"
|
||||||
#include "compress/zstd_compress_internal.h" /* ZSTD_loadCEntropy() */
|
#include "../compress/zstd_compress_internal.h" /* ZSTD_loadCEntropy() */
|
||||||
|
|
||||||
|
|
||||||
/*-*************************************
|
/*-*************************************
|
||||||
|
|||||||
@@ -18,9 +18,9 @@ extern "C" {
|
|||||||
/* *************************************
|
/* *************************************
|
||||||
* Includes
|
* Includes
|
||||||
***************************************/
|
***************************************/
|
||||||
#include "mem.h" /* MEM_STATIC */
|
#include "../common/mem.h" /* MEM_STATIC */
|
||||||
#include "error_private.h" /* ERROR */
|
#include "../common/error_private.h" /* ERROR */
|
||||||
#include "zstd_internal.h" /* ZSTD_inBuffer, ZSTD_outBuffer, ZSTD_frameSizeInfo */
|
#include "../common/zstd_internal.h" /* ZSTD_inBuffer, ZSTD_outBuffer, ZSTD_frameSizeInfo */
|
||||||
|
|
||||||
#if !defined (ZSTD_LEGACY_SUPPORT) || (ZSTD_LEGACY_SUPPORT == 0)
|
#if !defined (ZSTD_LEGACY_SUPPORT) || (ZSTD_LEGACY_SUPPORT == 0)
|
||||||
# undef ZSTD_LEGACY_SUPPORT
|
# undef ZSTD_LEGACY_SUPPORT
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
******************************************/
|
******************************************/
|
||||||
#include <stddef.h> /* size_t, ptrdiff_t */
|
#include <stddef.h> /* size_t, ptrdiff_t */
|
||||||
#include "zstd_v01.h"
|
#include "zstd_v01.h"
|
||||||
#include "error_private.h"
|
#include "../common/error_private.h"
|
||||||
|
|
||||||
|
|
||||||
/******************************************
|
/******************************************
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
#include <stddef.h> /* size_t, ptrdiff_t */
|
#include <stddef.h> /* size_t, ptrdiff_t */
|
||||||
#include "zstd_v02.h"
|
#include "zstd_v02.h"
|
||||||
#include "error_private.h"
|
#include "../common/error_private.h"
|
||||||
|
|
||||||
|
|
||||||
/******************************************
|
/******************************************
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
#include <stddef.h> /* size_t, ptrdiff_t */
|
#include <stddef.h> /* size_t, ptrdiff_t */
|
||||||
#include "zstd_v03.h"
|
#include "zstd_v03.h"
|
||||||
#include "error_private.h"
|
#include "../common/error_private.h"
|
||||||
|
|
||||||
|
|
||||||
/******************************************
|
/******************************************
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
#include <string.h> /* memcpy */
|
#include <string.h> /* memcpy */
|
||||||
|
|
||||||
#include "zstd_v04.h"
|
#include "zstd_v04.h"
|
||||||
#include "error_private.h"
|
#include "../common/error_private.h"
|
||||||
|
|
||||||
|
|
||||||
/* ******************************************************************
|
/* ******************************************************************
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
/*- Dependencies -*/
|
/*- Dependencies -*/
|
||||||
#include "zstd_v05.h"
|
#include "zstd_v05.h"
|
||||||
#include "error_private.h"
|
#include "../common/error_private.h"
|
||||||
|
|
||||||
|
|
||||||
/* ******************************************************************
|
/* ******************************************************************
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ extern "C" {
|
|||||||
* Dependencies
|
* Dependencies
|
||||||
***************************************/
|
***************************************/
|
||||||
#include <stddef.h> /* size_t */
|
#include <stddef.h> /* size_t */
|
||||||
#include "mem.h" /* U64, U32 */
|
#include "../common/mem.h" /* U64, U32 */
|
||||||
|
|
||||||
|
|
||||||
/* *************************************
|
/* *************************************
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
#include <stddef.h> /* size_t, ptrdiff_t */
|
#include <stddef.h> /* size_t, ptrdiff_t */
|
||||||
#include <string.h> /* memcpy */
|
#include <string.h> /* memcpy */
|
||||||
#include <stdlib.h> /* malloc, free, qsort */
|
#include <stdlib.h> /* malloc, free, qsort */
|
||||||
#include "error_private.h"
|
#include "../common/error_private.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -17,14 +17,14 @@
|
|||||||
#ifndef XXH_STATIC_LINKING_ONLY
|
#ifndef XXH_STATIC_LINKING_ONLY
|
||||||
# define XXH_STATIC_LINKING_ONLY /* XXH64_state_t */
|
# define XXH_STATIC_LINKING_ONLY /* XXH64_state_t */
|
||||||
#endif
|
#endif
|
||||||
#include "xxhash.h" /* XXH64_* */
|
#include "../common/xxhash.h" /* XXH64_* */
|
||||||
#include "zstd_v07.h"
|
#include "zstd_v07.h"
|
||||||
|
|
||||||
#define FSEv07_STATIC_LINKING_ONLY /* FSEv07_MIN_TABLELOG */
|
#define FSEv07_STATIC_LINKING_ONLY /* FSEv07_MIN_TABLELOG */
|
||||||
#define HUFv07_STATIC_LINKING_ONLY /* HUFv07_TABLELOG_ABSOLUTEMAX */
|
#define HUFv07_STATIC_LINKING_ONLY /* HUFv07_TABLELOG_ABSOLUTEMAX */
|
||||||
#define ZSTDv07_STATIC_LINKING_ONLY
|
#define ZSTDv07_STATIC_LINKING_ONLY
|
||||||
|
|
||||||
#include "error_private.h"
|
#include "../common/error_private.h"
|
||||||
|
|
||||||
|
|
||||||
#ifdef ZSTDv07_STATIC_LINKING_ONLY
|
#ifdef ZSTDv07_STATIC_LINKING_ONLY
|
||||||
|
|||||||
+1
-4
@@ -43,9 +43,7 @@ else
|
|||||||
ALIGN_LOOP =
|
ALIGN_LOOP =
|
||||||
endif
|
endif
|
||||||
|
|
||||||
CPPFLAGS+= -I$(ZSTDDIR) -I$(ZSTDDIR)/common -I$(ZSTDDIR)/compress \
|
CPPFLAGS+= -DXXH_NAMESPACE=ZSTD_
|
||||||
-I$(ZSTDDIR)/dictBuilder \
|
|
||||||
-DXXH_NAMESPACE=ZSTD_
|
|
||||||
ifeq ($(OS),Windows_NT) # MinGW assumed
|
ifeq ($(OS),Windows_NT) # MinGW assumed
|
||||||
CPPFLAGS += -D__USE_MINGW_ANSI_STDIO # compatibility with %zu formatting
|
CPPFLAGS += -D__USE_MINGW_ANSI_STDIO # compatibility with %zu formatting
|
||||||
endif
|
endif
|
||||||
@@ -72,7 +70,6 @@ ifneq ($(ZSTD_LEGACY_SUPPORT), 0)
|
|||||||
ifeq ($(shell test $(ZSTD_LEGACY_SUPPORT) -lt 8; echo $$?), 0)
|
ifeq ($(shell test $(ZSTD_LEGACY_SUPPORT) -lt 8; echo $$?), 0)
|
||||||
ZSTDLEGACY_FILES += $(shell ls $(ZSTDDIR)/legacy/*.c | $(GREP) 'v0[$(ZSTD_LEGACY_SUPPORT)-7]')
|
ZSTDLEGACY_FILES += $(shell ls $(ZSTDDIR)/legacy/*.c | $(GREP) 'v0[$(ZSTD_LEGACY_SUPPORT)-7]')
|
||||||
endif
|
endif
|
||||||
CPPFLAGS += -I$(ZSTDDIR)/legacy
|
|
||||||
else
|
else
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|||||||
@@ -30,13 +30,13 @@
|
|||||||
|
|
||||||
#include "timefn.h" /* UTIL_time_t */
|
#include "timefn.h" /* UTIL_time_t */
|
||||||
#include "benchfn.h"
|
#include "benchfn.h"
|
||||||
#include "mem.h"
|
#include "../lib/common/mem.h"
|
||||||
#define ZSTD_STATIC_LINKING_ONLY
|
#define ZSTD_STATIC_LINKING_ONLY
|
||||||
#include "zstd.h"
|
#include "../lib/zstd.h"
|
||||||
#include "datagen.h" /* RDG_genBuffer */
|
#include "datagen.h" /* RDG_genBuffer */
|
||||||
#include "xxhash.h"
|
#include "../lib/common/xxhash.h"
|
||||||
#include "benchzstd.h"
|
#include "benchzstd.h"
|
||||||
#include "zstd_errors.h"
|
#include "../lib/common/zstd_errors.h"
|
||||||
|
|
||||||
|
|
||||||
/* *************************************
|
/* *************************************
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ extern "C" {
|
|||||||
/* === Dependencies === */
|
/* === Dependencies === */
|
||||||
#include <stddef.h> /* size_t */
|
#include <stddef.h> /* size_t */
|
||||||
#define ZSTD_STATIC_LINKING_ONLY /* ZSTD_compressionParameters */
|
#define ZSTD_STATIC_LINKING_ONLY /* ZSTD_compressionParameters */
|
||||||
#include "zstd.h" /* ZSTD_compressionParameters */
|
#include "../lib/zstd.h" /* ZSTD_compressionParameters */
|
||||||
|
|
||||||
|
|
||||||
/* === Constants === */
|
/* === Constants === */
|
||||||
|
|||||||
+1
-1
@@ -18,7 +18,7 @@
|
|||||||
#include <stdlib.h> /* malloc, free */
|
#include <stdlib.h> /* malloc, free */
|
||||||
#include <stdio.h> /* FILE, fwrite, fprintf */
|
#include <stdio.h> /* FILE, fwrite, fprintf */
|
||||||
#include <string.h> /* memcpy */
|
#include <string.h> /* memcpy */
|
||||||
#include "mem.h" /* U32 */
|
#include "../lib/common/mem.h" /* U32 */
|
||||||
|
|
||||||
|
|
||||||
/*-************************************
|
/*-************************************
|
||||||
|
|||||||
+2
-2
@@ -30,8 +30,8 @@
|
|||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
#include "timefn.h" /* UTIL_time_t, UTIL_clockSpanMicro, UTIL_getTime */
|
#include "timefn.h" /* UTIL_time_t, UTIL_clockSpanMicro, UTIL_getTime */
|
||||||
#include "mem.h" /* read */
|
#include "../lib/common/mem.h" /* read */
|
||||||
#include "error_private.h"
|
#include "../lib/common/error_private.h"
|
||||||
#include "dibio.h"
|
#include "dibio.h"
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -19,7 +19,7 @@
|
|||||||
* Dependencies
|
* Dependencies
|
||||||
***************************************/
|
***************************************/
|
||||||
#define ZDICT_STATIC_LINKING_ONLY
|
#define ZDICT_STATIC_LINKING_ONLY
|
||||||
#include "zdict.h" /* ZDICT_params_t */
|
#include "../lib/dictBuilder/zdict.h" /* ZDICT_params_t */
|
||||||
|
|
||||||
|
|
||||||
/*-*************************************
|
/*-*************************************
|
||||||
|
|||||||
+4
-4
@@ -39,13 +39,13 @@
|
|||||||
# include <io.h>
|
# include <io.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "mem.h" /* U32, U64 */
|
#include "../lib/common/mem.h" /* U32, U64 */
|
||||||
#include "fileio.h"
|
#include "fileio.h"
|
||||||
|
|
||||||
#define ZSTD_STATIC_LINKING_ONLY /* ZSTD_magicNumber, ZSTD_frameHeaderSize_max */
|
#define ZSTD_STATIC_LINKING_ONLY /* ZSTD_magicNumber, ZSTD_frameHeaderSize_max */
|
||||||
#include "zstd.h"
|
#include "../lib/zstd.h"
|
||||||
#include "zstd_errors.h" /* ZSTD_error_frameParameter_windowTooLarge */
|
#include "../lib/common/zstd_errors.h" /* ZSTD_error_frameParameter_windowTooLarge */
|
||||||
#include "zstd_compress_internal.h"
|
#include "../lib/compress/zstd_compress_internal.h"
|
||||||
|
|
||||||
#if defined(ZSTD_GZCOMPRESS) || defined(ZSTD_GZDECOMPRESS)
|
#if defined(ZSTD_GZCOMPRESS) || defined(ZSTD_GZDECOMPRESS)
|
||||||
# include <zlib.h>
|
# include <zlib.h>
|
||||||
|
|||||||
+1
-1
@@ -13,7 +13,7 @@
|
|||||||
#define FILEIO_H_23981798732
|
#define FILEIO_H_23981798732
|
||||||
|
|
||||||
#define ZSTD_STATIC_LINKING_ONLY /* ZSTD_compressionParameters */
|
#define ZSTD_STATIC_LINKING_ONLY /* ZSTD_compressionParameters */
|
||||||
#include "zstd.h" /* ZSTD_* */
|
#include "../lib/zstd.h" /* ZSTD_* */
|
||||||
|
|
||||||
#if defined (__cplusplus)
|
#if defined (__cplusplus)
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
|||||||
+1
-1
@@ -23,7 +23,7 @@ extern "C" {
|
|||||||
#include <stddef.h> /* size_t, ptrdiff_t */
|
#include <stddef.h> /* size_t, ptrdiff_t */
|
||||||
#include <sys/types.h> /* stat, utime */
|
#include <sys/types.h> /* stat, utime */
|
||||||
#include <sys/stat.h> /* stat, chmod */
|
#include <sys/stat.h> /* stat, chmod */
|
||||||
#include "mem.h" /* U64 */
|
#include "../lib/common/mem.h" /* U64 */
|
||||||
|
|
||||||
|
|
||||||
/*-************************************************************
|
/*-************************************************************
|
||||||
|
|||||||
+1
-1
@@ -40,7 +40,7 @@
|
|||||||
#ifndef ZSTD_NODICT
|
#ifndef ZSTD_NODICT
|
||||||
# include "dibio.h" /* ZDICT_cover_params_t, DiB_trainFromFiles() */
|
# include "dibio.h" /* ZDICT_cover_params_t, DiB_trainFromFiles() */
|
||||||
#endif
|
#endif
|
||||||
#include "zstd.h" /* ZSTD_VERSION_STRING, ZSTD_minCLevel, ZSTD_maxCLevel */
|
#include "../lib/zstd.h" /* ZSTD_VERSION_STRING, ZSTD_minCLevel, ZSTD_maxCLevel */
|
||||||
|
|
||||||
|
|
||||||
/*-************************************
|
/*-************************************
|
||||||
|
|||||||
Reference in New Issue
Block a user