use std::os::raw::c_char;
pub enum Compatibility {
V4Plus,
V5Plus,
V6Plus,
V8Plus,
V12Plus,
V13Plus,
}
#[cfg(any(feature = "pa_v13", all(feature = "dox", not(feature = "pa_v5"))))]
mod actual {
pub const COMPATIBILITY: super::Compatibility = super::Compatibility::V13Plus;
pub const TARGET_VERSION_STRING: &str = "13.0.0";
pub const TARGET_VERSION: (u8, u8) = (13, 0);
pub const PA_PROTOCOL_VERSION: u16 = 33;
}
#[cfg(all(not(feature = "pa_v13"), feature = "pa_v12"))]
mod actual {
pub const COMPATIBILITY: super::Compatibility = super::Compatibility::V12Plus;
pub const TARGET_VERSION_STRING: &str = "12.0.0";
pub const TARGET_VERSION: (u8, u8) = (12, 0);
pub const PA_PROTOCOL_VERSION: u16 = 32;
}
#[cfg(all(not(feature = "pa_v12"), feature = "pa_v8"))]
mod actual {
pub const COMPATIBILITY: super::Compatibility = super::Compatibility::V8Plus;
pub const TARGET_VERSION_STRING: &str = "11.0.0";
pub const TARGET_VERSION: (u8, u8) = (11, 0);
pub const PA_PROTOCOL_VERSION: u16 = 32;
}
#[cfg(all(not(feature = "pa_v8"), feature = "pa_v6"))]
mod actual {
pub const COMPATIBILITY: super::Compatibility = super::Compatibility::V6Plus;
pub const TARGET_VERSION_STRING: &str = "7.0.0";
pub const TARGET_VERSION: (u8, u8) = (7, 0);
pub const PA_PROTOCOL_VERSION: u16 = 30;
}
#[cfg(all(not(feature = "pa_v6"), feature = "pa_v5"))]
mod actual {
pub const COMPATIBILITY: super::Compatibility = super::Compatibility::V5Plus;
pub const TARGET_VERSION_STRING: &str = "5.0.0";
pub const TARGET_VERSION: (u8, u8) = (5, 0);
pub const PA_PROTOCOL_VERSION: u16 = 29;
}
#[cfg(all(not(feature = "pa_v5"), not(feature = "dox")))]
mod actual {
pub const COMPATIBILITY: super::Compatibility = super::Compatibility::V4Plus;
pub const TARGET_VERSION_STRING: &str = "4.0.0";
pub const TARGET_VERSION: (u8, u8) = (4, 0);
pub const PA_PROTOCOL_VERSION: u16 = 28;
}
pub const TARGET_VERSION_STRING: &str = actual::TARGET_VERSION_STRING;
pub const TARGET_VERSION: (u8, u8) = actual::TARGET_VERSION;
pub const PA_PROTOCOL_VERSION: u16 = actual::PA_PROTOCOL_VERSION;
pub const PA_API_VERSION: u8 = 12;
#[inline(always)]
pub const fn get_compatibility() -> Compatibility {
actual::COMPATIBILITY
}
#[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;
}