aboutsummaryrefslogtreecommitdiff
path: root/gzwrite.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Remove K&R function definitions from zlib.Mark Adler2023-04-151-64/+18
| | | | | | | C2X has removed K&R definitions from the C function syntax. Though the standard has not yet been approved, some high-profile compilers are now issuing warnings when such definitions are encountered.
* Fix crash when gzsetparams() attempted for transparent write.Mark Adler2022-12-261-1/+1
| | | | gzsetparams() now returns a Z_STREAM_ERROR in this case.
* Minor formatting improvements.Mark Adler2022-10-051-1/+1
| | | | No code changes.
* zlib 1.2.12v1.2.12Mark Adler2022-03-271-1/+1
|
* Avoid adding empty gzip member after gzflush with Z_FINISH.Mark Adler2019-04-131-1/+10
|
* Make the names in functions declarations identical to definitions.Mark Adler2017-10-121-4/+4
|
* Avoid undefined behaviors of memcpy() in gz*printf().Mark Adler2017-10-121-2/+2
|
* Return an error if the gzputs string length can't fit in an int.Mark Adler2017-02-151-4/+7
|
* Avoid some conversion warnings in gzread.c and gzwrite.c.Mark Adler2017-02-151-2/+2
|
* zlib 1.2.11v1.2.11Mark Adler2017-01-151-1/+1
|
* Fix bug in gzwrite.c that produced corrupt gzip files.Mark Adler2017-01-021-0/+1
|
* zlib 1.2.9v1.2.9Mark Adler2016-12-311-1/+1
|
* Avoid the need for ssize_t.Mark Adler2016-12-311-11/+12
| | | | | | | | Limit read() and write() requests to sizes that fit in an int. This allows storing the return value in an int, and avoiding the need to use or construct an ssize_t type. This is required for Microsoft C, whose _read and _write functions take an unsigned request and return an int.
* Avoid some random compiler warnings on various platforms.Mark Adler2016-12-301-1/+1
|
* Add gzfwrite(), duplicating the interface of fwrite().Mark Adler2016-12-041-40/+98
|
* Create z_size_t and z_ssize_t types.Mark Adler2016-12-041-1/+1
| | | | | | Normally these are set to size_t and ssize_t. But if they do not exist, then they are set to the smallest integer type that can contain a pointer. size_t is unsigned and ssize_t is signed.
* Don't need to emit an empty fixed block when changing parameters.Mark Adler2016-12-041-1/+1
| | | | | | gzsetparams() was using Z_PARTIAL_FLUSH when it could use Z_BLOCK instead. This commit uses Z_BLOCK, which avoids emitting an unnecessary ten bits into the stream.
* Clean up gz* function return values.Mark Adler2016-12-041-21/+23
| | | | | | | 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.
* Explicitly ignore a return value in gzwrite.c.Mark Adler2016-12-041-1/+1
|
* Clean up type conversions.Mark Adler2016-10-111-10/+12
|
* Loop on write() calls in gzwrite.c in case of non-blocking I/O.Mark Adler2016-04-051-11/+16
|
* Avoid uninitialized access by gzclose_w().Mark Adler2015-07-281-0/+1
|
* Improve speed of gzprintf() in transparent mode.Mark Adler2015-07-051-46/+64
|
* Add casts in gzwrite.c for pointer differences.Mark Adler2013-04-131-2/+2
|
* zlib 1.2.7.1v1.2.7.1Mark Adler2013-03-241-1/+1
|
* Add casts and consts to ease user conversion to C++.Mark Adler2013-03-241-2/+2
| | | | You would still need to run zlib2ansi on all of the *.c files.
* Add gzvprintf() as an undocumented function in zlib.Mark Adler2013-03-221-7/+12
| | | | The function is only available if stdarg.h is available.
* Fix bug in gzclose() when gzwrite() runs out of memory.Mark Adler2012-10-011-5/+6
| | | | | | If the deflateInit2() called for the first gzwrite() failed with a Z_MEM_ERROR, then a subsequent gzclose() would try to free an already freed pointer. This fixes that.
* Fix bug where gzopen(), gzclose() would write an empty file.Mark Adler2012-09-291-8/+7
| | | | | | | A gzopen() to write (mode "w") followed immediately by a gzclose() would output an empty zero-length file. What it should do is write an empty gzip file, with the gzip header, empty deflate content, and gzip trailer totalling 20 bytes. This fixes it to do that.
* Fix unintialized value bug in gzputc() introduced by const patches.Mark Adler2012-08-241-8/+10
| | | | | | | | | | | Avoid the use of an uninitialized value when the write buffers have not been initialized. A recent change to avoid the use of strm-> next_in in order to resolve some const conflicts added the use of state->in in its place. This patch avoids the use of state->in when it is not initialized. Nothing bad would actually happen, since two variables set to the same unintialized value are subtracted. However valgrind was rightly complaining. So this fixes that.
* Clean up the usage of z_const and respect const usage within zlib.Mark Adler2012-08-131-14/+19
| | | | | | | | | 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.
* Fix bug in gzclose_w() when gzwrite() fails to allocate memory.Mark Adler2012-03-031-6/+8
|
* Cast to char * in gzprintf to avoid warnings [Zinser].Mark Adler2012-03-021-11/+12
|
* Put gzflags() functionality back in zutil.c.Mark Adler2012-02-011-31/+0
| | | | | | | | | | gzflags() was put in gzwrite.c in order to be compiled exactly the same as gzprintf(), so that it was guaranteed to return the correct information. However that causes a static linkage to zlib to bring in many routines that are often not used. All that is required to duplicate the compilation environment of gzprintf() is to include gzguts.h. So that is now done in zutil.c to assure that the correct flags are returned.
* zlib 1.2.6v1.2.6Mark Adler2012-01-291-1/+1
|
* Have gzputc return the character written instead of the argument.Mark Adler2012-01-291-2/+2
| | | | | | | | When successful, gzputc would return the second argument. If the second argument were -1, gzputc would return -1 instead of the character written, which was 255. However the -1 would not be distinguishable from an error. Now gzputc returns 255 in that case.
* Avoid use of Z_BUF_ERROR in gz* functions except for premature EOF.Mark Adler2011-12-131-1/+1
| | | | | | | Z_BUF_ERROR was also being used for an unsuccessful gzungetc and for buffer lengths that didn't fit in an int. Those uses were changed to Z_DATA_ERROR in order to assure that Z_BUF_ERROR occurs only when a premature end of input occurs, indicating that gzclearerr() can be used.
* Fix gzwrite.c to accommodate reduced memory zlib compilation.Mark Adler2011-12-101-1/+1
| | | | | | gzwrite.c had hard-coded parameters to deflateInit2() which could contradict compile-time options for the use of less memory and fewer code bits. This patch suggested by Karsten Saunte fixes that.
* Add a transparent write mode to gzopen() when 'T' is in the mode.Mark Adler2011-10-021-24/+48
|
* Merge vestigial vsnprintf determination from zutil.h to gzguts.h.Mark Adler2011-10-021-0/+31
| | | | | | | | | This also moves some of the same from zconf.h to gzguts.h. A new function, gzflags(), was created to pass the compilation flags related to vsnprintf usage back to zlibCompileFlags() in zutil.c. In the process, various compiler configuration files were updated to include gzflags(), as well as the new gzgetc_() function added when the gzgetc() macro was introduced in a previous patch.
* Fix gzclose() to return the actual error last encountered.Mark Adler2011-09-301-5/+8
|
* Change gzgetc() to a macro for speed (~40% speedup in testing).Mark Adler2011-09-261-10/+10
|
* zlib 1.2.5.1v1.2.5.1Mark Adler2011-09-111-3/+7
|
* zlib 1.2.4-pre2v1.2.4-pre2Mark Adler2011-09-091-1/+1
|
* zlib 1.2.4-pre1v1.2.4-pre1Mark Adler2011-09-091-1/+2
|
* zlib 1.2.3.9v1.2.3.9Mark Adler2011-09-091-6/+2
|
* zlib 1.2.3.8v1.2.3.8Mark Adler2011-09-091-7/+10
|
* zlib 1.2.3.7v1.2.3.7Mark Adler2011-09-091-14/+18
|
* zlib 1.2.3.6v1.2.3.6Mark Adler2011-09-091-19/+17
|
* zlib 1.2.3.5v1.2.3.5Mark Adler2011-09-091-0/+529