Skip to content

Commit

Permalink
Bump zstd-sys to 2.0.10
Browse files Browse the repository at this point in the history
  • Loading branch information
gyscos committed Mar 27, 2024
1 parent 1779b38 commit 55f5b7b
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 34 deletions.
2 changes: 1 addition & 1 deletion zstd-safe/zstd-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ links = "zstd"
name = "zstd-sys"
readme = "Readme.md"
repository = "https://github.com/gyscos/zstd-rs"
version = "2.0.9+zstd.1.5.5"
version = "2.0.10+zstd.1.5.6"
edition = "2018"
rust-version = "1.64"

Expand Down
2 changes: 1 addition & 1 deletion zstd-safe/zstd-sys/src/bindings_zdict.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/* automatically generated by rust-bindgen 0.66.1 */
/* automatically generated by rust-bindgen 0.69.4 */

extern "C" {
#[doc = " ZDICT_trainFromBuffer():\n Train a dictionary from an array of samples.\n Redirect towards ZDICT_optimizeTrainFromBuffer_fastCover() single-threaded, with d=8, steps=4,\n f=20, and accel=1.\n Samples must be stored concatenated in a single flat buffer `samplesBuffer`,\n supplied with an array of sizes `samplesSizes`, providing the size of each sample, in order.\n The resulting dictionary will be saved into `dictBuffer`.\n @return: size of dictionary stored into `dictBuffer` (<= `dictBufferCapacity`)\n or an error code, which can be tested with ZDICT_isError().\n Note: Dictionary training will fail if there are not enough samples to construct a\n dictionary, or if most of the samples are too small (< 8 bytes being the lower limit).\n If dictionary training fails, you should use zstd without a dictionary, as the dictionary\n would've been ineffective anyways. If you believe your samples would benefit from a dictionary\n please open an issue with details, and we can look into it.\n Note: ZDICT_trainFromBuffer()'s memory usage is about 6 MB.\n Tips: In general, a reasonable dictionary has a size of ~ 100 KB.\n It's possible to select smaller or larger size, just by specifying `dictBufferCapacity`.\n In general, it's recommended to provide a few thousands samples, though this can vary a lot.\n It's recommended that total size of all samples be about ~x100 times the target size of dictionary."]
Expand Down
2 changes: 1 addition & 1 deletion zstd-safe/zstd-sys/src/bindings_zdict_experimental.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/* automatically generated by rust-bindgen 0.66.1 */
/* automatically generated by rust-bindgen 0.69.4 */

pub const ZDICT_DICTSIZE_MIN: u32 = 256;
pub const ZDICT_CONTENTSIZE_MIN: u32 = 128;
Expand Down
19 changes: 10 additions & 9 deletions zstd-safe/zstd-sys/src/bindings_zstd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/* automatically generated by rust-bindgen 0.66.1 */
/* automatically generated by rust-bindgen 0.69.4 */

pub const ZSTD_VERSION_MAJOR: u32 = 1;
pub const ZSTD_VERSION_MINOR: u32 = 5;
pub const ZSTD_VERSION_RELEASE: u32 = 5;
pub const ZSTD_VERSION_NUMBER: u32 = 10505;
pub const ZSTD_VERSION_RELEASE: u32 = 6;
pub const ZSTD_VERSION_NUMBER: u32 = 10506;
pub const ZSTD_CLEVEL_DEFAULT: u32 = 3;
pub const ZSTD_MAGICNUMBER: u32 = 4247762216;
pub const ZSTD_MAGIC_DICTIONARY: u32 = 3962610743;
Expand Down Expand Up @@ -127,7 +127,7 @@ extern "C" {
pub fn ZSTD_freeCCtx(cctx: *mut ZSTD_CCtx) -> usize;
}
extern "C" {
#[doc = " ZSTD_compressCCtx() :\n Same as ZSTD_compress(), using an explicit ZSTD_CCtx.\n Important : in order to behave similarly to `ZSTD_compress()`,\n this function compresses at requested compression level,\n __ignoring any other parameter__ .\n If any advanced parameter was set using the advanced API,\n they will all be reset. Only `compressionLevel` remains."]
#[doc = " ZSTD_compressCCtx() :\n Same as ZSTD_compress(), using an explicit ZSTD_CCtx.\n Important : in order to mirror `ZSTD_compress()` behavior,\n this function compresses at the requested compression level,\n __ignoring any other advanced parameter__ .\n If any advanced parameter was set using the advanced API,\n they will all be reset. Only `compressionLevel` remains."]
pub fn ZSTD_compressCCtx(
cctx: *mut ZSTD_CCtx,
dst: *mut ::core::ffi::c_void,
Expand All @@ -150,7 +150,7 @@ extern "C" {
pub fn ZSTD_freeDCtx(dctx: *mut ZSTD_DCtx) -> usize;
}
extern "C" {
#[doc = " ZSTD_decompressDCtx() :\n Same as ZSTD_decompress(),\n requires an allocated ZSTD_DCtx.\n Compatible with sticky parameters."]
#[doc = " ZSTD_decompressDCtx() :\n Same as ZSTD_decompress(),\n requires an allocated ZSTD_DCtx.\n Compatible with sticky parameters (see below)."]
pub fn ZSTD_decompressDCtx(
dctx: *mut ZSTD_DCtx,
dst: *mut ::core::ffi::c_void,
Expand Down Expand Up @@ -184,6 +184,7 @@ pub enum ZSTD_cParameter {
ZSTD_c_minMatch = 105,
ZSTD_c_targetLength = 106,
ZSTD_c_strategy = 107,
ZSTD_c_targetCBlockSize = 130,
ZSTD_c_enableLongDistanceMatching = 160,
ZSTD_c_ldmHashLog = 161,
ZSTD_c_ldmMinMatch = 162,
Expand All @@ -200,7 +201,6 @@ pub enum ZSTD_cParameter {
ZSTD_c_experimentalParam3 = 1000,
ZSTD_c_experimentalParam4 = 1001,
ZSTD_c_experimentalParam5 = 1002,
ZSTD_c_experimentalParam6 = 1003,
ZSTD_c_experimentalParam7 = 1004,
ZSTD_c_experimentalParam8 = 1005,
ZSTD_c_experimentalParam9 = 1006,
Expand Down Expand Up @@ -256,7 +256,7 @@ extern "C" {
) -> usize;
}
extern "C" {
#[doc = " ZSTD_compress2() :\n Behave the same as ZSTD_compressCCtx(), but compression parameters are set using the advanced API.\n ZSTD_compress2() always starts a new frame.\n Should cctx hold data from a previously unfinished frame, everything about it is forgotten.\n - Compression parameters are pushed into CCtx before starting compression, using ZSTD_CCtx_set*()\n - The function is always blocking, returns when compression is completed.\n NOTE: Providing `dstCapacity >= ZSTD_compressBound(srcSize)` guarantees that zstd will have\n enough space to successfully compress the data, though it is possible it fails for other reasons.\n @return : compressed size written into `dst` (<= `dstCapacity),\n or an error code if it fails (which can be tested using ZSTD_isError())."]
#[doc = " ZSTD_compress2() :\n Behave the same as ZSTD_compressCCtx(), but compression parameters are set using the advanced API.\n (note that this entry point doesn't even expose a compression level parameter).\n ZSTD_compress2() always starts a new frame.\n Should cctx hold data from a previously unfinished frame, everything about it is forgotten.\n - Compression parameters are pushed into CCtx before starting compression, using ZSTD_CCtx_set*()\n - The function is always blocking, returns when compression is completed.\n NOTE: Providing `dstCapacity >= ZSTD_compressBound(srcSize)` guarantees that zstd will have\n enough space to successfully compress the data, though it is possible it fails for other reasons.\n @return : compressed size written into `dst` (<= `dstCapacity),\n or an error code if it fails (which can be tested using ZSTD_isError())."]
pub fn ZSTD_compress2(
cctx: *mut ZSTD_CCtx,
dst: *mut ::core::ffi::c_void,
Expand All @@ -275,6 +275,7 @@ pub enum ZSTD_dParameter {
ZSTD_d_experimentalParam3 = 1002,
ZSTD_d_experimentalParam4 = 1003,
ZSTD_d_experimentalParam5 = 1004,
ZSTD_d_experimentalParam6 = 1005,
}
extern "C" {
#[doc = " ZSTD_dParam_getBounds() :\n All parameters must belong to an interval with lower and upper bounds,\n otherwise they will either trigger an error or be automatically clamped.\n @return : a structure, ZSTD_bounds, which contains\n - an error status field, which must be tested using ZSTD_isError()\n - both lower and upper bounds, inclusive"]
Expand Down Expand Up @@ -334,7 +335,7 @@ pub enum ZSTD_EndDirective {
ZSTD_e_end = 2,
}
extern "C" {
#[doc = " ZSTD_compressStream2() : Requires v1.4.0+\n Behaves about the same as ZSTD_compressStream, with additional control on end directive.\n - Compression parameters are pushed into CCtx before starting compression, using ZSTD_CCtx_set*()\n - Compression parameters cannot be changed once compression is started (save a list of exceptions in multi-threading mode)\n - output->pos must be <= dstCapacity, input->pos must be <= srcSize\n - output->pos and input->pos will be updated. They are guaranteed to remain below their respective limit.\n - endOp must be a valid directive\n - When nbWorkers==0 (default), function is blocking : it completes its job before returning to caller.\n - When nbWorkers>=1, function is non-blocking : it copies a portion of input, distributes jobs to internal worker threads, flush to output whatever is available,\n and then immediately returns, just indicating that there is some data remaining to be flushed.\n The function nonetheless guarantees forward progress : it will return only after it reads or write at least 1+ byte.\n - Exception : if the first call requests a ZSTD_e_end directive and provides enough dstCapacity, the function delegates to ZSTD_compress2() which is always blocking.\n - @return provides a minimum amount of data remaining to be flushed from internal buffers\n or an error code, which can be tested using ZSTD_isError().\n if @return != 0, flush is not fully completed, there is still some data left within internal buffers.\n This is useful for ZSTD_e_flush, since in this case more flushes are necessary to empty all buffers.\n For ZSTD_e_end, @return == 0 when internal buffers are fully flushed and frame is completed.\n - after a ZSTD_e_end directive, if internal buffer is not fully flushed (@return != 0),\n only ZSTD_e_end or ZSTD_e_flush operations are allowed.\n Before starting a new compression job, or changing compression parameters,\n it is required to fully flush internal buffers."]
#[doc = " ZSTD_compressStream2() : Requires v1.4.0+\n Behaves about the same as ZSTD_compressStream, with additional control on end directive.\n - Compression parameters are pushed into CCtx before starting compression, using ZSTD_CCtx_set*()\n - Compression parameters cannot be changed once compression is started (save a list of exceptions in multi-threading mode)\n - output->pos must be <= dstCapacity, input->pos must be <= srcSize\n - output->pos and input->pos will be updated. They are guaranteed to remain below their respective limit.\n - endOp must be a valid directive\n - When nbWorkers==0 (default), function is blocking : it completes its job before returning to caller.\n - When nbWorkers>=1, function is non-blocking : it copies a portion of input, distributes jobs to internal worker threads, flush to output whatever is available,\n and then immediately returns, just indicating that there is some data remaining to be flushed.\n The function nonetheless guarantees forward progress : it will return only after it reads or write at least 1+ byte.\n - Exception : if the first call requests a ZSTD_e_end directive and provides enough dstCapacity, the function delegates to ZSTD_compress2() which is always blocking.\n - @return provides a minimum amount of data remaining to be flushed from internal buffers\n or an error code, which can be tested using ZSTD_isError().\n if @return != 0, flush is not fully completed, there is still some data left within internal buffers.\n This is useful for ZSTD_e_flush, since in this case more flushes are necessary to empty all buffers.\n For ZSTD_e_end, @return == 0 when internal buffers are fully flushed and frame is completed.\n - after a ZSTD_e_end directive, if internal buffer is not fully flushed (@return != 0),\n only ZSTD_e_end or ZSTD_e_flush operations are allowed.\n Before starting a new compression job, or changing compression parameters,\n it is required to fully flush internal buffers.\n - note: if an operation ends with an error, it may leave @cctx in an undefined state.\n Therefore, it's UB to invoke ZSTD_compressStream2() of ZSTD_compressStream() on such a state.\n In order to be re-employed after an error, a state must be reset,\n which can be done explicitly (ZSTD_CCtx_reset()),\n or is sometimes implied by methods starting a new compression job (ZSTD_initCStream(), ZSTD_compressCCtx())"]
pub fn ZSTD_compressStream2(
cctx: *mut ZSTD_CCtx,
output: *mut ZSTD_outBuffer,
Expand Down Expand Up @@ -389,7 +390,7 @@ extern "C" {
pub fn ZSTD_initDStream(zds: *mut ZSTD_DStream) -> usize;
}
extern "C" {
#[doc = " ZSTD_decompressStream() :\n Streaming decompression function.\n Call repetitively to consume full input updating it as necessary.\n Function will update both input and output `pos` fields exposing current state via these fields:\n - `input.pos < input.size`, some input remaining and caller should provide remaining input\n on the next call.\n - `output.pos < output.size`, decoder finished and flushed all remaining buffers.\n - `output.pos == output.size`, potentially uncflushed data present in the internal buffers,\n call ZSTD_decompressStream() again to flush remaining data to output.\n Note : with no additional input, amount of data flushed <= ZSTD_BLOCKSIZE_MAX.\n\n @return : 0 when a frame is completely decoded and fully flushed,\n or an error code, which can be tested using ZSTD_isError(),\n or any other value > 0, which means there is some decoding or flushing to do to complete current frame."]
#[doc = " ZSTD_decompressStream() :\n Streaming decompression function.\n Call repetitively to consume full input updating it as necessary.\n Function will update both input and output `pos` fields exposing current state via these fields:\n - `input.pos < input.size`, some input remaining and caller should provide remaining input\n on the next call.\n - `output.pos < output.size`, decoder finished and flushed all remaining buffers.\n - `output.pos == output.size`, potentially uncflushed data present in the internal buffers,\n call ZSTD_decompressStream() again to flush remaining data to output.\n Note : with no additional input, amount of data flushed <= ZSTD_BLOCKSIZE_MAX.\n\n @return : 0 when a frame is completely decoded and fully flushed,\n or an error code, which can be tested using ZSTD_isError(),\n or any other value > 0, which means there is some decoding or flushing to do to complete current frame.\n\n Note: when an operation returns with an error code, the @zds state may be left in undefined state.\n It's UB to invoke `ZSTD_decompressStream()` on such a state.\n In order to re-use such a state, it must be first reset,\n which can be done explicitly (`ZSTD_DCtx_reset()`),\n or is implied for operations starting some new decompression job (`ZSTD_initDStream`, `ZSTD_decompressDCtx()`, `ZSTD_decompress_usingDict()`)"]
pub fn ZSTD_decompressStream(
zds: *mut ZSTD_DStream,
output: *mut ZSTD_outBuffer,
Expand Down
Loading

0 comments on commit 55f5b7b

Please sign in to comment.