summaryrefslogtreecommitdiff
path: root/gzlib.c
AgeCommit message (Collapse)Author
2020-09-16Move gzclose() to gzlib.c. Modern linkers should be smart enough to link it ↵Nathan Moinvaziri
in only if it is used.
2020-09-14Allocate gzlib/gzread/gzwrite structs and in/out buffers using zng_allocHans Kristian Rosbach
instead of malloc, this also enforces data alignment.
2020-08-31Rename ZEXPORT and ZEXTERN for consistency.Nathan Moinvaziri
2020-08-31Rename ZLIB_INTERNAL to Z_INTERNAL for consistency.Nathan Moinvaziri
2020-06-20Fixed casting warningsPavel P
2020-06-16Remove Borland C++ compiler referencesDon
There are a few guards checking for Borland C++ 5.0 or greater which was released in 1996. While there is still a descendent of this compiler in Embarcadero C++ Builder its value for __BORLANDC__ is greater than 0x500 so it is safe to remove these guards.
2020-06-08For gzseek, gzoffset, gzopen, adler32_combine, crc32_combine and ↵Nathan Moinvaziri
crc32_combine_gen, export 32-bit and 64-bit versions for zlib-compatible api and only 64-bit version (without 64 suffix) for zlib-ng native api.
2020-06-08Clean up windows defines, use _WIN32Pavel P
+ replaced WIN32 with _WIN32 + removed unused WINDOWS/_WINDOWS defines + no need to test for __MINGW__, as _WIN32 is also defined
2019-10-22Avoid adding empty gzip member after gzflush with Z_FINISH.Mark Adler
2019-01-15Avoid a conversion error in gzseek when off_t type too small.Mark Adler
This is a problem in the odd case that the second argument of LSEEK is a larger type than off_t. Apparently MinGW defines off_t to be 32 bits, but _lseeki64 has a 64-bit second argument. Also undo a previous commit to permit MinGW to use _lseeki64.
2018-03-22Move private defines from zconf.h and zconf-ng.h to zbuild.hMika Lindqvist
* move definition of z_size_t to zbuild.h
2018-01-31Adapt code to support PREFIX macros and update build scriptsMika Lindqvist
2018-01-31Add function prefix (zng_) to all exported functions to allow zlib-ngHans Kristian Rosbach
to co-exist in an application that has been linked to something that depends on stock zlib. Previously, that would cause random problems since there is no way to guarantee what zlib version is being used for each dynamically linked function. Add the corresponding zlib-ng.h. Tests, example and minigzip will not compile before they have been adapted to use the correct functions as well. Either duplicate them, so we have minigzip-ng.c for example, or add compile-time detection in the source code.
2017-02-25Type cleanup...Mika Lindqvist
* gz_statep -> gz_state *
2017-02-13zlib 1.2.11Mark Adler
2017-02-09Avoid warnings on snprintf() return value.Mark Adler
2017-02-09zlib 1.2.9Mark Adler
2017-02-06Clean up gz* function return values.Mark Adler
In some cases the return values did not match the documentation, or the documentation did not document all of the return values. gzprintf() now consistently returns negative values on error, which matches the behavior of the stdio fprintf() function.
2017-01-30local -> staticMika Lindqvist
* local -> static * Normalize and cleanup line-endings * Fix warnings under Visual Studio. * Whitespace cleanup *** This patch has been edited to merge cleanly and to exclude type changes. Based on 8d7a7c3b82c6e38734bd504dac800b148ab410d0 "Type Cleanup"
2016-04-26Fix gzseek() problem on MinGW due to buggy _lseeki64 there.Mark Adler
2015-12-14Type cleanup.Mika Lindqvist
2015-11-25Fix creating shared library under MSYS64.Mika Lindqvist
2015-11-03Compile the gzopen_w() function when __CYGWIN__ defined.Mark Adler
Conflicts: gzlib.c zlib.h
2015-11-03Assure that gzoffset() is correct when appending.Mark Adler
An open() with O_APPEND followed by an lseek() to determine the position will return zero for a non-empty file, even though the next write will start at the end of the file. This commit works around that by doing an lseek() to the end when appending.
2015-11-03Improve speed of gzprintf() in transparent mode.Mark Adler
A few minor modifications done to help with conflicts.
2015-05-25Style cleanup for gzfile codeHans Kristian Rosbach
2015-05-12Convert remaining K&R function declarations to ANSI-C declarations.Hans Kristian Rosbach
2015-05-12Enable gzopen_w for CygwinMika Lindqvist
2015-05-11Remove UNDER_CE: Windows CE is old.Daniel Axtens
Signed-off-by: Daniel Axtens <dja@axtens.net>
2015-05-07Fix building under Cygwin.Mika Lindqvist
2014-10-18Rewrite K&R-style function prototypes to ANSI-C-style.hansr
Only internal functions, no exported functions in this commit.
2014-10-12Remove workarounds for non-ANSI-C compatible compilers (Part 2)hansr
-Removing usage of OF() definition
2014-10-12Remove workarounds for non-ANSI-C compatible compilers (Part 1)hansr
2013-03-24zlib 1.2.7.1Mark Adler
2013-03-24Add casts and consts to ease user conversion to C++.Mark Adler
You would still need to run zlib2ansi on all of the *.c files.
2012-08-13Clean up the usage of z_const and respect const usage within zlib.Mark Adler
This patch allows zlib to compile cleanly with the -Wcast-qual gcc warning enabled, but only if ZLIB_CONST is defined, which adds const to next_in and msg in z_stream and in the in_func prototype. A --const option is added to ./configure which adds -DZLIB_CONST to the compile flags, and adds -Wcast-qual to the compile flags when ZLIBGCCWARN is set in the environment.
2012-05-22Fix bug in 'F' mode for gzopen().Mark Adler
2012-05-02Replace use of unsafe string functions with snprintf if available.Mark Adler
This avoids warnings in OpenBSD that apparently can't be turned off whenever you link strcpy, strcat, or sprintf. When snprintf isn't available, the use of the "unsafe" string functions has always in fact been safe, since the lengths are all checked before those functions are called. We do not use strlcpy or strlcat, since they are not (yet) found on all systems. snprintf on the other hand is part of the C standard library and is very common.
2012-03-18Attempt to convert the wchar_t path in gzopen_w() for errors.Mark Adler
The conversion to multi-byte will be locale-specific, but it's better than nothing and is only to provide more information in the error message returned by gz_error(). The conversion has no effect on what's opened.
2012-03-18Fix syntax error in gzlib.c.Mark Adler
2012-03-18More fixes for gzopen_w().Mark Adler
Also need to #include <stddef.h> for zlib.h, and need to workaround the inability to use wide characters in constructed error messages with zlib's interface.
2012-03-17Fix gzopen_w() type and add #include for the type.Mark Adler
2012-03-16Add gzopen_w() in Windows for wide character path names.Mark Adler
2012-03-10Update copyright years in gzlib.c.Mark Adler
2012-03-10Avoid warnings when O_CLOEXEC or O_EXCL are not defined.Mark Adler
2012-03-04Make sure that O_EXCL is used portably.Mark Adler
2012-03-03Add "x" (O_EXCL) and "e" (O_CLOEXEC) modes support to gzopen().Mark Adler
2011-12-18Do not use _lseeki64 under Borland C++ [Truta].Mark Adler
2011-12-11Fix gzeof() to behave just like feof() when read is not past end of file.Mark Adler
Before, gzeof() would return true (accurately) when the last read request went just up to the end of the uncompressed data. In the analogous case, feof() would return false, only returning true when a read request goes past the end of the file. This patch corrects gzeof() to behave in the same way as feof(), as noted in the zlib.h documentation.
2011-10-02Add a transparent write mode to gzopen() when 'T' is in the mode.Mark Adler