pub unsafe extern "C" fn gzprintf(
file: gzFile,
format: *const c_char,
...
) -> c_intAvailable on crate features
gz and gzprintf only.Expand description
Convert, format, compress, and write the variadic arguments ... to a file under control of the string format, as in fprintf.
§Returns
Returns the number of uncompressed bytes actually written, or a negative zlib error code in case of error.
The number of uncompressed bytes written is limited to 8191, or one less than the buffer size given to gzbuffer.
The caller should assure that this limit is not exceeded. If it is exceeded, then gzprintf will return 0 with nothing written.
Contrary to other implementations that can use the insecure vsprintf, the zlib-rs library always uses vsnprintf,
so attempting to write more bytes than the limit can never run into buffer overflow issues.
§Safety
- The
formatmust be a valid C string - The variadic arguments must correspond with the format string in number and type