Remove bindgen dependency

[?]
Dec 3, 2020, 5:38 PM
UPRY2FELRWZCL5FGUS3EKS2RXEY7D2FGXYGLJWDNJT23PHITRWMAC

Dependencies

Change contents

  • replacement in src/lib.rs at line 6
    [2.241375][2.241375:241427]()
    include!(concat!(env!("OUT_DIR"), "/bindings.rs"));
    [2.241375]
    [2.241427]
    mod bindings;
    use bindings::*;
  • replacement in src/lib.rs at line 11
    [2.241472][2.241472:241502]()
    pub fn out_size() -> size_t {
    [2.241472]
    [2.241502]
    pub fn out_size() -> bindings::size_t {
  • replacement in src/lib.rs at line 47
    [2.242230][2.242230:242248]()
    ZSTD(size_t),
    [2.242230]
    [2.242248]
    ZSTD(bindings::size_t),
  • replacement in src/lib.rs at line 125
    [2.244220][2.244220:244235]()
    n: size_t,
    [2.244220]
    [2.244235]
    n: bindings::size_t,
  • replacement in src/lib.rs at line 173
    [2.246285][2.246285:246330]()
    size: input.len() as size_t,
    [2.246285]
    [2.246330]
    size: input.len() as bindings::size_t,
  • replacement in src/lib.rs at line 178
    [2.246472][2.246472:246518]()
    size: output.len() as size_t,
    [2.246472]
    [2.246518]
    size: output.len() as bindings::size_t,
  • replacement in src/lib.rs at line 194
    [2.247100][2.247100:247146]()
    size: output.len() as size_t,
    [2.247100]
    [2.247146]
    size: output.len() as bindings::size_t,
  • replacement in src/lib.rs at line 238
    [2.248653][2.248653:248698]()
    size: input.len() as size_t,
    [2.248653]
    [2.248698]
    size: input.len() as bindings::size_t,
  • replacement in src/lib.rs at line 243
    [2.248840][2.248840:248886]()
    size: output.len() as size_t,
    [2.248840]
    [2.248886]
    size: output.len() as bindings::size_t,
  • replacement in src/lib.rs at line 260
    [2.249375][2.249375:249420]()
    size: input.len() as size_t,
    [2.249375]
    [2.249420]
    size: input.len() as bindings::size_t,
  • replacement in src/lib.rs at line 265
    [2.249562][2.249562:249608]()
    size: output.len() as size_t,
    [2.249562]
    [2.249608]
    size: output.len() as bindings::size_t,
  • replacement in src/lib.rs at line 268
    [2.249647][2.249647:249741]()
    let result = ZSTD_compressStream2(self.p, &mut output, &mut input, op as c_uint);
    [2.249647]
    [2.249741]
    let result = ZSTD_compressStream2(self.p, &mut output, &mut input, op as EnumType);
  • replacement in src/lib.rs at line 277
    [2.250035][2.250035:250081]()
    size: output.len() as size_t,
    [2.250035]
    [2.250081]
    size: output.len() as bindings::size_t,
  • replacement in src/lib.rs at line 290
    [2.250523][2.250523:250569]()
    size: output.len() as size_t,
    [2.250523]
    [2.250569]
    size: output.len() as bindings::size_t,
  • edit in src/lib.rs at line 301
    [2.250830]
    [2.250830]
    #[cfg(windows)]
    type EnumType = i32;
    #[cfg(not(windows))]
    type EnumType = u32;
  • edit in src/lib.rs at line 332
    [2.251306]
    [2.251306]
    }
    let result = ZSTD_initDStream(p);
    if ZSTD_isError(result) != 0 {
    return Err(Error::ZSTD(result));
  • replacement in src/lib.rs at line 345
    [2.251583][2.251583:251628]()
    size: input.len() as size_t,
    [2.251583]
    [2.251628]
    size: input.len() as bindings::size_t,
  • replacement in src/lib.rs at line 350
    [2.251770][2.251770:251816]()
    size: output.len() as size_t,
    [2.251770]
    [2.251816]
    size: output.len() as bindings::size_t,
  • replacement in src/lib.rs at line 368
    [2.252330][2.252330:252429]()
    ZSTD_seekable_initBuff(p, input.as_ptr() as *const c_void, input.len() as size_t);
    [2.252330]
    [2.252429]
    ZSTD_seekable_initBuff(p, input.as_ptr() as *const c_void, input.len() as bindings::size_t);
  • replacement in src/lib.rs at line 450
    [2.255331][2.255331:255368]()
    out.len() as size_t,
    [2.255331]
    [2.255368]
    out.len() as bindings::size_t,
  • replacement in src/lib.rs at line 465
    [2.255768][2.255768:255846]()
    pub fn get_frame_compressed_offset(&self, frame_index: usize) -> size_t {
    [2.255768]
    [2.255846]
    pub fn get_frame_compressed_offset(&self, frame_index: usize) -> bindings::size_t {
  • replacement in src/lib.rs at line 486
    [2.256985][2.256985:257023]()
    dest.len() as size_t,
    [2.256985]
    [2.257023]
    dest.len() as bindings::size_t,
  • replacement in src/lib.rs at line 576
    [2.259089][2.259089:259133]()
    src_size: size_t,
    dst_size: size_t,
    [2.259089]
    [2.259133]
    src_size: bindings::size_t,
    dst_size: bindings::size_t,
  • replacement in src/lib.rs at line 594
    [2.259421][2.259421:259442]()
    src_len: size_t,
    [2.259421]
    [2.259442]
    src_len: bindings::size_t,
  • replacement in src/lib.rs at line 602
    [2.259681][2.259681:259714]()
    dst.len() as size_t,
    [2.259681]
    [2.259714]
    dst.len() as bindings::size_t,
  • replacement in src/lib.rs at line 658
    [2.261169][2.261169:261186]()
    len: size_t,
    [2.261169]
    [2.261186]
    len: bindings::size_t,
  • replacement in src/lib.rs at line 681
    [2.261774][2.261774:261814]()
    len: chunk.len() as size_t,
    [2.261774]
    [2.261814]
    len: chunk.len() as bindings::size_t,
  • file addition: bindings.rs (-xw-x--x--)
    [2.241235]
    /* automatically generated by rust-bindgen 0.55.1 */
    pub type size_t = ::std::os::raw::c_ulong;
    pub type __off_t = ::std::os::raw::c_long;
    pub type __off64_t = ::std::os::raw::c_long;
    #[repr(C)]
    #[derive(Debug, Copy, Clone)]
    pub struct _IO_marker {
    _unused: [u8; 0],
    }
    #[repr(C)]
    #[derive(Debug, Copy, Clone)]
    pub struct _IO_codecvt {
    _unused: [u8; 0],
    }
    #[repr(C)]
    #[derive(Debug, Copy, Clone)]
    pub struct _IO_wide_data {
    _unused: [u8; 0],
    }
    pub type _IO_lock_t = ::std::os::raw::c_void;
    extern "C" {
    #[doc = " Simple API"]
    #[doc = " Compresses `src` content as a single zstd compressed frame into already allocated `dst`."]
    #[doc = " Hint : compression runs faster if `dstCapacity` >= `ZSTD_compressBound(srcSize)`."]
    #[doc = " @return : compressed size written into `dst` (<= `dstCapacity),"]
    #[doc = " or an error code if it fails (which can be tested using ZSTD_isError())."]
    pub fn ZSTD_compress(
    dst: *mut ::std::os::raw::c_void,
    dstCapacity: size_t,
    src: *const ::std::os::raw::c_void,
    srcSize: size_t,
    compressionLevel: ::std::os::raw::c_int,
    ) -> size_t;
    }
    extern "C" {
    pub fn ZSTD_isError(code: size_t) -> ::std::os::raw::c_uint;
    }
    extern "C" {
    pub fn ZSTD_getErrorName(code: size_t) -> *const ::std::os::raw::c_char;
    }
    #[repr(C)]
    #[derive(Debug, Copy, Clone)]
    pub struct ZSTD_CCtx_s {
    _unused: [u8; 0],
    }
    #[doc = " Explicit context"]
    pub type ZSTD_CCtx = ZSTD_CCtx_s;
    #[repr(C)]
    #[derive(Debug, Copy, Clone)]
    pub struct ZSTD_DCtx_s {
    _unused: [u8; 0],
    }
    pub type ZSTD_DCtx = ZSTD_DCtx_s;
    #[doc = " Streaming"]
    #[repr(C)]
    #[derive(Debug, Copy, Clone)]
    pub struct ZSTD_inBuffer_s {
    #[doc = "< start of input buffer"]
    pub src: *const ::std::os::raw::c_void,
    #[doc = "< size of input buffer"]
    pub size: size_t,
    #[doc = "< position where reading stopped. Will be updated. Necessarily 0 <= pos <= size"]
    pub pos: size_t,
    }
    pub type ZSTD_inBuffer = ZSTD_inBuffer_s;
    #[repr(C)]
    #[derive(Debug, Copy, Clone)]
    pub struct ZSTD_outBuffer_s {
    #[doc = "< start of output buffer"]
    pub dst: *mut ::std::os::raw::c_void,
    #[doc = "< size of output buffer"]
    pub size: size_t,
    #[doc = "< position where writing stopped. Will be updated. Necessarily 0 <= pos <= size"]
    pub pos: size_t,
    }
    pub type ZSTD_outBuffer = ZSTD_outBuffer_s;
    pub type ZSTD_CStream = ZSTD_CCtx;
    extern "C" {
    pub fn ZSTD_createCStream() -> *mut ZSTD_CStream;
    }
    extern "C" {
    pub fn ZSTD_freeCStream(zcs: *mut ZSTD_CStream) -> size_t;
    }
    pub type ZSTD_EndDirective = ::std::os::raw::c_uint;
    extern "C" {
    #[doc = " ZSTD_compressStream2() :"]
    #[doc = " Behaves about the same as ZSTD_compressStream, with additional control on end directive."]
    #[doc = " - Compression parameters are pushed into CCtx before starting compression, using ZSTD_CCtx_set*()"]
    #[doc = " - Compression parameters cannot be changed once compression is started (save a list of exceptions in multi-threading mode)"]
    #[doc = " - output->pos must be <= dstCapacity, input->pos must be <= srcSize"]
    #[doc = " - output->pos and input->pos will be updated. They are guaranteed to remain below their respective limit."]
    #[doc = " - When nbWorkers==0 (default), function is blocking : it completes its job before returning to caller."]
    #[doc = " - When nbWorkers>=1, function is non-blocking : it just acquires a copy of input, and distributes jobs to internal worker threads, flush whatever is available,"]
    #[doc = " and then immediately returns, just indicating that there is some data remaining to be flushed."]
    #[doc = " The function nonetheless guarantees forward progress : it will return only after it reads or write at least 1+ byte."]
    #[doc = " - 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."]
    #[doc = " - @return provides a minimum amount of data remaining to be flushed from internal buffers"]
    #[doc = " or an error code, which can be tested using ZSTD_isError()."]
    #[doc = " if @return != 0, flush is not fully completed, there is still some data left within internal buffers."]
    #[doc = " This is useful for ZSTD_e_flush, since in this case more flushes are necessary to empty all buffers."]
    #[doc = " For ZSTD_e_end, @return == 0 when internal buffers are fully flushed and frame is completed."]
    #[doc = " - after a ZSTD_e_end directive, if internal buffer is not fully flushed (@return != 0),"]
    #[doc = " only ZSTD_e_end or ZSTD_e_flush operations are allowed."]
    #[doc = " Before starting a new compression job, or changing compression parameters,"]
    #[doc = " it is required to fully flush internal buffers."]
    pub fn ZSTD_compressStream2(
    cctx: *mut ZSTD_CCtx,
    output: *mut ZSTD_outBuffer,
    input: *mut ZSTD_inBuffer,
    endOp: ZSTD_EndDirective,
    ) -> size_t;
    }
    extern "C" {
    pub fn ZSTD_CStreamInSize() -> size_t;
    }
    extern "C" {
    pub fn ZSTD_CStreamOutSize() -> size_t;
    }
    extern "C" {
    #[doc = " Equivalent to:"]
    #[doc = ""]
    #[doc = " ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only);"]
    #[doc = " ZSTD_CCtx_refCDict(zcs, NULL); // clear the dictionary (if any)"]
    #[doc = " ZSTD_CCtx_setParameter(zcs, ZSTD_c_compressionLevel, compressionLevel);"]
    pub fn ZSTD_initCStream(
    zcs: *mut ZSTD_CStream,
    compressionLevel: ::std::os::raw::c_int,
    ) -> size_t;
    }
    extern "C" {
    #[doc = " Alternative for ZSTD_compressStream2(zcs, output, input, ZSTD_e_continue)."]
    #[doc = " NOTE: The return value is different. ZSTD_compressStream() returns a hint for"]
    #[doc = " the next read size (if non-zero and not an error). ZSTD_compressStream2()"]
    #[doc = " returns the minimum nb of bytes left to flush (if non-zero and not an error)."]
    pub fn ZSTD_compressStream(
    zcs: *mut ZSTD_CStream,
    output: *mut ZSTD_outBuffer,
    input: *mut ZSTD_inBuffer,
    ) -> size_t;
    }
    extern "C" {
    #[doc = " Equivalent to ZSTD_compressStream2(zcs, output, &emptyInput, ZSTD_e_flush)."]
    pub fn ZSTD_flushStream(zcs: *mut ZSTD_CStream, output: *mut ZSTD_outBuffer) -> size_t;
    }
    extern "C" {
    #[doc = " Equivalent to ZSTD_compressStream2(zcs, output, &emptyInput, ZSTD_e_end)."]
    pub fn ZSTD_endStream(zcs: *mut ZSTD_CStream, output: *mut ZSTD_outBuffer) -> size_t;
    }
    pub type ZSTD_DStream = ZSTD_DCtx;
    extern "C" {
    pub fn ZSTD_createDStream() -> *mut ZSTD_DStream;
    }
    extern "C" {
    pub fn ZSTD_freeDStream(zds: *mut ZSTD_DStream) -> size_t;
    }
    extern "C" {
    pub fn ZSTD_initDStream(zds: *mut ZSTD_DStream) -> size_t;
    }
    extern "C" {
    pub fn ZSTD_decompressStream(
    zds: *mut ZSTD_DStream,
    output: *mut ZSTD_outBuffer,
    input: *mut ZSTD_inBuffer,
    ) -> size_t;
    }
    extern "C" {
    pub fn ZSTD_DStreamOutSize() -> size_t;
    }
    #[repr(C)]
    #[derive(Debug, Copy, Clone)]
    pub struct ZSTD_seekable_CStream_s {
    _unused: [u8; 0],
    }
    pub type ZSTD_seekable_CStream = ZSTD_seekable_CStream_s;
    #[repr(C)]
    #[derive(Debug, Copy, Clone)]
    pub struct ZSTD_seekable_s {
    _unused: [u8; 0],
    }
    pub type ZSTD_seekable = ZSTD_seekable_s;
    extern "C" {
    pub fn ZSTD_seekable_createCStream() -> *mut ZSTD_seekable_CStream;
    }
    extern "C" {
    pub fn ZSTD_seekable_freeCStream(zcs: *mut ZSTD_seekable_CStream) -> size_t;
    }
    extern "C" {
    pub fn ZSTD_seekable_initCStream(
    zcs: *mut ZSTD_seekable_CStream,
    compressionLevel: ::std::os::raw::c_int,
    checksumFlag: ::std::os::raw::c_int,
    maxFrameSize: ::std::os::raw::c_uint,
    ) -> size_t;
    }
    extern "C" {
    pub fn ZSTD_seekable_compressStream(
    zcs: *mut ZSTD_seekable_CStream,
    output: *mut ZSTD_outBuffer,
    input: *mut ZSTD_inBuffer,
    ) -> size_t;
    }
    extern "C" {
    pub fn ZSTD_seekable_endStream(
    zcs: *mut ZSTD_seekable_CStream,
    output: *mut ZSTD_outBuffer,
    ) -> size_t;
    }
    #[repr(C)]
    #[derive(Debug, Copy, Clone)]
    pub struct ZSTD_frameLog_s {
    _unused: [u8; 0],
    }
    pub type ZSTD_frameLog = ZSTD_frameLog_s;
    extern "C" {
    pub fn ZSTD_seekable_createFrameLog(checksumFlag: ::std::os::raw::c_int) -> *mut ZSTD_frameLog;
    }
    extern "C" {
    pub fn ZSTD_seekable_freeFrameLog(fl: *mut ZSTD_frameLog) -> size_t;
    }
    extern "C" {
    pub fn ZSTD_seekable_logFrame(
    fl: *mut ZSTD_frameLog,
    compressedSize: ::std::os::raw::c_uint,
    decompressedSize: ::std::os::raw::c_uint,
    checksum: ::std::os::raw::c_uint,
    ) -> size_t;
    }
    extern "C" {
    pub fn ZSTD_seekable_writeSeekTable(
    fl: *mut ZSTD_frameLog,
    output: *mut ZSTD_outBuffer,
    ) -> size_t;
    }
    extern "C" {
    pub fn ZSTD_seekable_create() -> *mut ZSTD_seekable;
    }
    extern "C" {
    pub fn ZSTD_seekable_free(zs: *mut ZSTD_seekable) -> size_t;
    }
    extern "C" {
    pub fn ZSTD_seekable_initBuff(
    zs: *mut ZSTD_seekable,
    src: *const ::std::os::raw::c_void,
    srcSize: size_t,
    ) -> size_t;
    }
    extern "C" {
    pub fn ZSTD_seekable_initFile(zs: *mut ZSTD_seekable, src: *mut libc::FILE) -> size_t;
    }
    extern "C" {
    pub fn ZSTD_seekable_decompress(
    zs: *mut ZSTD_seekable,
    dst: *mut ::std::os::raw::c_void,
    dstSize: size_t,
    offset: ::std::os::raw::c_ulonglong,
    ) -> size_t;
    }
    extern "C" {
    pub fn ZSTD_seekable_decompressFrame(
    zs: *mut ZSTD_seekable,
    dst: *mut ::std::os::raw::c_void,
    dstSize: size_t,
    frameIndex: ::std::os::raw::c_uint,
    ) -> size_t;
    }
    extern "C" {
    pub fn ZSTD_seekable_getNumFrames(zs: *mut ZSTD_seekable) -> ::std::os::raw::c_uint;
    }
    extern "C" {
    pub fn ZSTD_seekable_getFrameCompressedOffset(
    zs: *mut ZSTD_seekable,
    frameIndex: ::std::os::raw::c_uint,
    ) -> ::std::os::raw::c_ulonglong;
    }
    extern "C" {
    pub fn ZSTD_seekable_getFrameDecompressedOffset(
    zs: *mut ZSTD_seekable,
    frameIndex: ::std::os::raw::c_uint,
    ) -> ::std::os::raw::c_ulonglong;
    }
    extern "C" {
    pub fn ZSTD_seekable_getFrameCompressedSize(
    zs: *mut ZSTD_seekable,
    frameIndex: ::std::os::raw::c_uint,
    ) -> size_t;
    }
    extern "C" {
    pub fn ZSTD_seekable_getFrameDecompressedSize(
    zs: *mut ZSTD_seekable,
    frameIndex: ::std::os::raw::c_uint,
    ) -> size_t;
    }
    extern "C" {
    pub fn ZSTD_seekable_offsetToFrameIndex(
    zs: *mut ZSTD_seekable,
    offset: ::std::os::raw::c_ulonglong,
    ) -> ::std::os::raw::c_uint;
    }
    pub type ZSTD_seekable_read = ::std::option::Option<
    unsafe extern "C" fn(
    opaque: *mut ::std::os::raw::c_void,
    buffer: *mut ::std::os::raw::c_void,
    n: size_t,
    ) -> ::std::os::raw::c_int,
    >;
    pub type ZSTD_seekable_seek = ::std::option::Option<
    unsafe extern "C" fn(
    opaque: *mut ::std::os::raw::c_void,
    offset: ::std::os::raw::c_longlong,
    origin: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int,
    >;
    #[repr(C)]
    #[derive(Debug, Copy, Clone)]
    pub struct ZSTD_seekable_customFile {
    pub opaque: *mut ::std::os::raw::c_void,
    pub read: ZSTD_seekable_read,
    pub seek: ZSTD_seekable_seek,
    }
    extern "C" {
    pub fn ZSTD_seekable_initAdvanced(
    zs: *mut ZSTD_seekable,
    src: ZSTD_seekable_customFile,
    ) -> size_t;
    }
  • replacement in default.nix at line 5
    [2.265968][2.265968:266031]()
    buildInputs = [ pkgconfig llvmPackages.libclang.lib cmake ];
    [2.265968]
    [2.266031]
    buildInputs = [ pkgconfig llvmPackages.libclang.lib cmake rust-bindgen ];
  • replacement in build.rs at line 1
    [2.266097][2.266098:266136]()
    use std::env;
    use std::path::PathBuf;
    [2.266097]
    [2.266136]
    /*use std::env;
    use std::path::PathBuf;*/
  • edit in build.rs at line 17
    [2.266536]
    [2.266536]
    /*
  • edit in build.rs at line 77
    [2.269439]
    [2.269439]
    */
  • replacement in Cargo.toml at line 4
    [2.269755][2.269755:269773]()
    version = "0.1.1"
    [2.269755]
    [2.269773]
    version = "0.1.3"
  • edit in Cargo.toml at line 15
    [2.270088]
    [2.270088]
    "src/bindings.rs",
  • edit in Cargo.toml at line 34
    [2.270490][2.270490:270520]()
    bindgen = "0.55"
    cmake = "0.1"