use crate::ffi::version::Version;
use crate::global::get_interface;
use crate::version::{Error, ReleaseType, VersionAPI};
use std::cmp::Ordering;
#[inline]
pub fn new_short(major: i32, minor: i32, patch: i32) -> Version {
VersionAPI::new_short(get_interface(), major, minor, patch)
}
#[inline]
pub fn new_long(
major: i32,
minor: i32,
patch: i32,
release_type: ReleaseType,
release_number: i8,
) -> Version {
VersionAPI::new_long(
get_interface(),
major,
minor,
patch,
release_type,
release_number,
)
}
#[inline]
pub fn new_full(
major: i32,
minor: i32,
patch: i32,
release_type: ReleaseType,
release_number: i8,
build: i64,
) -> Version {
VersionAPI::new_full(
get_interface(),
major,
minor,
patch,
release_type,
release_number,
build,
)
}
#[inline]
pub fn from_string(buffer: impl AsRef<str>) -> Result<Version, Error> {
VersionAPI::from_string(get_interface(), buffer)
}
#[inline]
pub fn string_length_short(version: &Version) -> usize {
VersionAPI::string_length_short(get_interface(), version)
}
#[inline]
pub fn string_length_long(version: &Version) -> usize {
VersionAPI::string_length_long(get_interface(), version)
}
#[inline]
pub fn string_length_full(version: &Version) -> usize {
VersionAPI::string_length_full(get_interface(), version)
}
#[inline]
pub fn as_string_short(version: &Version, buffer: impl AsMut<str>) -> Result<usize, Error> {
VersionAPI::as_string_short(get_interface(), version, buffer)
}
#[inline]
pub fn as_string_long(version: &Version, buffer: impl AsMut<str>) -> Result<usize, Error> {
VersionAPI::as_string_long(get_interface(), version, buffer)
}
#[inline]
pub fn as_string_full(version: &Version, buffer: impl AsMut<str>) -> Result<usize, Error> {
VersionAPI::as_string_full(get_interface(), version, buffer)
}
#[inline]
pub fn string_is_valid(version_string: impl AsRef<str>) -> bool {
VersionAPI::string_is_valid(get_interface(), version_string)
}
#[inline]
pub fn compare(lhs: &Version, rhs: &Version) -> Ordering {
VersionAPI::compare(get_interface(), lhs, rhs)
}
#[inline]
pub fn compare_weak(lhs: &Version, rhs: &Version) -> Ordering {
VersionAPI::compare_weak(get_interface(), lhs, rhs)
}
#[inline]
pub fn compare_strong(lhs: &Version, rhs: &Version) -> Ordering {
VersionAPI::compare_strong(get_interface(), lhs, rhs)
}
#[inline]
pub fn is_compatible(lhs: &Version, rhs: &Version) -> bool {
VersionAPI::is_compatible(get_interface(), lhs, rhs)
}