zlib.h (a15cb219c6f2b8ed16179c2fce882a2ff327b753) | zlib.h (cd8822075a38d0734e74b1735e4b5dbef9789170) |
---|---|
1/* zlib.h -- interface of the 'zlib' general purpose compression library | 1/* zlib.h -- interface of the 'zlib' general purpose compression library |
2 version 1.2.11, January 15th, 2017 | 2 version 1.2.12, March 11th, 2022 |
3 | 3 |
4 Copyright (C) 1995-2017 Jean-loup Gailly and Mark Adler | 4 Copyright (C) 1995-2022 Jean-loup Gailly and Mark Adler |
5 6 This software is provided 'as-is', without any express or implied 7 warranty. In no event will the authors be held liable for any damages 8 arising from the use of this software. 9 10 Permission is granted to anyone to use this software for any purpose, 11 including commercial applications, and to alter it and redistribute it 12 freely, subject to the following restrictions: --- 19 unchanged lines hidden (view full) --- 32#define ZLIB_H 33 34#include "zconf.h" 35 36#ifdef __cplusplus 37extern "C" { 38#endif 39 | 5 6 This software is provided 'as-is', without any express or implied 7 warranty. In no event will the authors be held liable for any damages 8 arising from the use of this software. 9 10 Permission is granted to anyone to use this software for any purpose, 11 including commercial applications, and to alter it and redistribute it 12 freely, subject to the following restrictions: --- 19 unchanged lines hidden (view full) --- 32#define ZLIB_H 33 34#include "zconf.h" 35 36#ifdef __cplusplus 37extern "C" { 38#endif 39 |
40#define ZLIB_VERSION "1.2.11" 41#define ZLIB_VERNUM 0x12b0 | 40#define ZLIB_VERSION "1.2.12" 41#define ZLIB_VERNUM 0x12c0 |
42#define ZLIB_VER_MAJOR 1 43#define ZLIB_VER_MINOR 2 | 42#define ZLIB_VER_MAJOR 1 43#define ZLIB_VER_MINOR 2 |
44#define ZLIB_VER_REVISION 11 | 44#define ZLIB_VER_REVISION 12 |
45#define ZLIB_VER_SUBREVISION 0 46 47/* 48 The 'zlib' compression library provides in-memory compression and 49 decompression functions, including integrity checks of the uncompressed data. 50 This version of the library supports only one compression method (deflation) 51 but other algorithms will be added later and will have the same stream 52 interface. --- 485 unchanged lines hidden (view full) --- 538ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm, 539 int level, 540 int method, 541 int windowBits, 542 int memLevel, 543 int strategy)); 544 545 This is another version of deflateInit with more compression options. The | 45#define ZLIB_VER_SUBREVISION 0 46 47/* 48 The 'zlib' compression library provides in-memory compression and 49 decompression functions, including integrity checks of the uncompressed data. 50 This version of the library supports only one compression method (deflation) 51 but other algorithms will be added later and will have the same stream 52 interface. --- 485 unchanged lines hidden (view full) --- 538ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm, 539 int level, 540 int method, 541 int windowBits, 542 int memLevel, 543 int strategy)); 544 545 This is another version of deflateInit with more compression options. The |
546 fields next_in, zalloc, zfree and opaque must be initialized before by the 547 caller. | 546 fields zalloc, zfree and opaque must be initialized before by the caller. |
548 549 The method parameter is the compression method. It must be Z_DEFLATED in 550 this version of the library. 551 552 The windowBits parameter is the base two logarithm of the window size 553 (the size of the history buffer). It should be in the range 8..15 for this 554 version of the library. Larger values of this parameter result in better 555 compression at the expense of memory usage. The default value is 15 if --- 305 unchanged lines hidden (view full) --- 861 most applications, the zlib format should be used as is. Note that comments 862 above on the use in deflateInit2() applies to the magnitude of windowBits. 863 864 windowBits can also be greater than 15 for optional gzip decoding. Add 865 32 to windowBits to enable zlib and gzip decoding with automatic header 866 detection, or add 16 to decode only the gzip format (the zlib format will 867 return a Z_DATA_ERROR). If a gzip stream is being decoded, strm->adler is a 868 CRC-32 instead of an Adler-32. Unlike the gunzip utility and gzread() (see | 547 548 The method parameter is the compression method. It must be Z_DEFLATED in 549 this version of the library. 550 551 The windowBits parameter is the base two logarithm of the window size 552 (the size of the history buffer). It should be in the range 8..15 for this 553 version of the library. Larger values of this parameter result in better 554 compression at the expense of memory usage. The default value is 15 if --- 305 unchanged lines hidden (view full) --- 860 most applications, the zlib format should be used as is. Note that comments 861 above on the use in deflateInit2() applies to the magnitude of windowBits. 862 863 windowBits can also be greater than 15 for optional gzip decoding. Add 864 32 to windowBits to enable zlib and gzip decoding with automatic header 865 detection, or add 16 to decode only the gzip format (the zlib format will 866 return a Z_DATA_ERROR). If a gzip stream is being decoded, strm->adler is a 867 CRC-32 instead of an Adler-32. Unlike the gunzip utility and gzread() (see |
869 below), inflate() will not automatically decode concatenated gzip streams. 870 inflate() will return Z_STREAM_END at the end of the gzip stream. The state 871 would need to be reset to continue decoding a subsequent gzip stream. | 868 below), inflate() will *not* automatically decode concatenated gzip members. 869 inflate() will return Z_STREAM_END at the end of the gzip member. The state 870 would need to be reset to continue decoding a subsequent gzip member. This 871 *must* be done if there is more data after a gzip member, in order for the 872 decompression to be compliant with the gzip standard (RFC 1952). |
872 873 inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough 874 memory, Z_VERSION_ERROR if the zlib library version is incompatible with the 875 version assumed by the caller, or Z_STREAM_ERROR if the parameters are 876 invalid, such as a null pointer to the structure. msg is set to null if 877 there is no error message. inflateInit2 does not perform any decompression 878 apart from possibly reading the zlib header if present: actual decompression 879 will be done by inflate(). (So next_in and avail_in may be modified, but --- 421 unchanged lines hidden (view full) --- 1301 wrapper, documented in RFC 1952, wrapped around a deflate stream. 1302*/ 1303 1304typedef struct gzFile_s *gzFile; /* semi-opaque gzip file descriptor */ 1305 1306/* 1307ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode)); 1308 | 873 874 inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough 875 memory, Z_VERSION_ERROR if the zlib library version is incompatible with the 876 version assumed by the caller, or Z_STREAM_ERROR if the parameters are 877 invalid, such as a null pointer to the structure. msg is set to null if 878 there is no error message. inflateInit2 does not perform any decompression 879 apart from possibly reading the zlib header if present: actual decompression 880 will be done by inflate(). (So next_in and avail_in may be modified, but --- 421 unchanged lines hidden (view full) --- 1302 wrapper, documented in RFC 1952, wrapped around a deflate stream. 1303*/ 1304 1305typedef struct gzFile_s *gzFile; /* semi-opaque gzip file descriptor */ 1306 1307/* 1308ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode)); 1309 |
1309 Opens a gzip (.gz) file for reading or writing. The mode parameter is as 1310 in fopen ("rb" or "wb") but can also include a compression level ("wb9") or 1311 a strategy: 'f' for filtered data as in "wb6f", 'h' for Huffman-only 1312 compression as in "wb1h", 'R' for run-length encoding as in "wb1R", or 'F' 1313 for fixed code compression as in "wb9F". (See the description of 1314 deflateInit2 for more information about the strategy parameter.) 'T' will 1315 request transparent writing or appending with no compression and not using 1316 the gzip format. | 1310 Open the gzip (.gz) file at path for reading and decompressing, or 1311 compressing and writing. The mode parameter is as in fopen ("rb" or "wb") 1312 but can also include a compression level ("wb9") or a strategy: 'f' for 1313 filtered data as in "wb6f", 'h' for Huffman-only compression as in "wb1h", 1314 'R' for run-length encoding as in "wb1R", or 'F' for fixed code compression 1315 as in "wb9F". (See the description of deflateInit2 for more information 1316 about the strategy parameter.) 'T' will request transparent writing or 1317 appending with no compression and not using the gzip format. |
1317 1318 "a" can be used instead of "w" to request that the gzip stream that will 1319 be written be appended to the file. "+" will result in an error, since 1320 reading and writing to the same gzip file is not supported. The addition of 1321 "x" when writing will create the file exclusively, which fails if the file 1322 already exists. On systems that support it, the addition of "e" when 1323 reading or writing will set the flag to close the file on an execve() call. 1324 --- 13 unchanged lines hidden (view full) --- 1338 insufficient memory to allocate the gzFile state, or if an invalid mode was 1339 specified (an 'r', 'w', or 'a' was not provided, or '+' was provided). 1340 errno can be checked to determine if the reason gzopen failed was that the 1341 file could not be opened. 1342*/ 1343 1344ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode)); 1345/* | 1318 1319 "a" can be used instead of "w" to request that the gzip stream that will 1320 be written be appended to the file. "+" will result in an error, since 1321 reading and writing to the same gzip file is not supported. The addition of 1322 "x" when writing will create the file exclusively, which fails if the file 1323 already exists. On systems that support it, the addition of "e" when 1324 reading or writing will set the flag to close the file on an execve() call. 1325 --- 13 unchanged lines hidden (view full) --- 1339 insufficient memory to allocate the gzFile state, or if an invalid mode was 1340 specified (an 'r', 'w', or 'a' was not provided, or '+' was provided). 1341 errno can be checked to determine if the reason gzopen failed was that the 1342 file could not be opened. 1343*/ 1344 1345ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode)); 1346/* |
1346 gzdopen associates a gzFile with the file descriptor fd. File descriptors 1347 are obtained from calls like open, dup, creat, pipe or fileno (if the file 1348 has been previously opened with fopen). The mode parameter is as in gzopen. | 1347 Associate a gzFile with the file descriptor fd. File descriptors are 1348 obtained from calls like open, dup, creat, pipe or fileno (if the file has 1349 been previously opened with fopen). The mode parameter is as in gzopen. |
1349 1350 The next call of gzclose on the returned gzFile will also close the file 1351 descriptor fd, just like fclose(fdopen(fd, mode)) closes the file descriptor 1352 fd. If you want to keep fd open, use fd = dup(fd_keep); gz = gzdopen(fd, 1353 mode);. The duplicated descriptor should be saved to avoid a leak, since 1354 gzdopen does not close fd if it fails. If you are using fileno() to get the 1355 file descriptor from a FILE *, then you will have to use dup() to avoid 1356 double-close()ing the file descriptor. Both gzclose() and fclose() will --- 4 unchanged lines hidden (view full) --- 1361 gzFile state, if an invalid mode was specified (an 'r', 'w', or 'a' was not 1362 provided, or '+' was provided), or if fd is -1. The file descriptor is not 1363 used until the next gz* read, write, seek, or close operation, so gzdopen 1364 will not detect if fd is invalid (unless fd is -1). 1365*/ 1366 1367ZEXTERN int ZEXPORT gzbuffer OF((gzFile file, unsigned size)); 1368/* | 1350 1351 The next call of gzclose on the returned gzFile will also close the file 1352 descriptor fd, just like fclose(fdopen(fd, mode)) closes the file descriptor 1353 fd. If you want to keep fd open, use fd = dup(fd_keep); gz = gzdopen(fd, 1354 mode);. The duplicated descriptor should be saved to avoid a leak, since 1355 gzdopen does not close fd if it fails. If you are using fileno() to get the 1356 file descriptor from a FILE *, then you will have to use dup() to avoid 1357 double-close()ing the file descriptor. Both gzclose() and fclose() will --- 4 unchanged lines hidden (view full) --- 1362 gzFile state, if an invalid mode was specified (an 'r', 'w', or 'a' was not 1363 provided, or '+' was provided), or if fd is -1. The file descriptor is not 1364 used until the next gz* read, write, seek, or close operation, so gzdopen 1365 will not detect if fd is invalid (unless fd is -1). 1366*/ 1367 1368ZEXTERN int ZEXPORT gzbuffer OF((gzFile file, unsigned size)); 1369/* |
1369 Set the internal buffer size used by this library's functions. The 1370 default buffer size is 8192 bytes. This function must be called after 1371 gzopen() or gzdopen(), and before any other calls that read or write the 1372 file. The buffer memory allocation is always deferred to the first read or 1373 write. Three times that size in buffer space is allocated. A larger buffer 1374 size of, for example, 64K or 128K bytes will noticeably increase the speed 1375 of decompression (reading). | 1370 Set the internal buffer size used by this library's functions for file to 1371 size. The default buffer size is 8192 bytes. This function must be called 1372 after gzopen() or gzdopen(), and before any other calls that read or write 1373 the file. The buffer memory allocation is always deferred to the first read 1374 or write. Three times that size in buffer space is allocated. A larger 1375 buffer size of, for example, 64K or 128K bytes will noticeably increase the 1376 speed of decompression (reading). |
1376 1377 The new buffer size also affects the maximum length for gzprintf(). 1378 1379 gzbuffer() returns 0 on success, or -1 on failure, such as being called 1380 too late. 1381*/ 1382 1383ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy)); 1384/* | 1377 1378 The new buffer size also affects the maximum length for gzprintf(). 1379 1380 gzbuffer() returns 0 on success, or -1 on failure, such as being called 1381 too late. 1382*/ 1383 1384ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy)); 1385/* |
1385 Dynamically update the compression level or strategy. See the description 1386 of deflateInit2 for the meaning of these parameters. Previously provided 1387 data is flushed before the parameter change. | 1386 Dynamically update the compression level and strategy for file. See the 1387 description of deflateInit2 for the meaning of these parameters. Previously 1388 provided data is flushed before applying the parameter changes. |
1388 1389 gzsetparams returns Z_OK if success, Z_STREAM_ERROR if the file was not 1390 opened for writing, Z_ERRNO if there is an error writing the flushed data, 1391 or Z_MEM_ERROR if there is a memory allocation error. 1392*/ 1393 1394ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len)); 1395/* | 1389 1390 gzsetparams returns Z_OK if success, Z_STREAM_ERROR if the file was not 1391 opened for writing, Z_ERRNO if there is an error writing the flushed data, 1392 or Z_MEM_ERROR if there is a memory allocation error. 1393*/ 1394 1395ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len)); 1396/* |
1396 Reads the given number of uncompressed bytes from the compressed file. If | 1397 Read and decompress up to len uncompressed bytes from file into buf. If |
1397 the input file is not in gzip format, gzread copies the given number of 1398 bytes into the buffer directly from the file. 1399 1400 After reaching the end of a gzip stream in the input, gzread will continue 1401 to read, looking for another gzip stream. Any number of gzip streams may be 1402 concatenated in the input file, and will all be decompressed by gzread(). 1403 If something other than a gzip stream is encountered after a gzip stream, 1404 that remaining trailing garbage is ignored (and no error is returned). --- 14 unchanged lines hidden (view full) --- 1419 len for end of file, or -1 for error. If len is too large to fit in an int, 1420 then nothing is read, -1 is returned, and the error state is set to 1421 Z_STREAM_ERROR. 1422*/ 1423 1424ZEXTERN z_size_t ZEXPORT gzfread OF((voidp buf, z_size_t size, z_size_t nitems, 1425 gzFile file)); 1426/* | 1398 the input file is not in gzip format, gzread copies the given number of 1399 bytes into the buffer directly from the file. 1400 1401 After reaching the end of a gzip stream in the input, gzread will continue 1402 to read, looking for another gzip stream. Any number of gzip streams may be 1403 concatenated in the input file, and will all be decompressed by gzread(). 1404 If something other than a gzip stream is encountered after a gzip stream, 1405 that remaining trailing garbage is ignored (and no error is returned). --- 14 unchanged lines hidden (view full) --- 1420 len for end of file, or -1 for error. If len is too large to fit in an int, 1421 then nothing is read, -1 is returned, and the error state is set to 1422 Z_STREAM_ERROR. 1423*/ 1424 1425ZEXTERN z_size_t ZEXPORT gzfread OF((voidp buf, z_size_t size, z_size_t nitems, 1426 gzFile file)); 1427/* |
1427 Read up to nitems items of size size from file to buf, otherwise operating 1428 as gzread() does. This duplicates the interface of stdio's fread(), with 1429 size_t request and return types. If the library defines size_t, then 1430 z_size_t is identical to size_t. If not, then z_size_t is an unsigned 1431 integer type that can contain a pointer. | 1428 Read and decompress up to nitems items of size size from file into buf, 1429 otherwise operating as gzread() does. This duplicates the interface of 1430 stdio's fread(), with size_t request and return types. If the library 1431 defines size_t, then z_size_t is identical to size_t. If not, then z_size_t 1432 is an unsigned integer type that can contain a pointer. |
1432 1433 gzfread() returns the number of full items read of size size, or zero if 1434 the end of the file was reached and a full item could not be read, or if 1435 there was an error. gzerror() must be consulted if zero is returned in 1436 order to determine if there was an error. If the multiplication of size and 1437 nitems overflows, i.e. the product does not fit in a z_size_t, then nothing 1438 is read, zero is returned, and the error state is set to Z_STREAM_ERROR. 1439 1440 In the event that the end of file is reached and only a partial item is 1441 available at the end, i.e. the remaining uncompressed data length is not a 1442 multiple of size, then the final partial item is nevetheless read into buf 1443 and the end-of-file flag is set. The length of the partial item read is not 1444 provided, but could be inferred from the result of gztell(). This behavior 1445 is the same as the behavior of fread() implementations in common libraries, 1446 but it prevents the direct use of gzfread() to read a concurrently written 1447 file, reseting and retrying on end-of-file, when size is not 1. 1448*/ 1449 | 1433 1434 gzfread() returns the number of full items read of size size, or zero if 1435 the end of the file was reached and a full item could not be read, or if 1436 there was an error. gzerror() must be consulted if zero is returned in 1437 order to determine if there was an error. If the multiplication of size and 1438 nitems overflows, i.e. the product does not fit in a z_size_t, then nothing 1439 is read, zero is returned, and the error state is set to Z_STREAM_ERROR. 1440 1441 In the event that the end of file is reached and only a partial item is 1442 available at the end, i.e. the remaining uncompressed data length is not a 1443 multiple of size, then the final partial item is nevetheless read into buf 1444 and the end-of-file flag is set. The length of the partial item read is not 1445 provided, but could be inferred from the result of gztell(). This behavior 1446 is the same as the behavior of fread() implementations in common libraries, 1447 but it prevents the direct use of gzfread() to read a concurrently written 1448 file, reseting and retrying on end-of-file, when size is not 1. 1449*/ 1450 |
1450ZEXTERN int ZEXPORT gzwrite OF((gzFile file, 1451 voidpc buf, unsigned len)); | 1451ZEXTERN int ZEXPORT gzwrite OF((gzFile file, voidpc buf, unsigned len)); |
1452/* | 1452/* |
1453 Writes the given number of uncompressed bytes into the compressed file. 1454 gzwrite returns the number of uncompressed bytes written or 0 in case of 1455 error. | 1453 Compress and write the len uncompressed bytes at buf to file. gzwrite 1454 returns the number of uncompressed bytes written or 0 in case of error. |
1456*/ 1457 1458ZEXTERN z_size_t ZEXPORT gzfwrite OF((voidpc buf, z_size_t size, 1459 z_size_t nitems, gzFile file)); 1460/* | 1455*/ 1456 1457ZEXTERN z_size_t ZEXPORT gzfwrite OF((voidpc buf, z_size_t size, 1458 z_size_t nitems, gzFile file)); 1459/* |
1461 gzfwrite() writes nitems items of size size from buf to file, duplicating | 1460 Compress and write nitems items of size size from buf to file, duplicating |
1462 the interface of stdio's fwrite(), with size_t request and return types. If 1463 the library defines size_t, then z_size_t is identical to size_t. If not, 1464 then z_size_t is an unsigned integer type that can contain a pointer. 1465 1466 gzfwrite() returns the number of full items written of size size, or zero 1467 if there was an error. If the multiplication of size and nitems overflows, 1468 i.e. the product does not fit in a z_size_t, then nothing is written, zero 1469 is returned, and the error state is set to Z_STREAM_ERROR. 1470*/ 1471 1472ZEXTERN int ZEXPORTVA gzprintf Z_ARG((gzFile file, const char *format, ...)); 1473/* | 1461 the interface of stdio's fwrite(), with size_t request and return types. If 1462 the library defines size_t, then z_size_t is identical to size_t. If not, 1463 then z_size_t is an unsigned integer type that can contain a pointer. 1464 1465 gzfwrite() returns the number of full items written of size size, or zero 1466 if there was an error. If the multiplication of size and nitems overflows, 1467 i.e. the product does not fit in a z_size_t, then nothing is written, zero 1468 is returned, and the error state is set to Z_STREAM_ERROR. 1469*/ 1470 1471ZEXTERN int ZEXPORTVA gzprintf Z_ARG((gzFile file, const char *format, ...)); 1472/* |
1474 Converts, formats, and writes the arguments to the compressed file under 1475 control of the format string, as in fprintf. gzprintf returns the number of | 1473 Convert, format, compress, and write the arguments (...) to file under 1474 control of the string format, as in fprintf. gzprintf returns the number of |
1476 uncompressed bytes actually written, or a negative zlib error code in case 1477 of error. The number of uncompressed bytes written is limited to 8191, or 1478 one less than the buffer size given to gzbuffer(). The caller should assure 1479 that this limit is not exceeded. If it is exceeded, then gzprintf() will 1480 return an error (0) with nothing written. In this case, there may also be a 1481 buffer overflow with unpredictable consequences, which is possible only if | 1475 uncompressed bytes actually written, or a negative zlib error code in case 1476 of error. The number of uncompressed bytes written is limited to 8191, or 1477 one less than the buffer size given to gzbuffer(). The caller should assure 1478 that this limit is not exceeded. If it is exceeded, then gzprintf() will 1479 return an error (0) with nothing written. In this case, there may also be a 1480 buffer overflow with unpredictable consequences, which is possible only if |
1482 zlib was compiled with the insecure functions sprintf() or vsprintf() | 1481 zlib was compiled with the insecure functions sprintf() or vsprintf(), |
1483 because the secure snprintf() or vsnprintf() functions were not available. 1484 This can be determined using zlibCompileFlags(). 1485*/ 1486 1487ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s)); 1488/* | 1482 because the secure snprintf() or vsnprintf() functions were not available. 1483 This can be determined using zlibCompileFlags(). 1484*/ 1485 1486ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s)); 1487/* |
1489 Writes the given null-terminated string to the compressed file, excluding | 1488 Compress and write the given null-terminated string s to file, excluding |
1490 the terminating null character. 1491 1492 gzputs returns the number of characters written, or -1 in case of error. 1493*/ 1494 1495ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len)); 1496/* | 1489 the terminating null character. 1490 1491 gzputs returns the number of characters written, or -1 in case of error. 1492*/ 1493 1494ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len)); 1495/* |
1497 Reads bytes from the compressed file until len-1 characters are read, or a 1498 newline character is read and transferred to buf, or an end-of-file 1499 condition is encountered. If any characters are read or if len == 1, the 1500 string is terminated with a null character. If no characters are read due 1501 to an end-of-file or len < 1, then the buffer is left untouched. | 1496 Read and decompress bytes from file into buf, until len-1 characters are 1497 read, or until a newline character is read and transferred to buf, or an 1498 end-of-file condition is encountered. If any characters are read or if len 1499 is one, the string is terminated with a null character. If no characters 1500 are read due to an end-of-file or len is less than one, then the buffer is 1501 left untouched. |
1502 1503 gzgets returns buf which is a null-terminated string, or it returns NULL 1504 for end-of-file or in case of error. If there was an error, the contents at 1505 buf are indeterminate. 1506*/ 1507 1508ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c)); 1509/* | 1502 1503 gzgets returns buf which is a null-terminated string, or it returns NULL 1504 for end-of-file or in case of error. If there was an error, the contents at 1505 buf are indeterminate. 1506*/ 1507 1508ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c)); 1509/* |
1510 Writes c, converted to an unsigned char, into the compressed file. gzputc | 1510 Compress and write c, converted to an unsigned char, into file. gzputc |
1511 returns the value that was written, or -1 in case of error. 1512*/ 1513 1514ZEXTERN int ZEXPORT gzgetc OF((gzFile file)); 1515/* | 1511 returns the value that was written, or -1 in case of error. 1512*/ 1513 1514ZEXTERN int ZEXPORT gzgetc OF((gzFile file)); 1515/* |
1516 Reads one byte from the compressed file. gzgetc returns this byte or -1 | 1516 Read and decompress one byte from file. gzgetc returns this byte or -1 |
1517 in case of end of file or error. This is implemented as a macro for speed. 1518 As such, it does not do all of the checking the other functions do. I.e. 1519 it does not check to see if file is NULL, nor whether the structure file 1520 points to has been clobbered or not. 1521*/ 1522 1523ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file)); 1524/* | 1517 in case of end of file or error. This is implemented as a macro for speed. 1518 As such, it does not do all of the checking the other functions do. I.e. 1519 it does not check to see if file is NULL, nor whether the structure file 1520 points to has been clobbered or not. 1521*/ 1522 1523ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file)); 1524/* |
1525 Push one character back onto the stream to be read as the first character 1526 on the next read. At least one character of push-back is allowed. | 1525 Push c back onto the stream for file to be read as the first character on 1526 the next read. At least one character of push-back is always allowed. |
1527 gzungetc() returns the character pushed, or -1 on failure. gzungetc() will 1528 fail if c is -1, and may fail if a character has been pushed but not read 1529 yet. If gzungetc is used immediately after gzopen or gzdopen, at least the 1530 output buffer size of pushed characters is allowed. (See gzbuffer above.) 1531 The pushed character will be discarded if the stream is repositioned with 1532 gzseek() or gzrewind(). 1533*/ 1534 1535ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush)); 1536/* | 1527 gzungetc() returns the character pushed, or -1 on failure. gzungetc() will 1528 fail if c is -1, and may fail if a character has been pushed but not read 1529 yet. If gzungetc is used immediately after gzopen or gzdopen, at least the 1530 output buffer size of pushed characters is allowed. (See gzbuffer above.) 1531 The pushed character will be discarded if the stream is repositioned with 1532 gzseek() or gzrewind(). 1533*/ 1534 1535ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush)); 1536/* |
1537 Flushes all pending output into the compressed file. The parameter flush 1538 is as in the deflate() function. The return value is the zlib error number 1539 (see function gzerror below). gzflush is only permitted when writing. | 1537 Flush all pending output to file. The parameter flush is as in the 1538 deflate() function. The return value is the zlib error number (see function 1539 gzerror below). gzflush is only permitted when writing. |
1540 1541 If the flush parameter is Z_FINISH, the remaining data is written and the 1542 gzip stream is completed in the output. If gzwrite() is called again, a new 1543 gzip stream will be started in the output. gzread() is able to read such 1544 concatenated gzip streams. 1545 1546 gzflush should be called only when strictly necessary because it will 1547 degrade compression if called too often. 1548*/ 1549 1550/* 1551ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file, 1552 z_off_t offset, int whence)); 1553 | 1540 1541 If the flush parameter is Z_FINISH, the remaining data is written and the 1542 gzip stream is completed in the output. If gzwrite() is called again, a new 1543 gzip stream will be started in the output. gzread() is able to read such 1544 concatenated gzip streams. 1545 1546 gzflush should be called only when strictly necessary because it will 1547 degrade compression if called too often. 1548*/ 1549 1550/* 1551ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file, 1552 z_off_t offset, int whence)); 1553 |
1554 Sets the starting position for the next gzread or gzwrite on the given 1555 compressed file. The offset represents a number of bytes in the | 1554 Set the starting position to offset relative to whence for the next gzread 1555 or gzwrite on file. The offset represents a number of bytes in the |
1556 uncompressed data stream. The whence parameter is defined as in lseek(2); 1557 the value SEEK_END is not supported. 1558 1559 If the file is opened for reading, this function is emulated but can be 1560 extremely slow. If the file is opened for writing, only forward seeks are 1561 supported; gzseek then compresses a sequence of zeroes up to the new 1562 starting position. 1563 1564 gzseek returns the resulting offset location as measured in bytes from 1565 the beginning of the uncompressed stream, or -1 in case of error, in 1566 particular if the file is opened for writing and the new starting position 1567 would be before the current position. 1568*/ 1569 1570ZEXTERN int ZEXPORT gzrewind OF((gzFile file)); 1571/* | 1556 uncompressed data stream. The whence parameter is defined as in lseek(2); 1557 the value SEEK_END is not supported. 1558 1559 If the file is opened for reading, this function is emulated but can be 1560 extremely slow. If the file is opened for writing, only forward seeks are 1561 supported; gzseek then compresses a sequence of zeroes up to the new 1562 starting position. 1563 1564 gzseek returns the resulting offset location as measured in bytes from 1565 the beginning of the uncompressed stream, or -1 in case of error, in 1566 particular if the file is opened for writing and the new starting position 1567 would be before the current position. 1568*/ 1569 1570ZEXTERN int ZEXPORT gzrewind OF((gzFile file)); 1571/* |
1572 Rewinds the given file. This function is supported only for reading. | 1572 Rewind file. This function is supported only for reading. |
1573 | 1573 |
1574 gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET) | 1574 gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET). |
1575*/ 1576 1577/* 1578ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file)); 1579 | 1575*/ 1576 1577/* 1578ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file)); 1579 |
1580 Returns the starting position for the next gzread or gzwrite on the given 1581 compressed file. This position represents a number of bytes in the 1582 uncompressed data stream, and is zero when starting, even if appending or 1583 reading a gzip stream from the middle of a file using gzdopen(). | 1580 Return the starting position for the next gzread or gzwrite on file. 1581 This position represents a number of bytes in the uncompressed data stream, 1582 and is zero when starting, even if appending or reading a gzip stream from 1583 the middle of a file using gzdopen(). |
1584 1585 gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR) 1586*/ 1587 1588/* 1589ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile file)); 1590 | 1584 1585 gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR) 1586*/ 1587 1588/* 1589ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile file)); 1590 |
1591 Returns the current offset in the file being read or written. This offset 1592 includes the count of bytes that precede the gzip stream, for example when 1593 appending or when using gzdopen() for reading. When reading, the offset 1594 does not include as yet unused buffered input. This information can be used 1595 for a progress indicator. On error, gzoffset() returns -1. | 1591 Return the current compressed (actual) read or write offset of file. This 1592 offset includes the count of bytes that precede the gzip stream, for example 1593 when appending or when using gzdopen() for reading. When reading, the 1594 offset does not include as yet unused buffered input. This information can 1595 be used for a progress indicator. On error, gzoffset() returns -1. |
1596*/ 1597 1598ZEXTERN int ZEXPORT gzeof OF((gzFile file)); 1599/* | 1596*/ 1597 1598ZEXTERN int ZEXPORT gzeof OF((gzFile file)); 1599/* |
1600 Returns true (1) if the end-of-file indicator has been set while reading, 1601 false (0) otherwise. Note that the end-of-file indicator is set only if the 1602 read tried to go past the end of the input, but came up short. Therefore, 1603 just like feof(), gzeof() may return false even if there is no more data to 1604 read, in the event that the last read request was for the exact number of 1605 bytes remaining in the input file. This will happen if the input file size 1606 is an exact multiple of the buffer size. | 1600 Return true (1) if the end-of-file indicator for file has been set while 1601 reading, false (0) otherwise. Note that the end-of-file indicator is set 1602 only if the read tried to go past the end of the input, but came up short. 1603 Therefore, just like feof(), gzeof() may return false even if there is no 1604 more data to read, in the event that the last read request was for the exact 1605 number of bytes remaining in the input file. This will happen if the input 1606 file size is an exact multiple of the buffer size. |
1607 1608 If gzeof() returns true, then the read functions will return no more data, 1609 unless the end-of-file indicator is reset by gzclearerr() and the input file 1610 has grown since the previous end of file was detected. 1611*/ 1612 1613ZEXTERN int ZEXPORT gzdirect OF((gzFile file)); 1614/* | 1607 1608 If gzeof() returns true, then the read functions will return no more data, 1609 unless the end-of-file indicator is reset by gzclearerr() and the input file 1610 has grown since the previous end of file was detected. 1611*/ 1612 1613ZEXTERN int ZEXPORT gzdirect OF((gzFile file)); 1614/* |
1615 Returns true (1) if file is being copied directly while reading, or false | 1615 Return true (1) if file is being copied directly while reading, or false |
1616 (0) if file is a gzip stream being decompressed. 1617 1618 If the input file is empty, gzdirect() will return true, since the input 1619 does not contain a gzip stream. 1620 1621 If gzdirect() is used immediately after gzopen() or gzdopen() it will 1622 cause buffers to be allocated to allow reading the file to determine if it 1623 is a gzip file. Therefore if gzbuffer() is used, it should be called before --- 4 unchanged lines hidden (view full) --- 1628 gzdirect() is not needed when writing. Transparent writing must be 1629 explicitly requested, so the application already knows the answer. When 1630 linking statically, using gzdirect() will include all of the zlib code for 1631 gzip file reading and decompression, which may not be desired.) 1632*/ 1633 1634ZEXTERN int ZEXPORT gzclose OF((gzFile file)); 1635/* | 1616 (0) if file is a gzip stream being decompressed. 1617 1618 If the input file is empty, gzdirect() will return true, since the input 1619 does not contain a gzip stream. 1620 1621 If gzdirect() is used immediately after gzopen() or gzdopen() it will 1622 cause buffers to be allocated to allow reading the file to determine if it 1623 is a gzip file. Therefore if gzbuffer() is used, it should be called before --- 4 unchanged lines hidden (view full) --- 1628 gzdirect() is not needed when writing. Transparent writing must be 1629 explicitly requested, so the application already knows the answer. When 1630 linking statically, using gzdirect() will include all of the zlib code for 1631 gzip file reading and decompression, which may not be desired.) 1632*/ 1633 1634ZEXTERN int ZEXPORT gzclose OF((gzFile file)); 1635/* |
1636 Flushes all pending output if necessary, closes the compressed file and 1637 deallocates the (de)compression state. Note that once file is closed, you | 1636 Flush all pending output for file, if necessary, close file and 1637 deallocate the (de)compression state. Note that once file is closed, you |
1638 cannot call gzerror with file, since its structures have been deallocated. 1639 gzclose must not be called more than once on the same file, just as free 1640 must not be called more than once on the same allocation. 1641 1642 gzclose will return Z_STREAM_ERROR if file is not valid, Z_ERRNO on a 1643 file operation error, Z_MEM_ERROR if out of memory, Z_BUF_ERROR if the 1644 last read ended in the middle of a gzip stream, or Z_OK on success. 1645*/ --- 7 unchanged lines hidden (view full) --- 1653 compression or decompression code that is not used when only reading or only 1654 writing respectively. If gzclose() is used, then both compression and 1655 decompression code will be included the application when linking to a static 1656 zlib library. 1657*/ 1658 1659ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum)); 1660/* | 1638 cannot call gzerror with file, since its structures have been deallocated. 1639 gzclose must not be called more than once on the same file, just as free 1640 must not be called more than once on the same allocation. 1641 1642 gzclose will return Z_STREAM_ERROR if file is not valid, Z_ERRNO on a 1643 file operation error, Z_MEM_ERROR if out of memory, Z_BUF_ERROR if the 1644 last read ended in the middle of a gzip stream, or Z_OK on success. 1645*/ --- 7 unchanged lines hidden (view full) --- 1653 compression or decompression code that is not used when only reading or only 1654 writing respectively. If gzclose() is used, then both compression and 1655 decompression code will be included the application when linking to a static 1656 zlib library. 1657*/ 1658 1659ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum)); 1660/* |
1661 Returns the error message for the last error which occurred on the given 1662 compressed file. errnum is set to zlib error number. If an error occurred 1663 in the file system and not in the compression library, errnum is set to 1664 Z_ERRNO and the application may consult errno to get the exact error code. | 1661 Return the error message for the last error which occurred on file. 1662 errnum is set to zlib error number. If an error occurred in the file system 1663 and not in the compression library, errnum is set to Z_ERRNO and the 1664 application may consult errno to get the exact error code. |
1665 1666 The application must not modify the returned string. Future calls to 1667 this function may invalidate the previously returned string. If file is 1668 closed, then the string previously returned by gzerror will no longer be 1669 available. 1670 1671 gzerror() should be used to distinguish errors from end-of-file for those 1672 functions above that do not distinguish those cases in their return values. 1673*/ 1674 1675ZEXTERN void ZEXPORT gzclearerr OF((gzFile file)); 1676/* | 1665 1666 The application must not modify the returned string. Future calls to 1667 this function may invalidate the previously returned string. If file is 1668 closed, then the string previously returned by gzerror will no longer be 1669 available. 1670 1671 gzerror() should be used to distinguish errors from end-of-file for those 1672 functions above that do not distinguish those cases in their return values. 1673*/ 1674 1675ZEXTERN void ZEXPORT gzclearerr OF((gzFile file)); 1676/* |
1677 Clears the error and end-of-file flags for file. This is analogous to the | 1677 Clear the error and end-of-file flags for file. This is analogous to the |
1678 clearerr() function in stdio. This is useful for continuing to read a gzip 1679 file that is being written concurrently. 1680*/ 1681 1682#endif /* !Z_SOLO */ 1683 1684 /* checksum functions */ 1685 1686/* 1687 These functions are not related to compression but are exported 1688 anyway because they might be useful in applications using the compression 1689 library. 1690*/ 1691 1692ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len)); 1693/* 1694 Update a running Adler-32 checksum with the bytes buf[0..len-1] and | 1678 clearerr() function in stdio. This is useful for continuing to read a gzip 1679 file that is being written concurrently. 1680*/ 1681 1682#endif /* !Z_SOLO */ 1683 1684 /* checksum functions */ 1685 1686/* 1687 These functions are not related to compression but are exported 1688 anyway because they might be useful in applications using the compression 1689 library. 1690*/ 1691 1692ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len)); 1693/* 1694 Update a running Adler-32 checksum with the bytes buf[0..len-1] and |
1695 return the updated checksum. If buf is Z_NULL, this function returns the 1696 required initial value for the checksum. | 1695 return the updated checksum. An Adler-32 value is in the range of a 32-bit 1696 unsigned integer. If buf is Z_NULL, this function returns the required 1697 initial value for the checksum. |
1697 1698 An Adler-32 checksum is almost as reliable as a CRC-32 but can be computed 1699 much faster. 1700 1701 Usage example: 1702 1703 uLong adler = adler32(0L, Z_NULL, 0); 1704 --- 16 unchanged lines hidden (view full) --- 1721 Combine two Adler-32 checksums into one. For two sequences of bytes, seq1 1722 and seq2 with lengths len1 and len2, Adler-32 checksums were calculated for 1723 each, adler1 and adler2. adler32_combine() returns the Adler-32 checksum of 1724 seq1 and seq2 concatenated, requiring only adler1, adler2, and len2. Note 1725 that the z_off_t type (like off_t) is a signed integer. If len2 is 1726 negative, the result has no meaning or utility. 1727*/ 1728 | 1698 1699 An Adler-32 checksum is almost as reliable as a CRC-32 but can be computed 1700 much faster. 1701 1702 Usage example: 1703 1704 uLong adler = adler32(0L, Z_NULL, 0); 1705 --- 16 unchanged lines hidden (view full) --- 1722 Combine two Adler-32 checksums into one. For two sequences of bytes, seq1 1723 and seq2 with lengths len1 and len2, Adler-32 checksums were calculated for 1724 each, adler1 and adler2. adler32_combine() returns the Adler-32 checksum of 1725 seq1 and seq2 concatenated, requiring only adler1, adler2, and len2. Note 1726 that the z_off_t type (like off_t) is a signed integer. If len2 is 1727 negative, the result has no meaning or utility. 1728*/ 1729 |
1729ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len)); | 1730ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len)); |
1730/* 1731 Update a running CRC-32 with the bytes buf[0..len-1] and return the | 1731/* 1732 Update a running CRC-32 with the bytes buf[0..len-1] and return the |
1732 updated CRC-32. If buf is Z_NULL, this function returns the required 1733 initial value for the crc. Pre- and post-conditioning (one's complement) is 1734 performed within this function so it shouldn't be done by the application. | 1733 updated CRC-32. A CRC-32 value is in the range of a 32-bit unsigned integer. 1734 If buf is Z_NULL, this function returns the required initial value for the 1735 crc. Pre- and post-conditioning (one's complement) is performed within this 1736 function so it shouldn't be done by the application. |
1735 1736 Usage example: 1737 1738 uLong crc = crc32(0L, Z_NULL, 0); 1739 1740 while (read_buffer(buffer, length) != EOF) { 1741 crc = crc32(crc, buffer, length); 1742 } 1743 if (crc != original_crc) error(); 1744*/ 1745 | 1737 1738 Usage example: 1739 1740 uLong crc = crc32(0L, Z_NULL, 0); 1741 1742 while (read_buffer(buffer, length) != EOF) { 1743 crc = crc32(crc, buffer, length); 1744 } 1745 if (crc != original_crc) error(); 1746*/ 1747 |
1746ZEXTERN uLong ZEXPORT crc32_z OF((uLong adler, const Bytef *buf, | 1748ZEXTERN uLong ZEXPORT crc32_z OF((uLong crc, const Bytef *buf, |
1747 z_size_t len)); 1748/* 1749 Same as crc32(), but with a size_t length. 1750*/ 1751 1752/* 1753ZEXTERN uLong ZEXPORT crc32_combine OF((uLong crc1, uLong crc2, z_off_t len2)); 1754 1755 Combine two CRC-32 check values into one. For two sequences of bytes, 1756 seq1 and seq2 with lengths len1 and len2, CRC-32 check values were 1757 calculated for each, crc1 and crc2. crc32_combine() returns the CRC-32 1758 check value of seq1 and seq2 concatenated, requiring only crc1, crc2, and 1759 len2. 1760*/ 1761 | 1749 z_size_t len)); 1750/* 1751 Same as crc32(), but with a size_t length. 1752*/ 1753 1754/* 1755ZEXTERN uLong ZEXPORT crc32_combine OF((uLong crc1, uLong crc2, z_off_t len2)); 1756 1757 Combine two CRC-32 check values into one. For two sequences of bytes, 1758 seq1 and seq2 with lengths len1 and len2, CRC-32 check values were 1759 calculated for each, crc1 and crc2. crc32_combine() returns the CRC-32 1760 check value of seq1 and seq2 concatenated, requiring only crc1, crc2, and 1761 len2. 1762*/ 1763 |
1764/* 1765ZEXTERN uLong ZEXPORT crc32_combine_gen OF((z_off_t len2)); |
|
1762 | 1766 |
1767 Return the operator corresponding to length len2, to be used with 1768 crc32_combine_op(). 1769*/ 1770 1771ZEXTERN uLong ZEXPORT crc32_combine_op OF((uLong crc1, uLong crc2, uLong op)); 1772/* 1773 Give the same result as crc32_combine(), using op in place of len2. op is 1774 is generated from len2 by crc32_combine_gen(). This will be faster than 1775 crc32_combine() if the generated op is used more than once. 1776*/ 1777 1778 1779ZEXTERN uLong ZEXPORT crc32_combine_gen64 OF((z_off64_t)); 1780 |
|
1763 /* various hacks, don't look :) */ 1764 1765/* deflateInit and inflateInit are macros to allow checking the zlib version 1766 * and the compiler's view of z_stream: 1767 */ 1768ZEXTERN int ZEXPORT deflateInit_ OF((z_streamp strm, int level, 1769 const char *version, int stream_size)); 1770ZEXTERN int ZEXPORT inflateInit_ OF((z_streamp strm, --- 80 unchanged lines hidden (view full) --- 1851#if !defined(ZLIB_INTERNAL) && defined(Z_WANT64) 1852# ifdef Z_PREFIX_SET 1853# define z_gzopen z_gzopen64 1854# define z_gzseek z_gzseek64 1855# define z_gztell z_gztell64 1856# define z_gzoffset z_gzoffset64 1857# define z_adler32_combine z_adler32_combine64 1858# define z_crc32_combine z_crc32_combine64 | 1781 /* various hacks, don't look :) */ 1782 1783/* deflateInit and inflateInit are macros to allow checking the zlib version 1784 * and the compiler's view of z_stream: 1785 */ 1786ZEXTERN int ZEXPORT deflateInit_ OF((z_streamp strm, int level, 1787 const char *version, int stream_size)); 1788ZEXTERN int ZEXPORT inflateInit_ OF((z_streamp strm, --- 80 unchanged lines hidden (view full) --- 1869#if !defined(ZLIB_INTERNAL) && defined(Z_WANT64) 1870# ifdef Z_PREFIX_SET 1871# define z_gzopen z_gzopen64 1872# define z_gzseek z_gzseek64 1873# define z_gztell z_gztell64 1874# define z_gzoffset z_gzoffset64 1875# define z_adler32_combine z_adler32_combine64 1876# define z_crc32_combine z_crc32_combine64 |
1877# define z_crc32_combine_gen z_crc32_combine_gen64 |
|
1859# else 1860# define gzopen gzopen64 1861# define gzseek gzseek64 1862# define gztell gztell64 1863# define gzoffset gzoffset64 1864# define adler32_combine adler32_combine64 1865# define crc32_combine crc32_combine64 | 1878# else 1879# define gzopen gzopen64 1880# define gzseek gzseek64 1881# define gztell gztell64 1882# define gzoffset gzoffset64 1883# define adler32_combine adler32_combine64 1884# define crc32_combine crc32_combine64 |
1885# define crc32_combine_gen crc32_combine_gen64 |
|
1866# endif 1867# ifndef Z_LARGE64 1868 ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *)); 1869 ZEXTERN z_off_t ZEXPORT gzseek64 OF((gzFile, z_off_t, int)); 1870 ZEXTERN z_off_t ZEXPORT gztell64 OF((gzFile)); 1871 ZEXTERN z_off_t ZEXPORT gzoffset64 OF((gzFile)); 1872 ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t)); 1873 ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t)); 1874# endif 1875#else 1876 ZEXTERN gzFile ZEXPORT gzopen OF((const char *, const char *)); 1877 ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile, z_off_t, int)); 1878 ZEXTERN z_off_t ZEXPORT gztell OF((gzFile)); 1879 ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile)); 1880 ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t)); 1881 ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t)); | 1886# endif 1887# ifndef Z_LARGE64 1888 ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *)); 1889 ZEXTERN z_off_t ZEXPORT gzseek64 OF((gzFile, z_off_t, int)); 1890 ZEXTERN z_off_t ZEXPORT gztell64 OF((gzFile)); 1891 ZEXTERN z_off_t ZEXPORT gzoffset64 OF((gzFile)); 1892 ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t)); 1893 ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t)); 1894# endif 1895#else 1896 ZEXTERN gzFile ZEXPORT gzopen OF((const char *, const char *)); 1897 ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile, z_off_t, int)); 1898 ZEXTERN z_off_t ZEXPORT gztell OF((gzFile)); 1899 ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile)); 1900 ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t)); 1901 ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t)); |
1902 ZEXTERN uLong ZEXPORT crc32_combine_gen OF((z_off_t)); |
|
1882#endif 1883 1884#else /* Z_SOLO */ 1885 1886 ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t)); 1887 ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t)); | 1903#endif 1904 1905#else /* Z_SOLO */ 1906 1907 ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t)); 1908 ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t)); |
1909 ZEXTERN uLong ZEXPORT crc32_combine_gen OF((z_off_t)); |
|
1888 1889#endif /* !Z_SOLO */ 1890 1891/* undocumented functions */ 1892ZEXTERN const char * ZEXPORT zError OF((int)); 1893ZEXTERN int ZEXPORT inflateSyncPoint OF((z_streamp)); 1894ZEXTERN const z_crc_t FAR * ZEXPORT get_crc_table OF((void)); 1895ZEXTERN int ZEXPORT inflateUndermine OF((z_streamp, int)); 1896ZEXTERN int ZEXPORT inflateValidate OF((z_streamp, int)); 1897ZEXTERN unsigned long ZEXPORT inflateCodesUsed OF ((z_streamp)); 1898ZEXTERN int ZEXPORT inflateResetKeep OF((z_streamp)); 1899ZEXTERN int ZEXPORT deflateResetKeep OF((z_streamp)); | 1910 1911#endif /* !Z_SOLO */ 1912 1913/* undocumented functions */ 1914ZEXTERN const char * ZEXPORT zError OF((int)); 1915ZEXTERN int ZEXPORT inflateSyncPoint OF((z_streamp)); 1916ZEXTERN const z_crc_t FAR * ZEXPORT get_crc_table OF((void)); 1917ZEXTERN int ZEXPORT inflateUndermine OF((z_streamp, int)); 1918ZEXTERN int ZEXPORT inflateValidate OF((z_streamp, int)); 1919ZEXTERN unsigned long ZEXPORT inflateCodesUsed OF ((z_streamp)); 1920ZEXTERN int ZEXPORT inflateResetKeep OF((z_streamp)); 1921ZEXTERN int ZEXPORT deflateResetKeep OF((z_streamp)); |
1900#if (defined(_WIN32) || defined(__CYGWIN__)) && !defined(Z_SOLO) | 1922#if defined(_WIN32) && !defined(Z_SOLO) |
1901ZEXTERN gzFile ZEXPORT gzopen_w OF((const wchar_t *path, 1902 const char *mode)); 1903#endif 1904#if defined(STDC) || defined(Z_HAVE_STDARG_H) 1905# ifndef Z_SOLO 1906ZEXTERN int ZEXPORTVA gzvprintf Z_ARG((gzFile file, 1907 const char *format, 1908 va_list va)); 1909# endif 1910#endif 1911 1912#ifdef __cplusplus 1913} 1914#endif 1915 1916#endif /* ZLIB_H */ | 1923ZEXTERN gzFile ZEXPORT gzopen_w OF((const wchar_t *path, 1924 const char *mode)); 1925#endif 1926#if defined(STDC) || defined(Z_HAVE_STDARG_H) 1927# ifndef Z_SOLO 1928ZEXTERN int ZEXPORTVA gzvprintf Z_ARG((gzFile file, 1929 const char *format, 1930 va_list va)); 1931# endif 1932#endif 1933 1934#ifdef __cplusplus 1935} 1936#endif 1937 1938#endif /* ZLIB_H */ |