zstddeclib-in.c 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /**
  2. * \file zstddeclib.c
  3. * Single-file Zstandard decompressor.
  4. *
  5. * Generate using:
  6. * \code
  7. * combine.sh -r ../../lib -o zstddeclib.c zstddeclib-in.c
  8. * \endcode
  9. */
  10. /*
  11. * Copyright (c) 2016-2021, Yann Collet, Facebook, Inc.
  12. * All rights reserved.
  13. *
  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.
  18. */
  19. /*
  20. * Settings to bake for the standalone decompressor.
  21. *
  22. * Note: It's important that none of these affects 'zstd.h' (only the
  23. * implementation files we're amalgamating).
  24. *
  25. * Note: MEM_MODULE stops xxhash redefining BYTE, U16, etc., which are also
  26. * defined in mem.h (breaking C99 compatibility).
  27. *
  28. * Note: the undefs for xxHash allow Zstd's implementation to coincide with with
  29. * standalone xxHash usage (with global defines).
  30. */
  31. #define DEBUGLEVEL 0
  32. #define MEM_MODULE
  33. #undef XXH_NAMESPACE
  34. #define XXH_NAMESPACE ZSTD_
  35. #undef XXH_PRIVATE_API
  36. #define XXH_PRIVATE_API
  37. #undef XXH_INLINE_ALL
  38. #define XXH_INLINE_ALL
  39. #define ZSTD_LEGACY_SUPPORT 0
  40. #define ZSTD_STRIP_ERROR_STRINGS
  41. #define ZSTD_TRACE 0
  42. /* TODO: Can't amalgamate ASM function */
  43. #define ZSTD_DISABLE_ASM 1
  44. /* Include zstd_deps.h first with all the options we need enabled. */
  45. #define ZSTD_DEPS_NEED_MALLOC
  46. #include "common/zstd_deps.h"
  47. #include "common/debug.c"
  48. #include "common/entropy_common.c"
  49. #include "common/error_private.c"
  50. #include "common/fse_decompress.c"
  51. #include "common/zstd_common.c"
  52. #include "decompress/huf_decompress.c"
  53. #include "decompress/zstd_ddict.c"
  54. #include "decompress/zstd_decompress.c"
  55. #include "decompress/zstd_decompress_block.c"