gzcompatibility.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /*
  2. * Copyright (c) 2016-2021, Przemyslaw Skibinski, Yann Collet, Facebook, Inc.
  3. * All rights reserved.
  4. *
  5. * This source code is licensed under both the BSD-style license (found in the
  6. * LICENSE file in the root directory of this source tree) and the GPLv2 (found
  7. * in the COPYING file in the root directory of this source tree).
  8. * You may select, at your option, one of the above-listed licenses.
  9. */
  10. #if ZLIB_VERNUM <= 0x1240
  11. ZEXTERN int ZEXPORT gzclose_r OF((gzFile file));
  12. ZEXTERN int ZEXPORT gzclose_w OF((gzFile file));
  13. ZEXTERN int ZEXPORT gzbuffer OF((gzFile file, unsigned size));
  14. ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile file));
  15. #if !defined(_WIN32) && defined(Z_LARGE64)
  16. # define z_off64_t off64_t
  17. #else
  18. # if defined(_WIN32) && !defined(__GNUC__) && !defined(Z_SOLO)
  19. # define z_off64_t __int64
  20. # else
  21. # define z_off64_t z_off_t
  22. # endif
  23. #endif
  24. #endif
  25. #if ZLIB_VERNUM <= 0x1250
  26. struct gzFile_s {
  27. unsigned have;
  28. unsigned char *next;
  29. z_off64_t pos;
  30. };
  31. #endif
  32. #if ZLIB_VERNUM <= 0x1270
  33. #if defined(_WIN32) && !defined(Z_SOLO)
  34. # include <stddef.h> /* for wchar_t */
  35. ZEXTERN gzFile ZEXPORT gzopen_w OF((const wchar_t *path,
  36. const char *mode));
  37. #endif
  38. #endif
  39. #if ZLIB_VERNUM < 0x12B0
  40. #ifdef Z_SOLO
  41. typedef unsigned long z_size_t;
  42. #else
  43. # define z_longlong long long
  44. # if defined(NO_SIZE_T)
  45. typedef unsigned NO_SIZE_T z_size_t;
  46. # elif defined(STDC)
  47. # include <stddef.h>
  48. typedef size_t z_size_t;
  49. # else
  50. typedef unsigned long z_size_t;
  51. # endif
  52. # undef z_longlong
  53. #endif
  54. ZEXTERN z_size_t ZEXPORT gzfread OF((voidp buf, z_size_t size, z_size_t nitems,
  55. gzFile file));
  56. ZEXTERN z_size_t ZEXPORT gzfwrite OF((voidpc buf, z_size_t size,
  57. z_size_t nitems, gzFile file));
  58. #endif