1#![allow(non_camel_case_types, non_snake_case, non_upper_case_globals, clippy::all)]
2
3pub use libc;
4
5include!(concat!(env!("OUT_DIR"), "/bindings.rs"));
6
7extern "C" {
8 pub fn openzl_report_is_error(r: ZL_Report) -> ::std::os::raw::c_int;
9 pub fn openzl_report_value(r: ZL_Report) -> usize;
10 pub fn openzl_report_code(r: ZL_Report) -> ::std::os::raw::c_int;
11 pub fn openzl_error_code_to_string(code: ::std::os::raw::c_int) -> *const ::std::os::raw::c_char;
12 pub fn openzl_cctx_error_context(cctx: *const ZL_CCtx, r: ZL_Report) -> *const ::std::os::raw::c_char;
13 pub fn openzl_dctx_error_context(dctx: *const ZL_DCtx, r: ZL_Report) -> *const ::std::os::raw::c_char;
14 pub fn openzl_compress_bound(totalSrcSize: usize) -> usize;
15 pub fn openzl_cctx_get_warnings(cctx: *const ZL_CCtx) -> ZL_Error_Array;
16 pub fn openzl_dctx_get_warnings(dctx: *const ZL_DCtx) -> ZL_Error_Array;
17 pub fn openzl_error_get_code(err: *const ZL_Error) -> ::std::os::raw::c_int;
18 pub fn openzl_error_get_name(err: *const ZL_Error) -> *const ::std::os::raw::c_char;
19}
20
21#[inline]
22pub fn report_is_error(r: ZL_Report) -> bool { unsafe { openzl_report_is_error(r) != 0 } }
23#[inline]
24pub fn report_value(r: ZL_Report) -> usize { unsafe { openzl_report_value(r) } }
25#[inline]
26pub fn report_code(r: ZL_Report) -> i32 { unsafe { openzl_report_code(r) as i32 } }