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