]> git.ipfire.org Git - thirdparty/zstd.git/commit
changed API comments to invite using macro ZSTD_CONTENTSIZE_UNKNOWN
authorYann Collet <cyan@fb.com>
Sat, 14 Oct 2017 07:32:06 +0000 (00:32 -0700)
committerYann Collet <cyan@fb.com>
Sat, 14 Oct 2017 07:32:06 +0000 (00:32 -0700)
commit5eed8e7a5538be8fc39ab94d1a61e161bbc348b9
treebd37984eaa501ca18a520bc0963472e24d09883f
parent9ef32b3cf1cbf5276f3e6dd0484de1ddd258b4a4
changed API comments to invite using macro ZSTD_CONTENTSIZE_UNKNOWN

to mean "pledgedSrcSize is not known at init time" instead of `0`.
Note that, a few prototypes created and documented with `0` to mean "unknown" still interpret "0" as unknown,
to avoid breaking 3rd party applications which depend on this behavior.
But this value is no longer recommended to mean "unknown".

In some future version, it might be possible to switch "0" to mean "empty",
as is already the case for several prototypes.
The advantage is that pledgedSrcSize field would have same behavior accross entire API,
making it easier to reason about.

Note that all concerned prototypes belong to the "experimental" API section.

srcSize is controlled at end of compression,
so if someone uses "0" to mean "unknown" while it effectively means "empty",
this is immediately caught by the compression function, which generates an error code : ZSTD_ERROR_srcSize_wrong
doc/zstd_manual.html
lib/zstd.h