use std::os::raw::c_char;
pub use self::actual::{TARGET_VERSION_STRING, TARGET_VERSION};
pub enum Compatibility {
Latest,
PreV12,
}
#[cfg(feature="pa_v12_compatibility")]
mod actual {
pub const COMPATIBILITY: super::Compatibility = super::Compatibility::Latest;
pub const TARGET_VERSION_STRING: &str = "12.0.0";
pub const TARGET_VERSION: (u8, u8) = (12, 0);
}
#[cfg(not(feature="pa_v12_compatibility"))]
mod actual {
pub const COMPATIBILITY: super::Compatibility = super::Compatibility::PreV12;
pub const TARGET_VERSION_STRING: &str = "11.0.0";
pub const TARGET_VERSION: (u8, u8) = (11, 0);
}
#[deprecated(since = "1.4.0", note="use `TARGET_VERSION_STRING` instead")]
pub const LINK_TARGET_VERSION: &str = TARGET_VERSION_STRING;
pub const PA_API_VERSION: u8 = 12;
pub const PA_PROTOCOL_VERSION: u16 = 32;
#[deprecated(since = "1.4.0", note="use `TARGET_VERSION` instead")]
pub const PA_MAJOR: u8 = TARGET_VERSION.0;
#[deprecated(since = "1.4.0", note="use `TARGET_VERSION` instead")]
pub const PA_MINOR: u8 = TARGET_VERSION.1;
#[deprecated(since = "1.4.0", note="not useful, always zero")]
pub const PA_MICRO: u8 = 0;
#[inline(always)]
pub fn get_compatibility() -> Compatibility {
actual::COMPATIBILITY
}
#[deprecated(since = "1.4.0", note="not useful, confusing name, use `TARGET_VERSION_STRING` directly or `get_compatibility()` instead")]
#[inline(always)]
pub fn pa_get_headers_version() -> &'static str {
#[allow(deprecated)]
LINK_TARGET_VERSION
}
#[inline(always)]
pub fn pa_check_version(major: u8, minor: u8, _micro: u8) -> bool {
(TARGET_VERSION.0 > major) ||
(TARGET_VERSION.0 == major && TARGET_VERSION.1 > minor)
}
#[link(name="pulse")]
extern "C" {
pub fn pa_get_library_version() -> *const c_char;
}