snappy_sys/
lib.rs

1extern crate libc;
2
3use libc::{c_int, size_t};
4
5#[link(name = "snappy")]
6extern {
7    pub fn snappy_compress(input: *const u8,
8                           input_length: size_t,
9                           compressed: *mut u8,
10                           compressed_length: *mut size_t) -> c_int;
11    pub fn snappy_uncompress(compressed: *const u8,
12                             compressed_length: size_t,
13                             uncompressed: *mut u8,
14                             uncompressed_length: *mut size_t) -> c_int;
15    pub fn snappy_max_compressed_length(source_length: size_t) -> size_t;
16    pub fn snappy_uncompressed_length(compressed: *const u8,
17                                      compressed_length: size_t,
18                                      result: *mut size_t) -> c_int;
19    pub fn snappy_validate_compressed_buffer(compressed: *const u8,
20                                             compressed_length: size_t) -> c_int;
21}