3 * Single-file Zstandard decompressor.
7 * python combine.py -r ../../lib -x legacy/zstd_legacy.h -o zstddeclib.c zstddeclib-in.c
11 * Copyright (c) Meta Platforms, Inc. and affiliates.
12 * All rights reserved.
14 * This source code is licensed under both the BSD-style license (found in the
15 * LICENSE file in the root directory of this source tree) and the GPLv2 (found
16 * in the COPYING file in the root directory of this source tree).
17 * You may select, at your option, one of the above-listed licenses.
20 * Settings to bake for the standalone decompressor.
22 * Note: It's important that none of these affects 'zstd.h' (only the
23 * implementation files we're amalgamating).
25 * Note: MEM_MODULE stops xxhash redefining BYTE, U16, etc., which are also
26 * defined in mem.h (breaking C99 compatibility).
28 * Note: the undefs for xxHash allow Zstd's implementation to coincide with
29 * standalone xxHash usage (with global defines).
31 * Note: if you enable ZSTD_LEGACY_SUPPORT the combine.py script will need
32 * re-running without the "-x legacy/zstd_legacy.h" option (it excludes the
33 * legacy support at the source level).
38 #define XXH_NAMESPACE ZSTD_
39 #undef XXH_PRIVATE_API
40 #define XXH_PRIVATE_API
42 #define XXH_INLINE_ALL
43 #define ZSTD_LEGACY_SUPPORT 0
44 #define ZSTD_STRIP_ERROR_STRINGS
46 /* TODO: Can't amalgamate ASM function */
47 #define ZSTD_DISABLE_ASM 1
49 /* Include zstd_deps.h first with all the options we need enabled. */
50 #define ZSTD_DEPS_NEED_MALLOC
51 #include "common/zstd_deps.h"
53 #include "common/debug.c"
54 #include "common/entropy_common.c"
55 #include "common/error_private.c"
56 #include "common/fse_decompress.c"
57 #include "common/zstd_common.c"
59 #include "decompress/huf_decompress.c"
60 #include "decompress/zstd_ddict.c"
61 #include "decompress/zstd_decompress.c"
62 #include "decompress/zstd_decompress_block.c"