blob: 9d11b984fa92ed415fea67302ad94c999591aca1 [file] [log] [blame]
Yann Collet32fb4072017-08-18 16:52:05 -07001/*
Elliott Hughes44aba642023-09-12 20:18:59 +00002 * Copyright (c) Meta Platforms, Inc. and affiliates.
Przemyslaw Skibinski91437d82016-11-28 13:25:42 +01003 * All rights reserved.
4 *
Yann Collet32fb4072017-08-18 16:52:05 -07005 * 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).
Yann Collet3128e032017-09-08 00:09:23 -07008 * You may select, at your option, one of the above-listed licenses.
Przemyslaw Skibinski91437d82016-11-28 13:25:42 +01009 */
10
Przemyslaw Skibinskic77befe2016-11-28 14:09:26 +010011
Przemyslaw Skibinski91437d82016-11-28 13:25:42 +010012
13#if ZLIB_VERNUM <= 0x1240
Elliott Hughes44aba642023-09-12 20:18:59 +000014ZEXTERN int ZEXPORT gzclose_r _Z_OF((gzFile file));
15ZEXTERN int ZEXPORT gzclose_w _Z_OF((gzFile file));
16ZEXTERN int ZEXPORT gzbuffer _Z_OF((gzFile file, unsigned size));
17ZEXTERN z_off_t ZEXPORT gzoffset _Z_OF((gzFile file));
Yann Collet32fb4072017-08-18 16:52:05 -070018
Przemyslaw Skibinski91437d82016-11-28 13:25:42 +010019#if !defined(_WIN32) && defined(Z_LARGE64)
20# define z_off64_t off64_t
21#else
22# if defined(_WIN32) && !defined(__GNUC__) && !defined(Z_SOLO)
23# define z_off64_t __int64
24# else
25# define z_off64_t z_off_t
26# endif
27#endif
28#endif
29
30
31#if ZLIB_VERNUM <= 0x1250
32struct gzFile_s {
33 unsigned have;
34 unsigned char *next;
35 z_off64_t pos;
36};
37#endif
38
39
40#if ZLIB_VERNUM <= 0x1270
41#if defined(_WIN32) && !defined(Z_SOLO)
Yann Collet32fb4072017-08-18 16:52:05 -070042# include <stddef.h> /* for wchar_t */
Elliott Hughes44aba642023-09-12 20:18:59 +000043ZEXTERN gzFile ZEXPORT gzopen_w _Z_OF((const wchar_t *path,
Przemyslaw Skibinski91437d82016-11-28 13:25:42 +010044 const char *mode));
45#endif
46#endif
Przemyslaw Skibinskic9512db2017-01-18 12:51:44 +010047
48
49#if ZLIB_VERNUM < 0x12B0
50#ifdef Z_SOLO
51 typedef unsigned long z_size_t;
52#else
53# define z_longlong long long
54# if defined(NO_SIZE_T)
55 typedef unsigned NO_SIZE_T z_size_t;
56# elif defined(STDC)
57# include <stddef.h>
58 typedef size_t z_size_t;
59# else
60 typedef unsigned long z_size_t;
61# endif
62# undef z_longlong
63#endif
Elliott Hughes44aba642023-09-12 20:18:59 +000064ZEXTERN z_size_t ZEXPORT gzfread _Z_OF((voidp buf, z_size_t size, z_size_t nitems,
Przemyslaw Skibinskic9512db2017-01-18 12:51:44 +010065 gzFile file));
Elliott Hughes44aba642023-09-12 20:18:59 +000066ZEXTERN z_size_t ZEXPORT gzfwrite _Z_OF((voidpc buf, z_size_t size,
Przemyslaw Skibinskic9512db2017-01-18 12:51:44 +010067 z_size_t nitems, gzFile file));
68#endif