| 1 | #![allow(unsafe_code)] |
| 2 | |
| 3 | use superrust-analyzer cargo lzzzz 2.0.0 common/::bindingrust-analyzer cargo lzzzz 2.0.0 common/binding/; |
| 4 | use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::ffirust-analyzer cargo std https://github.com/rust-lang/rust/library/std ffi/::CStrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ffi/c_str/CStr#; |
| 5 | |
| 6 | /// Returns the version number of liblz4. |
| 7 | /// |
| 8 | /// # Example |
| 9 | /// |
| 10 | /// ``` |
| 11 | /// assert_eq!(lzzzz::version_number(), 11000); // 1.9.4 |
| 12 | /// ``` |
| 13 | pub fn version_numberrust-analyzer cargo lzzzz 2.0.0 common/api/version_number().() -> u32 { |
| 14 | unsafe { bindingrust-analyzer cargo lzzzz 2.0.0 common/binding/::LZ4_versionNumberrust-analyzer cargo lzzzz 2.0.0 LZ4_versionNumber().() as u32 } |
| 15 | } |
| 16 | |
| 17 | /// Returns the version string of liblz4. |
| 18 | /// |
| 19 | /// # Example |
| 20 | /// |
| 21 | /// ``` |
| 22 | /// assert_eq!(lzzzz::version_string(), "1.10.0"); |
| 23 | /// ``` |
| 24 | pub fn version_stringrust-analyzer cargo lzzzz 2.0.0 common/api/version_string().() -> &'static str { |
| 25 | unsafe { |
| 26 | CStrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ffi/c_str/CStr#::from_ptrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ffi/c_str/impl#[CStr]from_ptr().(bindingrust-analyzer cargo lzzzz 2.0.0 common/binding/::LZ4_versionStringrust-analyzer cargo lzzzz 2.0.0 LZ4_versionString().()) |
| 27 | .to_strrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ffi/c_str/impl#[CStr]to_str().() |
| 28 | .unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().() |
| 29 | } |
| 30 | } |