bzip2-sys-0.1.9+1.0.8/.cargo_vcs_info.json0000644000000001121366347167200134540ustar00{ "git": { "sha1": "ea8fc591ff34ef9398731aa05e1201975b35fa54" } } bzip2-sys-0.1.9+1.0.8/Cargo.toml0000644000000022201366347167200114540ustar00# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO # # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies # to registry (e.g., crates.io) dependencies # # If you believe there's an error in this file please file an # issue against the rust-lang/cargo repository. If you're # editing this file be aware that the upstream Cargo.toml # will likely look very different (and much more reasonable) [package] name = "bzip2-sys" version = "0.1.9+1.0.8" authors = ["Alex Crichton "] build = "build.rs" links = "bzip2" description = "Bindings to libbzip2 for bzip2 compression and decompression exposed as\nReader/Writer streams.\n" homepage = "https://github.com/alexcrichton/bzip2-rs" documentation = "https://docs.rs/bzip2-sys" categories = ["external-ffi-bindings"] license = "MIT/Apache-2.0" repository = "https://github.com/alexcrichton/bzip2-rs" [lib] name = "bzip2_sys" path = "lib.rs" [dependencies.libc] version = "0.2" [build-dependencies.cc] version = "1.0" [build-dependencies.pkg-config] version = "0.3.9" bzip2-sys-0.1.9+1.0.8/Cargo.toml.orig0000644000000011321366347167200124140ustar00[package] name = "bzip2-sys" version = "0.1.9+1.0.8" authors = ["Alex Crichton "] links = "bzip2" build = "build.rs" license = "MIT/Apache-2.0" repository = "https://github.com/alexcrichton/bzip2-rs" homepage = "https://github.com/alexcrichton/bzip2-rs" documentation = "https://docs.rs/bzip2-sys" description = """ Bindings to libbzip2 for bzip2 compression and decompression exposed as Reader/Writer streams. """ categories = ["external-ffi-bindings"] [lib] name = "bzip2_sys" path = "lib.rs" [dependencies] libc = "0.2" [build-dependencies] pkg-config = "0.3.9" cc = "1.0" bzip2-sys-0.1.9+1.0.8/Cargo.toml.orig010066400017500001750000000011321366347164200151460ustar0000000000000000[package] name = "bzip2-sys" version = "0.1.9+1.0.8" authors = ["Alex Crichton "] links = "bzip2" build = "build.rs" license = "MIT/Apache-2.0" repository = "https://github.com/alexcrichton/bzip2-rs" homepage = "https://github.com/alexcrichton/bzip2-rs" documentation = "https://docs.rs/bzip2-sys" description = """ Bindings to libbzip2 for bzip2 compression and decompression exposed as Reader/Writer streams. """ categories = ["external-ffi-bindings"] [lib] name = "bzip2_sys" path = "lib.rs" [dependencies] libc = "0.2" [build-dependencies] pkg-config = "0.3.9" cc = "1.0" bzip2-sys-0.1.9+1.0.8/build.rs010066400017500001750000000025131366347163300137300ustar0000000000000000extern crate cc; extern crate pkg_config; use std::path::PathBuf; use std::{env, fs}; fn main() { let mut cfg = cc::Build::new(); let target = env::var("TARGET").unwrap(); cfg.warnings(false); if target.contains("windows") { cfg.define("_WIN32", None); cfg.define("BZ_EXPORT", None); } else { if pkg_config::Config::new() .cargo_metadata(true) .probe("bzip2") .is_ok() { return; } } let dst = PathBuf::from(env::var_os("OUT_DIR").unwrap()); cfg.include("bzip2-1.0.8") .define("_FILE_OFFSET_BITS", Some("64")) .define("BZ_NO_STDIO", None) .file("bzip2-1.0.8/blocksort.c") .file("bzip2-1.0.8/huffman.c") .file("bzip2-1.0.8/crctable.c") .file("bzip2-1.0.8/randtable.c") .file("bzip2-1.0.8/compress.c") .file("bzip2-1.0.8/decompress.c") .file("bzip2-1.0.8/bzlib.c") .out_dir(dst.join("lib")) .compile("libbz2.a"); let src = env::current_dir().unwrap().join("bzip2-1.0.8"); let include = dst.join("include"); fs::create_dir_all(&include).unwrap(); fs::copy(src.join("bzlib.h"), dst.join("include/bzlib.h")).unwrap(); println!("cargo:root={}", dst.display()); println!("cargo:include={}", dst.join("include").display()); } bzip2-sys-0.1.9+1.0.8/lib.rs010066400017500001750000000044201353027035500133650ustar0000000000000000#![doc(html_root_url = "https://docs.rs/bzip2-sys/0.1")] extern crate libc; use libc::{c_char, c_int, c_uint, c_void}; pub const BZ_RUN: c_int = 0; pub const BZ_FLUSH: c_int = 1; pub const BZ_FINISH: c_int = 2; pub const BZ_OK: c_int = 0; pub const BZ_RUN_OK: c_int = 1; pub const BZ_FLUSH_OK: c_int = 2; pub const BZ_FINISH_OK: c_int = 3; pub const BZ_STREAM_END: c_int = 4; pub const BZ_SEQUENCE_ERROR: c_int = -1; pub const BZ_PARAM_ERROR: c_int = -2; pub const BZ_MEM_ERROR: c_int = -3; pub const BZ_DATA_ERROR: c_int = -4; pub const BZ_DATA_ERROR_MAGIC: c_int = -5; pub const BZ_IO_ERROR: c_int = -6; pub const BZ_UNEXPECTED_EOF: c_int = -7; pub const BZ_OUTBUFF_FULL: c_int = -8; pub const BZ_CONFIG_ERROR: c_int = -9; #[repr(C)] pub struct bz_stream { pub next_in: *mut c_char, pub avail_in: c_uint, pub total_in_lo32: c_uint, pub total_in_hi32: c_uint, pub next_out: *mut c_char, pub avail_out: c_uint, pub total_out_lo32: c_uint, pub total_out_hi32: c_uint, pub state: *mut c_void, pub bzalloc: Option *mut c_void>, pub bzfree: Option, pub opaque: *mut c_void, } macro_rules! abi_compat { ($(pub fn $name:ident($($arg:ident: $t:ty),*) -> $ret:ty,)*) => { #[cfg(windows)] extern "system" { $(pub fn $name($($arg: $t),*) -> $ret;)* } #[cfg(any(unix, target_os = "redox"))] extern { $(pub fn $name($($arg: $t),*) -> $ret;)* } } } abi_compat! { pub fn BZ2_bzCompressInit(stream: *mut bz_stream, blockSize100k: c_int, verbosity: c_int, workFactor: c_int) -> c_int, pub fn BZ2_bzCompress(stream: *mut bz_stream, action: c_int) -> c_int, pub fn BZ2_bzCompressEnd(stream: *mut bz_stream) -> c_int, pub fn BZ2_bzDecompressInit(stream: *mut bz_stream, verbosity: c_int, small: c_int) -> c_int, pub fn BZ2_bzDecompress(stream: *mut bz_stream) -> c_int, pub fn BZ2_bzDecompressEnd(stream: *mut bz_stream) -> c_int, } #[no_mangle] pub fn bz_internal_error(errcode: c_int) { panic!("bz internal error: {}", errcode); }