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