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