While using zlib in a "pedantic" way, I have stumbled across a couple inconsistencies I'd like to clear for myself.
For inflateInit(), the manual states:
... The fields
next_in,avail_in,zalloc,zfreeandopaquemust be initialized before by the caller.
yet in the next paragraph:
... So
next_in, andavail_in,next_out, andavail_outare unused and unchanged.
In other words, the manual requires next_in and avail_in to be initialized prior to calling inflateInit(), but at the same time, it states that they won't be used anyway. Why is that? In my case, I tried to leave them both uninitialized and initialized to zero with no problems until the moment real preparations are made before a call to deflate(). But strictly speaking, it is in violation of the manual unless "must be initialized" means I can initialize them to zeros. But why bother then?
Note that there is no such requirement for deflateInit():
... The fields
zalloc,zfreeandopaquemust be initialized before by the caller.
Why the asymmetry?