extern crate libc;
use libc::{c_int, size_t, c_void, c_char};
pub const BLOSC_VERSION_MAJOR: u32 = 1;
pub const BLOSC_VERSION_MINOR: u32 = 7;
pub const BLOSC_VERSION_RELEASE: u32 = 1;
pub const BLOSC_VERSION_STRING: &'static str = "1.7.1.dev";
pub const BLOSC_VERSION_REVISION: &'static str = "$Rev$";
pub const BLOSC_VERSION_DATE: &'static str = "$Date:: 2015-07-05 #$";
pub const BLOSCLZ_VERSION_STRING: &'static str = "1.0.5";
pub const BLOSC_VERSION_FORMAT: u32 = 2;
pub const BLOSC_MIN_HEADER_LENGTH: u32 = 16;
pub const BLOSC_MAX_OVERHEAD: u32 = BLOSC_MIN_HEADER_LENGTH;
pub const BLOSC_MAX_BUFFERSIZE: i32 = (std::i32::MAX - BLOSC_MAX_OVERHEAD as i32);
pub const BLOSC_MAX_TYPESIZE: u32 = 255;
pub const BLOSC_MAX_THREADS: u32 = 256;
pub const BLOSC_NOSHUFFLE: u32 = 0;
pub const BLOSC_SHUFFLE: u32 = 1;
pub const BLOSC_BITSHUFFLE: u32 = 2;
pub const BLOSC_DOSHUFFLE: u32 = 0x1;
pub const BLOSC_MEMCPYED: u32 = 0x2;
pub const BLOSC_DOBITSHUFFLE: u32 = 0x4;
pub const BLOSC_BLOSCLZ: u32 = 0;
pub const BLOSC_LZ4: u32 = 1;
pub const BLOSC_LZ4HC: u32 = 2;
pub const BLOSC_SNAPPY: u32 = 3;
pub const BLOSC_ZLIB: u32 = 4;
pub const BLOSC_BLOSCLZ_COMPNAME: &'static str = "blosclz";
pub const BLOSC_LZ4_COMPNAME: &'static str = "lz4";
pub const BLOSC_LZ4HC_COMPNAME: &'static str = "lz4hc";
pub const BLOSC_SNAPPY_COMPNAME: &'static str = "snappy";
pub const BLOSC_ZLIB_COMPNAME: &'static str = "zlib";
pub const BLOSC_BLOSCLZ_LIB: u32 = 0;
pub const BLOSC_LZ4_LIB: u32 = 1;
pub const BLOSC_SNAPPY_LIB: u32 = 2;
pub const BLOSC_ZLIB_LIB: u32 = 3;
pub const BLOSC_BLOSCLZ_LIBNAME: &'static str = "BloscLZ";
pub const BLOSC_LZ4_LIBNAME: &'static str = "LZ4";
pub const BLOSC_SNAPPY_LIBNAME: &'static str = "Snappy";
pub const BLOSC_ZLIB_LIBNAME: &'static str = "Zlib";
pub const BLOSC_BLOSCLZ_FORMAT: u32 =BLOSC_BLOSCLZ_LIB;
pub const BLOSC_LZ4_FORMAT: u32 = BLOSC_LZ4_LIB;
pub const BLOSC_LZ4HC_FORMAT: u32 = BLOSC_LZ4_LIB;
pub const BLOSC_SNAPPY_FORMAT: u32 = BLOSC_SNAPPY_LIB;
pub const BLOSC_ZLIB_FORMAT: u32 = BLOSC_ZLIB_LIB;
pub const BLOSC_BLOSCLZ_VERSION_FORMAT: u32 = 1;
pub const BLOSC_LZ4_VERSION_FORMAT: u32 = 1;
pub const BLOSC_LZ4HC_VERSION_FORMAT: u32 = 1;
pub const BLOSC_SNAPPY_VERSION_FORMAT: u32 = 1;
pub const BLOSC_ZLIB_VERSION_FORMAT: u32 = 1;
extern "C" {
pub fn blosc_init();
pub fn blosc_destroy();
pub fn blosc_compress(clevel: c_int, doshuffle: c_int, typesize: size_t, nbytes: size_t, src: *const c_void, dest: *mut c_void, destsize: size_t) -> c_int;
pub fn blosc_compress_ctx(clevel: c_int, doshuffle: c_int, typesize: size_t, nbytes: size_t, src: *const c_void, dest: *mut c_void, destsize: size_t, compressor: *const u8, blocksize: size_t, numinternalthreads: c_int) -> c_int;
pub fn blosc_decompress(src: *const c_void, dest: *mut c_void, destsize: size_t, numinternalthreads: c_int) -> c_int;
pub fn blosc_decompress_ctx(src: *const c_void, dest: *mut c_void, destsize: size_t, numinternalthreads: c_int) -> c_int;
pub fn blosc_getitem(src: *const c_void, start: c_int, nitems: c_int, dest: *mut c_void) -> c_int;
pub fn blosc_set_nthreads(nthreads: c_int) -> c_int;
pub fn blosc_set_compressor(compname: *const c_char) -> c_int;
pub fn blosc_compcode_to_compname(compcode: c_int, copmname: *mut *mut c_char) -> c_int;
pub fn blosc_compname_to_compcode(compname: *const c_char) -> c_int;
pub fn blosc_list_compressors() -> *const c_char;
pub fn blosc_get_version_string() -> *const c_char;
pub fn blosc_get_complib_info(compname: *mut c_char, complib: *mut *mut c_char, version: *mut *mut c_char) -> c_int;
pub fn blosc_free_resources();
pub fn blosc_cbuffer_sizes(cbuffer: *const c_void, nbytes: *mut size_t, cbytes: *mut size_t, blocksize: *mut size_t);
pub fn blosc_cbuffer_metainfo(cbuffer: *const c_void, typesize: *mut size_t, flags: *mut c_int);
pub fn blosc_cbuffer_versions(cbuffer: *const c_void, version: *mut c_int, versionlz: *mut c_int);
pub fn blosc_cbuffer_complib(cbuffer: *const c_void) -> *mut c_char;
pub fn blosc_set_blocksize(blocksize: size_t);
}