libwebp_sys/types.rs
1#[cfg(feature = "0_5")]
2use std::os::raw::*;
3
4/// Macro to check ABI compatibility (same major revision number)
5#[allow(non_snake_case)]
6#[inline]
7pub const fn WEBP_ABI_IS_INCOMPATIBLE(a: u16, b: u16) -> bool {
8 (a >> 8) != (b >> 8)
9}
10
11extern "C" {
12 /// Allocates `size` bytes of memory. Returns NULL upon error. Memory
13 /// must be deallocated by calling `WebPFree()`. This function is made available
14 /// by the core `libwebp` library.
15 #[cfg(feature = "1_1")]
16 #[cfg_attr(feature = "must-use", must_use)]
17 pub fn WebPMalloc(size: usize) -> *mut c_void;
18 /// Releases memory returned by the `WebPDecode*()` functions (from `decode.h`).
19 #[cfg(feature = "0_5")]
20 pub fn WebPFree(ptr: *mut c_void);
21}