lzfse-sys 2.0.0

Crate to build the LZFSE reference implementation for lzfse-rs.
Documentation
/* automatically generated by rust-bindgen 0.68.1 */

extern "C" {
    #[doc = " @abstract Get the required scratch buffer size to compress using LZFSE."]
    pub fn lzfse_encode_scratch_size() -> usize;
}
extern "C" {
    #[doc = " @abstract Compress a buffer using LZFSE.\n\n  @param dst_buffer\n  Pointer to the first byte of the destination buffer.\n\n  @param dst_size\n  Size of the destination buffer in bytes.\n\n  @param src_buffer\n  Pointer to the first byte of the source buffer.\n\n  @param src_size\n  Size of the source buffer in bytes.\n\n  @param scratch_buffer\n  If non-NULL, a pointer to scratch space for the routine to use as workspace;\n  the routine may use up to lzfse_encode_scratch_size( ) bytes of workspace\n  during its operation, and will not perform any internal allocations. If\n  NULL, the routine may allocate its own memory to use during operation via\n  a single call to malloc( ), and will release it by calling free( ) prior\n  to returning. For most use, passing NULL is perfectly satisfactory, but if\n  you require strict control over allocation, you will want to pass an\n  explicit scratch buffer.\n\n  @return\n  The number of bytes written to the destination buffer if the input is\n  successfully compressed. If the input cannot be compressed to fit into\n  the provided buffer, or an error occurs, zero is returned, and the\n  contents of dst_buffer are unspecified."]
    pub fn lzfse_encode_buffer(
        dst_buffer: *mut u8,
        dst_size: usize,
        src_buffer: *const u8,
        src_size: usize,
        scratch_buffer: *mut ::core::ffi::c_void,
    ) -> usize;
}
extern "C" {
    #[doc = " @abstract Get the required scratch buffer size to decompress using LZFSE."]
    pub fn lzfse_decode_scratch_size() -> usize;
}
extern "C" {
    #[doc = " @abstract Decompress a buffer using LZFSE.\n\n  @param dst_buffer\n  Pointer to the first byte of the destination buffer.\n\n  @param dst_size\n  Size of the destination buffer in bytes.\n\n  @param src_buffer\n  Pointer to the first byte of the source buffer.\n\n  @param src_size\n  Size of the source buffer in bytes.\n\n  @param scratch_buffer\n  If non-NULL, a pointer to scratch space for the routine to use as workspace;\n  the routine may use up to lzfse_decode_scratch_size( ) bytes of workspace\n  during its operation, and will not perform any internal allocations. If\n  NULL, the routine may allocate its own memory to use during operation via\n  a single call to malloc( ), and will release it by calling free( ) prior\n  to returning. For most use, passing NULL is perfectly satisfactory, but if\n  you require strict control over allocation, you will want to pass an\n  explicit scratch buffer.\n\n  @return\n  The number of bytes written to the destination buffer if the input is\n  successfully decompressed. If there is not enough space in the destination\n  buffer to hold the entire expanded output, only the first dst_size bytes\n  will be written to the buffer and dst_size is returned. Note that this\n  behavior differs from that of lzfse_encode_buffer."]
    pub fn lzfse_decode_buffer(
        dst_buffer: *mut u8,
        dst_size: usize,
        src_buffer: *const u8,
        src_size: usize,
        scratch_buffer: *mut ::core::ffi::c_void,
    ) -> usize;
}