Skip to content

Commit

Permalink
Specify rust target 1.47 to bindgen
Browse files Browse the repository at this point in the history
  • Loading branch information
gyscos committed Nov 28, 2022
1 parent 44d7e43 commit 8009537
Show file tree
Hide file tree
Showing 5 changed files with 149 additions and 142 deletions.
18 changes: 10 additions & 8 deletions zstd-safe/zstd-sys/src/bindings_zdict_std.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ extern "C" {
dictBufferCapacity: usize,
samplesBuffer: *const ::core::ffi::c_void,
samplesSizes: *const usize,
nbSamples: ::core::ffi::c_uint,
nbSamples: ::std::os::raw::c_uint,
) -> usize;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ZDICT_params_t {
pub compressionLevel: ::core::ffi::c_int,
pub notificationLevel: ::core::ffi::c_uint,
pub dictID: ::core::ffi::c_uint,
pub compressionLevel: ::std::os::raw::c_int,
pub notificationLevel: ::std::os::raw::c_uint,
pub dictID: ::std::os::raw::c_uint,
}
extern "C" {
#[doc = " ZDICT_finalizeDictionary():\n Given a custom content as a basis for dictionary, and a set of samples,\n finalize dictionary by adding headers and statistics according to the zstd\n dictionary format.\n\n Samples must be stored concatenated in a flat buffer `samplesBuffer`,\n supplied with an array of sizes `samplesSizes`, providing the size of each\n sample in order. The samples are used to construct the statistics, so they\n should be representative of what you will compress with this dictionary.\n\n The compression level can be set in `parameters`. You should pass the\n compression level you expect to use in production. The statistics for each\n compression level differ, so tuning the dictionary for the compression level\n can help quite a bit.\n\n You can set an explicit dictionary ID in `parameters`, or allow us to pick\n a random dictionary ID for you, but we can't guarantee no collisions.\n\n The dstDictBuffer and the dictContent may overlap, and the content will be\n appended to the end of the header. If the header + the content doesn't fit in\n maxDictSize the beginning of the content is truncated to make room, since it\n is presumed that the most profitable content is at the end of the dictionary,\n since that is the cheapest to reference.\n\n `maxDictSize` must be >= max(dictContentSize, ZSTD_DICTSIZE_MIN).\n\n @return: size of dictionary stored into `dstDictBuffer` (<= `maxDictSize`),\n or an error code, which can be tested by ZDICT_isError().\n Note: ZDICT_finalizeDictionary() will push notifications into stderr if\n instructed to, using notificationLevel>0.\n NOTE: This function currently may fail in several edge cases including:\n * Not enough samples\n * Samples are uncompressible\n * Samples are all exactly the same"]
Expand All @@ -61,15 +61,15 @@ extern "C" {
dictContentSize: usize,
samplesBuffer: *const ::core::ffi::c_void,
samplesSizes: *const usize,
nbSamples: ::core::ffi::c_uint,
nbSamples: ::std::os::raw::c_uint,
parameters: ZDICT_params_t,
) -> usize;
}
extern "C" {
pub fn ZDICT_getDictID(
dictBuffer: *const ::core::ffi::c_void,
dictSize: usize,
) -> ::core::ffi::c_uint;
) -> ::std::os::raw::c_uint;
}
extern "C" {
pub fn ZDICT_getDictHeaderSize(
Expand All @@ -78,8 +78,10 @@ extern "C" {
) -> usize;
}
extern "C" {
pub fn ZDICT_isError(errorCode: usize) -> ::core::ffi::c_uint;
pub fn ZDICT_isError(errorCode: usize) -> ::std::os::raw::c_uint;
}
extern "C" {
pub fn ZDICT_getErrorName(errorCode: usize) -> *const ::core::ffi::c_char;
pub fn ZDICT_getErrorName(
errorCode: usize,
) -> *const ::std::os::raw::c_char;
}
60 changes: 31 additions & 29 deletions zstd-safe/zstd-sys/src/bindings_zdict_std_experimental.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@ extern "C" {
dictBufferCapacity: usize,
samplesBuffer: *const ::core::ffi::c_void,
samplesSizes: *const usize,
nbSamples: ::core::ffi::c_uint,
nbSamples: ::std::os::raw::c_uint,
) -> usize;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ZDICT_params_t {
pub compressionLevel: ::core::ffi::c_int,
pub notificationLevel: ::core::ffi::c_uint,
pub dictID: ::core::ffi::c_uint,
pub compressionLevel: ::std::os::raw::c_int,
pub notificationLevel: ::std::os::raw::c_uint,
pub dictID: ::std::os::raw::c_uint,
}
extern "C" {
#[doc = " ZDICT_finalizeDictionary():\n Given a custom content as a basis for dictionary, and a set of samples,\n finalize dictionary by adding headers and statistics according to the zstd\n dictionary format.\n\n Samples must be stored concatenated in a flat buffer `samplesBuffer`,\n supplied with an array of sizes `samplesSizes`, providing the size of each\n sample in order. The samples are used to construct the statistics, so they\n should be representative of what you will compress with this dictionary.\n\n The compression level can be set in `parameters`. You should pass the\n compression level you expect to use in production. The statistics for each\n compression level differ, so tuning the dictionary for the compression level\n can help quite a bit.\n\n You can set an explicit dictionary ID in `parameters`, or allow us to pick\n a random dictionary ID for you, but we can't guarantee no collisions.\n\n The dstDictBuffer and the dictContent may overlap, and the content will be\n appended to the end of the header. If the header + the content doesn't fit in\n maxDictSize the beginning of the content is truncated to make room, since it\n is presumed that the most profitable content is at the end of the dictionary,\n since that is the cheapest to reference.\n\n `maxDictSize` must be >= max(dictContentSize, ZSTD_DICTSIZE_MIN).\n\n @return: size of dictionary stored into `dstDictBuffer` (<= `maxDictSize`),\n or an error code, which can be tested by ZDICT_isError().\n Note: ZDICT_finalizeDictionary() will push notifications into stderr if\n instructed to, using notificationLevel>0.\n NOTE: This function currently may fail in several edge cases including:\n * Not enough samples\n * Samples are uncompressible\n * Samples are all exactly the same"]
Expand All @@ -63,15 +63,15 @@ extern "C" {
dictContentSize: usize,
samplesBuffer: *const ::core::ffi::c_void,
samplesSizes: *const usize,
nbSamples: ::core::ffi::c_uint,
nbSamples: ::std::os::raw::c_uint,
parameters: ZDICT_params_t,
) -> usize;
}
extern "C" {
pub fn ZDICT_getDictID(
dictBuffer: *const ::core::ffi::c_void,
dictSize: usize,
) -> ::core::ffi::c_uint;
) -> ::std::os::raw::c_uint;
}
extern "C" {
pub fn ZDICT_getDictHeaderSize(
Expand All @@ -80,36 +80,38 @@ extern "C" {
) -> usize;
}
extern "C" {
pub fn ZDICT_isError(errorCode: usize) -> ::core::ffi::c_uint;
pub fn ZDICT_isError(errorCode: usize) -> ::std::os::raw::c_uint;
}
extern "C" {
pub fn ZDICT_getErrorName(errorCode: usize) -> *const ::core::ffi::c_char;
pub fn ZDICT_getErrorName(
errorCode: usize,
) -> *const ::std::os::raw::c_char;
}
#[doc = " ZDICT_cover_params_t:\n k and d are the only required parameters.\n For others, value 0 means default."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ZDICT_cover_params_t {
pub k: ::core::ffi::c_uint,
pub d: ::core::ffi::c_uint,
pub steps: ::core::ffi::c_uint,
pub nbThreads: ::core::ffi::c_uint,
pub k: ::std::os::raw::c_uint,
pub d: ::std::os::raw::c_uint,
pub steps: ::std::os::raw::c_uint,
pub nbThreads: ::std::os::raw::c_uint,
pub splitPoint: f64,
pub shrinkDict: ::core::ffi::c_uint,
pub shrinkDictMaxRegression: ::core::ffi::c_uint,
pub shrinkDict: ::std::os::raw::c_uint,
pub shrinkDictMaxRegression: ::std::os::raw::c_uint,
pub zParams: ZDICT_params_t,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ZDICT_fastCover_params_t {
pub k: ::core::ffi::c_uint,
pub d: ::core::ffi::c_uint,
pub f: ::core::ffi::c_uint,
pub steps: ::core::ffi::c_uint,
pub nbThreads: ::core::ffi::c_uint,
pub k: ::std::os::raw::c_uint,
pub d: ::std::os::raw::c_uint,
pub f: ::std::os::raw::c_uint,
pub steps: ::std::os::raw::c_uint,
pub nbThreads: ::std::os::raw::c_uint,
pub splitPoint: f64,
pub accel: ::core::ffi::c_uint,
pub shrinkDict: ::core::ffi::c_uint,
pub shrinkDictMaxRegression: ::core::ffi::c_uint,
pub accel: ::std::os::raw::c_uint,
pub shrinkDict: ::std::os::raw::c_uint,
pub shrinkDictMaxRegression: ::std::os::raw::c_uint,
pub zParams: ZDICT_params_t,
}
extern "C" {
Expand All @@ -119,7 +121,7 @@ extern "C" {
dictBufferCapacity: usize,
samplesBuffer: *const ::core::ffi::c_void,
samplesSizes: *const usize,
nbSamples: ::core::ffi::c_uint,
nbSamples: ::std::os::raw::c_uint,
parameters: ZDICT_cover_params_t,
) -> usize;
}
Expand All @@ -130,7 +132,7 @@ extern "C" {
dictBufferCapacity: usize,
samplesBuffer: *const ::core::ffi::c_void,
samplesSizes: *const usize,
nbSamples: ::core::ffi::c_uint,
nbSamples: ::std::os::raw::c_uint,
parameters: *mut ZDICT_cover_params_t,
) -> usize;
}
Expand All @@ -141,7 +143,7 @@ extern "C" {
dictBufferCapacity: usize,
samplesBuffer: *const ::core::ffi::c_void,
samplesSizes: *const usize,
nbSamples: ::core::ffi::c_uint,
nbSamples: ::std::os::raw::c_uint,
parameters: ZDICT_fastCover_params_t,
) -> usize;
}
Expand All @@ -152,14 +154,14 @@ extern "C" {
dictBufferCapacity: usize,
samplesBuffer: *const ::core::ffi::c_void,
samplesSizes: *const usize,
nbSamples: ::core::ffi::c_uint,
nbSamples: ::std::os::raw::c_uint,
parameters: *mut ZDICT_fastCover_params_t,
) -> usize;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ZDICT_legacy_params_t {
pub selectivityLevel: ::core::ffi::c_uint,
pub selectivityLevel: ::std::os::raw::c_uint,
pub zParams: ZDICT_params_t,
}
extern "C" {
Expand All @@ -169,7 +171,7 @@ extern "C" {
dictBufferCapacity: usize,
samplesBuffer: *const ::core::ffi::c_void,
samplesSizes: *const usize,
nbSamples: ::core::ffi::c_uint,
nbSamples: ::std::os::raw::c_uint,
parameters: ZDICT_legacy_params_t,
) -> usize;
}
Expand All @@ -180,6 +182,6 @@ extern "C" {
dictBufferCapacity: usize,
samplesBuffer: *const ::core::ffi::c_void,
samplesSizes: *const usize,
nbSamples: ::core::ffi::c_uint,
nbSamples: ::std::os::raw::c_uint,
) -> usize;
}
Loading

0 comments on commit 8009537

Please sign in to comment.