fix(raw.rs): pkg_cache_find_name_arch function signature

Removed from the function signature the parameter (arch: *const c_char) for alt-linux cfg
This commit is contained in:
Константин Козориз 2024-10-24 11:46:21 +03:00
parent c7c7159bb1
commit 9a359a5e63
2 changed files with 13 additions and 0 deletions

View File

@ -35,10 +35,17 @@ extern "C" {
pub fn pkg_cache_pkg_iter(cache: PCache) -> PPkgIterator;
pub fn pkg_cache_find_name(cache: PCache, name: *const c_char) -> PPkgIterator;
#[cfg(feature = "alt-linux")]
pub fn pkg_cache_find_name_arch(
cache: PCache,
name: *const c_char,
) -> PPkgIterator;
#[cfg(not(feature = "alt-linux"))]
pub fn pkg_cache_find_name_arch(
cache: PCache,
name: *const c_char,
) -> PPkgIterator;
pub fn pkg_iter_release(iterator: PPkgIterator);
pub fn pkg_iter_next(iterator: PPkgIterator);

View File

@ -66,7 +66,13 @@ impl Cache {
unsafe {
let name = ffi::CString::new(name).unwrap();
let arch = ffi::CString::new(arch).unwrap();
#[cfg(feature = "alt-linux")]
let ptr = raw::pkg_cache_find_name_arch(lock.ptr, name.as_ptr());
#[cfg(not(feature = "alt-linux"))]
let ptr = raw::pkg_cache_find_name_arch(lock.ptr, name.as_ptr(), arch.as_ptr());
PkgIterator::new(lock, ptr)
}
}