zstd-in.c 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. /**
  2. * \file zstd.c
  3. * Single-file Zstandard library.
  4. *
  5. * Generate using:
  6. * \code
  7. * combine.sh -r ../../lib -o zstd.c zstd-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 single library file.
  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. * Note: multithreading is enabled for all platforms apart from Emscripten.
  32. */
  33. #define DEBUGLEVEL 0
  34. #define MEM_MODULE
  35. #undef XXH_NAMESPACE
  36. #define XXH_NAMESPACE ZSTD_
  37. #undef XXH_PRIVATE_API
  38. #define XXH_PRIVATE_API
  39. #undef XXH_INLINE_ALL
  40. #define XXH_INLINE_ALL
  41. #define ZSTD_LEGACY_SUPPORT 0
  42. #ifndef __EMSCRIPTEN__
  43. #define ZSTD_MULTITHREAD
  44. #endif
  45. #define ZSTD_TRACE 0
  46. /* TODO: Can't amalgamate ASM function */
  47. #define ZSTD_DISABLE_ASM 1
  48. /* Include zstd_deps.h first with all the options we need enabled. */
  49. #define ZSTD_DEPS_NEED_MALLOC
  50. #define ZSTD_DEPS_NEED_MATH64
  51. #include "common/zstd_deps.h"
  52. #include "common/debug.c"
  53. #include "common/entropy_common.c"
  54. #include "common/error_private.c"
  55. #include "common/fse_decompress.c"
  56. #include "common/threading.c"
  57. #include "common/pool.c"
  58. #include "common/zstd_common.c"
  59. #include "compress/fse_compress.c"
  60. #include "compress/hist.c"
  61. #include "compress/huf_compress.c"
  62. #include "compress/zstd_compress_literals.c"
  63. #include "compress/zstd_compress_sequences.c"
  64. #include "compress/zstd_compress_superblock.c"
  65. #include "compress/zstd_compress.c"
  66. #include "compress/zstd_double_fast.c"
  67. #include "compress/zstd_fast.c"
  68. #include "compress/zstd_lazy.c"
  69. #include "compress/zstd_ldm.c"
  70. #include "compress/zstd_opt.c"
  71. #ifdef ZSTD_MULTITHREAD
  72. #include "compress/zstdmt_compress.c"
  73. #endif
  74. #include "decompress/huf_decompress.c"
  75. #include "decompress/zstd_ddict.c"
  76. #include "decompress/zstd_decompress.c"
  77. #include "decompress/zstd_decompress_block.c"
  78. #include "dictBuilder/cover.c"
  79. #include "dictBuilder/divsufsort.c"
  80. #include "dictBuilder/fastcover.c"
  81. #include "dictBuilder/zdict.c"