From 130f0c283988068573d97ecbb40f51a989902037 Mon Sep 17 00:00:00 2001 From: Felix Krull Date: Thu, 23 Jul 2020 16:08:41 +0200 Subject: [PATCH] Update gir version and regenerate --- rust-bindings/rust/Makefile | 2 +- rust-bindings/rust/src/auto/async_progress.rs | 4 +- rust-bindings/rust/src/auto/constants.rs | 60 ++----- rust-bindings/rust/src/auto/enums.rs | 13 ++ rust-bindings/rust/src/auto/functions.rs | 24 ++- rust-bindings/rust/src/auto/mod.rs | 4 + rust-bindings/rust/src/auto/mutable_tree.rs | 28 ++-- rust-bindings/rust/src/auto/repo.rs | 13 +- .../rust/src/auto/repo_commit_modifier.rs | 4 +- rust-bindings/rust/src/auto/repo_finder.rs | 146 ++++++++++++------ rust-bindings/rust/src/auto/sysroot.rs | 22 ++- rust-bindings/rust/src/auto/versions.txt | 4 +- rust-bindings/rust/sys/Cargo.toml | 38 +++++ rust-bindings/rust/sys/build.rs | 127 +-------------- rust-bindings/rust/sys/src/auto/versions.txt | 4 +- rust-bindings/rust/sys/src/lib.rs | 5 + 16 files changed, 240 insertions(+), 258 deletions(-) diff --git a/rust-bindings/rust/Makefile b/rust-bindings/rust/Makefile index 3b1380d8..eac5ed37 100644 --- a/rust-bindings/rust/Makefile +++ b/rust-bindings/rust/Makefile @@ -1,4 +1,4 @@ -GIR_VERSION := d1e88f94e89a84d7aae7a51b3ff46b71838c42ff +GIR_VERSION := 60cbef05401bd73c3e8a0a7c0cbfb793394acfe7 RUSTDOC_STRIPPER_VERSION := 0.1.9 all: gir diff --git a/rust-bindings/rust/src/auto/async_progress.rs b/rust-bindings/rust/src/auto/async_progress.rs index 2f627b26..2049a14f 100644 --- a/rust-bindings/rust/src/auto/async_progress.rs +++ b/rust-bindings/rust/src/auto/async_progress.rs @@ -161,12 +161,12 @@ impl> AsyncProgressExt for O { where P: IsA { let f: &F = &*(f as *const F); - f(&AsyncProgress::from_glib_borrow(this).unsafe_cast()) + f(&AsyncProgress::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw(self.as_ptr() as *mut _, b"changed\0".as_ptr() as *const _, - Some(transmute(changed_trampoline:: as usize)), Box_::into_raw(f)) + Some(transmute::<_, unsafe extern "C" fn()>(changed_trampoline:: as *const ())), Box_::into_raw(f)) } } } diff --git a/rust-bindings/rust/src/auto/constants.rs b/rust-bindings/rust/src/auto/constants.rs index 7d6833ff..3ebf2da8 100644 --- a/rust-bindings/rust/src/auto/constants.rs +++ b/rust-bindings/rust/src/auto/constants.rs @@ -5,57 +5,27 @@ use ostree_sys; use std::ffi::CStr; -lazy_static! { - pub static ref COMMIT_GVARIANT_STRING: &'static str = unsafe{CStr::from_ptr(ostree_sys::OSTREE_COMMIT_GVARIANT_STRING).to_str().unwrap()}; -} +pub static COMMIT_GVARIANT_STRING: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ostree_sys::OSTREE_COMMIT_GVARIANT_STRING).to_str().unwrap()}); #[cfg(any(feature = "v2018_6", feature = "dox"))] -lazy_static! { - pub static ref COMMIT_META_KEY_COLLECTION_BINDING: &'static str = unsafe{CStr::from_ptr(ostree_sys::OSTREE_COMMIT_META_KEY_COLLECTION_BINDING).to_str().unwrap()}; -} +pub static COMMIT_META_KEY_COLLECTION_BINDING: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ostree_sys::OSTREE_COMMIT_META_KEY_COLLECTION_BINDING).to_str().unwrap()}); #[cfg(any(feature = "v2017_7", feature = "dox"))] -lazy_static! { - pub static ref COMMIT_META_KEY_ENDOFLIFE: &'static str = unsafe{CStr::from_ptr(ostree_sys::OSTREE_COMMIT_META_KEY_ENDOFLIFE).to_str().unwrap()}; -} +pub static COMMIT_META_KEY_ENDOFLIFE: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ostree_sys::OSTREE_COMMIT_META_KEY_ENDOFLIFE).to_str().unwrap()}); #[cfg(any(feature = "v2017_7", feature = "dox"))] -lazy_static! { - pub static ref COMMIT_META_KEY_ENDOFLIFE_REBASE: &'static str = unsafe{CStr::from_ptr(ostree_sys::OSTREE_COMMIT_META_KEY_ENDOFLIFE_REBASE).to_str().unwrap()}; -} +pub static COMMIT_META_KEY_ENDOFLIFE_REBASE: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ostree_sys::OSTREE_COMMIT_META_KEY_ENDOFLIFE_REBASE).to_str().unwrap()}); #[cfg(any(feature = "v2017_9", feature = "dox"))] -lazy_static! { - pub static ref COMMIT_META_KEY_REF_BINDING: &'static str = unsafe{CStr::from_ptr(ostree_sys::OSTREE_COMMIT_META_KEY_REF_BINDING).to_str().unwrap()}; -} +pub static COMMIT_META_KEY_REF_BINDING: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ostree_sys::OSTREE_COMMIT_META_KEY_REF_BINDING).to_str().unwrap()}); #[cfg(any(feature = "v2017_13", feature = "dox"))] -lazy_static! { - pub static ref COMMIT_META_KEY_SOURCE_TITLE: &'static str = unsafe{CStr::from_ptr(ostree_sys::OSTREE_COMMIT_META_KEY_SOURCE_TITLE).to_str().unwrap()}; -} +pub static COMMIT_META_KEY_SOURCE_TITLE: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ostree_sys::OSTREE_COMMIT_META_KEY_SOURCE_TITLE).to_str().unwrap()}); #[cfg(any(feature = "v2014_9", feature = "dox"))] -lazy_static! { - pub static ref COMMIT_META_KEY_VERSION: &'static str = unsafe{CStr::from_ptr(ostree_sys::OSTREE_COMMIT_META_KEY_VERSION).to_str().unwrap()}; -} -lazy_static! { - pub static ref DIRMETA_GVARIANT_STRING: &'static str = unsafe{CStr::from_ptr(ostree_sys::OSTREE_DIRMETA_GVARIANT_STRING).to_str().unwrap()}; -} -lazy_static! { - pub static ref FILEMETA_GVARIANT_STRING: &'static str = unsafe{CStr::from_ptr(ostree_sys::OSTREE_FILEMETA_GVARIANT_STRING).to_str().unwrap()}; -} +pub static COMMIT_META_KEY_VERSION: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ostree_sys::OSTREE_COMMIT_META_KEY_VERSION).to_str().unwrap()}); +pub static DIRMETA_GVARIANT_STRING: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ostree_sys::OSTREE_DIRMETA_GVARIANT_STRING).to_str().unwrap()}); +pub static FILEMETA_GVARIANT_STRING: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ostree_sys::OSTREE_FILEMETA_GVARIANT_STRING).to_str().unwrap()}); #[cfg(any(feature = "v2018_9", feature = "dox"))] -lazy_static! { - pub static ref META_KEY_DEPLOY_COLLECTION_ID: &'static str = unsafe{CStr::from_ptr(ostree_sys::OSTREE_META_KEY_DEPLOY_COLLECTION_ID).to_str().unwrap()}; -} +pub static META_KEY_DEPLOY_COLLECTION_ID: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ostree_sys::OSTREE_META_KEY_DEPLOY_COLLECTION_ID).to_str().unwrap()}); #[cfg(any(feature = "v2018_3", feature = "dox"))] -lazy_static! { - pub static ref ORIGIN_TRANSIENT_GROUP: &'static str = unsafe{CStr::from_ptr(ostree_sys::OSTREE_ORIGIN_TRANSIENT_GROUP).to_str().unwrap()}; -} +pub static ORIGIN_TRANSIENT_GROUP: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ostree_sys::OSTREE_ORIGIN_TRANSIENT_GROUP).to_str().unwrap()}); #[cfg(any(feature = "v2018_6", feature = "dox"))] -lazy_static! { - pub static ref REPO_METADATA_REF: &'static str = unsafe{CStr::from_ptr(ostree_sys::OSTREE_REPO_METADATA_REF).to_str().unwrap()}; -} -lazy_static! { - pub static ref SUMMARY_GVARIANT_STRING: &'static str = unsafe{CStr::from_ptr(ostree_sys::OSTREE_SUMMARY_GVARIANT_STRING).to_str().unwrap()}; -} -lazy_static! { - pub static ref SUMMARY_SIG_GVARIANT_STRING: &'static str = unsafe{CStr::from_ptr(ostree_sys::OSTREE_SUMMARY_SIG_GVARIANT_STRING).to_str().unwrap()}; -} -lazy_static! { - pub static ref TREE_GVARIANT_STRING: &'static str = unsafe{CStr::from_ptr(ostree_sys::OSTREE_TREE_GVARIANT_STRING).to_str().unwrap()}; -} +pub static REPO_METADATA_REF: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ostree_sys::OSTREE_REPO_METADATA_REF).to_str().unwrap()}); +pub static SUMMARY_GVARIANT_STRING: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ostree_sys::OSTREE_SUMMARY_GVARIANT_STRING).to_str().unwrap()}); +pub static SUMMARY_SIG_GVARIANT_STRING: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ostree_sys::OSTREE_SUMMARY_SIG_GVARIANT_STRING).to_str().unwrap()}); +pub static TREE_GVARIANT_STRING: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ostree_sys::OSTREE_TREE_GVARIANT_STRING).to_str().unwrap()}); diff --git a/rust-bindings/rust/src/auto/enums.rs b/rust-bindings/rust/src/auto/enums.rs index 0ae3ac64..a7f29439 100644 --- a/rust-bindings/rust/src/auto/enums.rs +++ b/rust-bindings/rust/src/auto/enums.rs @@ -8,6 +8,7 @@ use std::fmt; #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)] #[derive(Clone, Copy)] +#[non_exhaustive] pub enum DeploymentUnlockedState { None, Development, @@ -55,6 +56,7 @@ impl FromGlib for DeploymentUnlockedS #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)] #[derive(Clone, Copy)] +#[non_exhaustive] pub enum GpgSignatureAttr { Valid, SigExpired, @@ -150,6 +152,7 @@ impl FromGlib for GpgSignatureAttr { #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)] #[derive(Clone, Copy)] +#[non_exhaustive] pub enum GpgSignatureFormatFlags { GpgSignatureFormatDefault, #[doc(hidden)] @@ -189,6 +192,7 @@ impl FromGlib for GpgSignatureFormatF #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)] #[derive(Clone, Copy)] +#[non_exhaustive] pub enum ObjectType { File, DirTree, @@ -253,6 +257,7 @@ impl FromGlib for ObjectType { #[cfg(any(feature = "v2018_2", feature = "dox"))] #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)] #[derive(Clone, Copy)] +#[non_exhaustive] pub enum RepoCheckoutFilterResult { Allow, Skip, @@ -299,6 +304,7 @@ impl FromGlib for RepoCheckoutFilter #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)] #[derive(Clone, Copy)] +#[non_exhaustive] pub enum RepoCheckoutMode { None, User, @@ -342,6 +348,7 @@ impl FromGlib for RepoCheckoutMode { #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)] #[derive(Clone, Copy)] +#[non_exhaustive] pub enum RepoCheckoutOverwriteMode { None, UnionFiles, @@ -393,6 +400,7 @@ impl FromGlib for RepoCheckoutOverw #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)] #[derive(Clone, Copy)] +#[non_exhaustive] pub enum RepoCommitFilterResult { Allow, Skip, @@ -436,6 +444,7 @@ impl FromGlib for RepoCommitFilterResu #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)] #[derive(Clone, Copy)] +#[non_exhaustive] pub enum RepoCommitIterResult { Error, End, @@ -487,6 +496,7 @@ impl FromGlib for RepoCommitIterResult { #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)] #[derive(Clone, Copy)] +#[non_exhaustive] pub enum RepoMode { Bare, Archive, @@ -538,6 +548,7 @@ impl FromGlib for RepoMode { #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)] #[derive(Clone, Copy)] +#[non_exhaustive] pub enum RepoPruneFlags { None, NoPrune, @@ -585,6 +596,7 @@ impl FromGlib for RepoPruneFlags { #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)] #[derive(Clone, Copy)] +#[non_exhaustive] pub enum RepoRemoteChange { Add, AddIfNotExists, @@ -640,6 +652,7 @@ impl FromGlib for RepoRemoteChange { #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)] #[derive(Clone, Copy)] +#[non_exhaustive] pub enum StaticDeltaGenerateOpt { Lowlatency, Major, diff --git a/rust-bindings/rust/src/auto/functions.rs b/rust-bindings/rust/src/auto/functions.rs index f439af45..0558bbea 100644 --- a/rust-bindings/rust/src/auto/functions.rs +++ b/rust-bindings/rust/src/auto/functions.rs @@ -10,6 +10,8 @@ use glib::GString; use ostree_sys; use std::mem; use std::ptr; +use DiffFlags; +use DiffItem; use ObjectType; @@ -108,7 +110,7 @@ pub fn commit_get_content_checksum(commit_variant: &glib::Variant) -> Option Result<(), glib::Error> { +//pub fn commit_get_object_sizes(commit_variant: &glib::Variant, out_sizes_entries: /*Ignored*/Vec) -> Result<(), glib::Error> { // unsafe { TODO: call ostree_sys:ostree_commit_get_object_sizes() } //} @@ -163,18 +165,24 @@ pub fn create_directory_metadata(dir_info: &gio::FileInfo, xattrs: Option<&glib: } } -//pub fn diff_dirs, Q: IsA, R: IsA>(flags: DiffFlags, a: &P, b: &Q, modified: /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 1, id: 27 }, removed: /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 4, id: 15 }, added: /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 4, id: 15 }, cancellable: Option<&R>) -> Result<(), glib::Error> { -// unsafe { TODO: call ostree_sys:ostree_diff_dirs() } -//} +pub fn diff_dirs, Q: IsA, R: IsA>(flags: DiffFlags, a: &P, b: &Q, modified: &[&DiffItem], removed: &[gio::File], added: &[gio::File], cancellable: Option<&R>) -> Result<(), glib::Error> { + unsafe { + let mut error = ptr::null_mut(); + let _ = ostree_sys::ostree_diff_dirs(flags.to_glib(), a.as_ref().to_glib_none().0, b.as_ref().to_glib_none().0, modified.to_glib_none().0, removed.to_glib_none().0, added.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); + if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } + } +} //#[cfg(any(feature = "v2017_4", feature = "dox"))] -//pub fn diff_dirs_with_options, Q: IsA, R: IsA>(flags: DiffFlags, a: &P, b: &Q, modified: /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 1, id: 27 }, removed: /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 4, id: 15 }, added: /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 4, id: 15 }, options: /*Ignored*/Option<&mut DiffDirsOptions>, cancellable: Option<&R>) -> Result<(), glib::Error> { +//pub fn diff_dirs_with_options, Q: IsA, R: IsA>(flags: DiffFlags, a: &P, b: &Q, modified: &[&DiffItem], removed: &[gio::File], added: &[gio::File], options: /*Ignored*/Option<&mut DiffDirsOptions>, cancellable: Option<&R>) -> Result<(), glib::Error> { // unsafe { TODO: call ostree_sys:ostree_diff_dirs_with_options() } //} -//pub fn diff_print, Q: IsA>(a: &P, b: &Q, modified: /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 1, id: 27 }, removed: /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 4, id: 15 }, added: /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 4, id: 15 }) { -// unsafe { TODO: call ostree_sys:ostree_diff_print() } -//} +pub fn diff_print, Q: IsA>(a: &P, b: &Q, modified: &[&DiffItem], removed: &[gio::File], added: &[gio::File]) { + unsafe { + ostree_sys::ostree_diff_print(a.as_ref().to_glib_none().0, b.as_ref().to_glib_none().0, modified.to_glib_none().0, removed.to_glib_none().0, added.to_glib_none().0); + } +} #[cfg(any(feature = "v2017_10", feature = "dox"))] pub fn gpg_error_quark() -> glib::Quark { diff --git a/rust-bindings/rust/src/auto/mod.rs b/rust-bindings/rust/src/auto/mod.rs index 7bb285d7..bcdead57 100644 --- a/rust-bindings/rust/src/auto/mod.rs +++ b/rust-bindings/rust/src/auto/mod.rs @@ -26,8 +26,11 @@ mod repo_file; pub use self::repo_file::{RepoFile, RepoFileClass, NONE_REPO_FILE}; pub use self::repo_file::RepoFileExt; +#[cfg(any(feature = "v2018_6", feature = "dox"))] mod repo_finder; +#[cfg(any(feature = "v2018_6", feature = "dox"))] pub use self::repo_finder::{RepoFinder, NONE_REPO_FINDER}; +#[cfg(any(feature = "v2018_6", feature = "dox"))] pub use self::repo_finder::RepoFinderExt; mod repo_finder_avahi; @@ -155,6 +158,7 @@ pub mod traits { pub use super::AsyncProgressExt; pub use super::MutableTreeExt; pub use super::RepoFileExt; + #[cfg(any(feature = "v2018_6", feature = "dox"))] pub use super::RepoFinderExt; pub use super::RepoFinderAvahiExt; #[cfg(any(feature = "v2018_6", feature = "dox"))] diff --git a/rust-bindings/rust/src/auto/mutable_tree.rs b/rust-bindings/rust/src/auto/mutable_tree.rs index 4bec41b7..18040c21 100644 --- a/rust-bindings/rust/src/auto/mutable_tree.rs +++ b/rust-bindings/rust/src/auto/mutable_tree.rs @@ -28,7 +28,7 @@ impl MutableTree { } #[cfg(any(feature = "v2018_7", feature = "dox"))] - pub fn new_from_checksum(repo: &Repo, contents_checksum: &str, metadata_checksum: &str) -> MutableTree { + pub fn from_checksum(repo: &Repo, contents_checksum: &str, metadata_checksum: &str) -> MutableTree { unsafe { from_glib_full(ostree_sys::ostree_mutable_tree_new_from_checksum(repo.to_glib_none().0, contents_checksum.to_glib_none().0, metadata_checksum.to_glib_none().0)) } @@ -49,7 +49,7 @@ pub trait MutableTreeExt: 'static { fn ensure_dir(&self, name: &str) -> Result; - //fn ensure_parent_dirs(&self, split_path: /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 0, id: 28 }, metadata_checksum: &str) -> Result; + fn ensure_parent_dirs(&self, split_path: &[&str], metadata_checksum: &str) -> Result; #[cfg(any(feature = "v2018_7", feature = "dox"))] fn fill_empty_from_dirtree(&self, repo: &Repo, contents_checksum: &str, metadata_checksum: &str) -> bool; @@ -73,7 +73,7 @@ pub trait MutableTreeExt: 'static { fn set_metadata_checksum(&self, checksum: &str); - //fn walk(&self, split_path: /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 0, id: 28 }, start: u32) -> Result; + fn walk(&self, split_path: &[&str], start: u32) -> Result; } impl> MutableTreeExt for O { @@ -95,9 +95,14 @@ impl> MutableTreeExt for O { } } - //fn ensure_parent_dirs(&self, split_path: /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 0, id: 28 }, metadata_checksum: &str) -> Result { - // unsafe { TODO: call ostree_sys:ostree_mutable_tree_ensure_parent_dirs() } - //} + fn ensure_parent_dirs(&self, split_path: &[&str], metadata_checksum: &str) -> Result { + unsafe { + let mut out_parent = ptr::null_mut(); + let mut error = ptr::null_mut(); + let _ = ostree_sys::ostree_mutable_tree_ensure_parent_dirs(self.as_ref().to_glib_none().0, split_path.to_glib_none().0, metadata_checksum.to_glib_none().0, &mut out_parent, &mut error); + if error.is_null() { Ok(from_glib_full(out_parent)) } else { Err(from_glib_full(error)) } + } + } #[cfg(any(feature = "v2018_7", feature = "dox"))] fn fill_empty_from_dirtree(&self, repo: &Repo, contents_checksum: &str, metadata_checksum: &str) -> bool { @@ -165,9 +170,14 @@ impl> MutableTreeExt for O { } } - //fn walk(&self, split_path: /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 0, id: 28 }, start: u32) -> Result { - // unsafe { TODO: call ostree_sys:ostree_mutable_tree_walk() } - //} + fn walk(&self, split_path: &[&str], start: u32) -> Result { + unsafe { + let mut out_subdir = ptr::null_mut(); + let mut error = ptr::null_mut(); + let _ = ostree_sys::ostree_mutable_tree_walk(self.as_ref().to_glib_none().0, split_path.to_glib_none().0, start, &mut out_subdir, &mut error); + if error.is_null() { Ok(from_glib_full(out_subdir)) } else { Err(from_glib_full(error)) } + } + } } impl fmt::Display for MutableTree { diff --git a/rust-bindings/rust/src/auto/repo.rs b/rust-bindings/rust/src/auto/repo.rs index b8c02315..ed5ff42a 100644 --- a/rust-bindings/rust/src/auto/repo.rs +++ b/rust-bindings/rust/src/auto/repo.rs @@ -360,9 +360,14 @@ impl Repo { // unsafe { TODO: call ostree_sys:ostree_repo_list_refs_ext() } //} - //pub fn list_static_delta_names>(&self, out_deltas: /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 0, id: 28 }, cancellable: Option<&P>) -> Result<(), glib::Error> { - // unsafe { TODO: call ostree_sys:ostree_repo_list_static_delta_names() } - //} + pub fn list_static_delta_names>(&self, cancellable: Option<&P>) -> Result, glib::Error> { + unsafe { + let mut out_deltas = ptr::null_mut(); + let mut error = ptr::null_mut(); + let _ = ostree_sys::ostree_repo_list_static_delta_names(self.to_glib_none().0, &mut out_deltas, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); + if error.is_null() { Ok(FromGlibPtrContainer::from_glib_container(out_deltas)) } else { Err(from_glib_full(error)) } + } + } #[cfg(any(feature = "v2015_7", feature = "dox"))] pub fn load_commit(&self, checksum: &str) -> Result<(glib::Variant, RepoCommitState), glib::Error> { @@ -1050,7 +1055,7 @@ impl Repo { unsafe { let f: Box_ = Box_::new(f); connect_raw(self.as_ptr() as *mut _, b"gpg-verify-result\0".as_ptr() as *const _, - Some(transmute(gpg_verify_result_trampoline:: as usize)), Box_::into_raw(f)) + Some(transmute::<_, unsafe extern "C" fn()>(gpg_verify_result_trampoline:: as *const ())), Box_::into_raw(f)) } } } diff --git a/rust-bindings/rust/src/auto/repo_commit_modifier.rs b/rust-bindings/rust/src/auto/repo_commit_modifier.rs index 22e042a3..c1d9850a 100644 --- a/rust-bindings/rust/src/auto/repo_commit_modifier.rs +++ b/rust-bindings/rust/src/auto/repo_commit_modifier.rs @@ -31,7 +31,7 @@ impl RepoCommitModifier { let commit_filter_data: Box_ RepoCommitFilterResult + 'static>>> = Box_::new(commit_filter); unsafe extern "C" fn commit_filter_func(repo: *mut ostree_sys::OstreeRepo, path: *const libc::c_char, file_info: *mut gio_sys::GFileInfo, user_data: glib_sys::gpointer) -> ostree_sys::OstreeRepoCommitFilterResult { let repo = from_glib_borrow(repo); - let path: GString = from_glib_borrow(path); + let path: Borrowed = from_glib_borrow(path); let file_info = from_glib_borrow(file_info); let callback: &Option RepoCommitFilterResult + 'static>> = &*(user_data as *mut _); let res = if let Some(ref callback) = *callback { @@ -69,7 +69,7 @@ impl RepoCommitModifier { let callback_data: Box_

= Box_::new(callback); unsafe extern "C" fn callback_func glib::Variant + 'static>(repo: *mut ostree_sys::OstreeRepo, path: *const libc::c_char, file_info: *mut gio_sys::GFileInfo, user_data: glib_sys::gpointer) -> *mut glib_sys::GVariant { let repo = from_glib_borrow(repo); - let path: GString = from_glib_borrow(path); + let path: Borrowed = from_glib_borrow(path); let file_info = from_glib_borrow(file_info); let callback: &P = &*(user_data as *mut _); let res = (*callback)(&repo, path.as_str(), &file_info); diff --git a/rust-bindings/rust/src/auto/repo_finder.rs b/rust-bindings/rust/src/auto/repo_finder.rs index e8ff7514..821d5417 100644 --- a/rust-bindings/rust/src/auto/repo_finder.rs +++ b/rust-bindings/rust/src/auto/repo_finder.rs @@ -2,10 +2,32 @@ // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT +#[cfg(any(feature = "v2018_6", feature = "dox"))] +use gio; +#[cfg(any(feature = "v2018_6", feature = "dox"))] +use gio_sys; +#[cfg(any(feature = "v2018_6", feature = "dox"))] +use glib; use glib::object::IsA; use glib::translate::*; +#[cfg(any(feature = "v2018_6", feature = "dox"))] +use glib_sys; +#[cfg(any(feature = "v2018_6", feature = "dox"))] +use gobject_sys; use ostree_sys; +#[cfg(any(feature = "v2018_6", feature = "dox"))] +use std::boxed::Box as Box_; use std::fmt; +#[cfg(any(feature = "v2018_6", feature = "dox"))] +use std::pin::Pin; +#[cfg(any(feature = "v2018_6", feature = "dox"))] +use std::ptr; +#[cfg(any(feature = "v2018_6", feature = "dox"))] +use CollectionRef; +#[cfg(any(feature = "v2018_6", feature = "dox"))] +use Repo; +#[cfg(any(feature = "v2018_6", feature = "dox"))] +use RepoFinderResult; glib_wrapper! { pub struct RepoFinder(Interface); @@ -16,72 +38,94 @@ glib_wrapper! { } impl RepoFinder { - //#[cfg(any(feature = "v2018_6", feature = "dox"))] - //pub fn resolve_all_async, Q: FnOnce(Result) + Send + 'static>(finders: &[RepoFinder], refs: &[&CollectionRef], parent_repo: &Repo, cancellable: Option<&P>, callback: Q) { - // unsafe { TODO: call ostree_sys:ostree_repo_finder_resolve_all_async() } - //} + #[cfg(any(feature = "v2018_6", feature = "dox"))] + pub fn resolve_all_async, Q: FnOnce(Result, glib::Error>) + Send + 'static>(finders: &[RepoFinder], refs: &[&CollectionRef], parent_repo: &Repo, cancellable: Option<&P>, callback: Q) { + let user_data: Box_ = Box_::new(callback); + unsafe extern "C" fn resolve_all_async_trampoline, glib::Error>) + Send + 'static>(_source_object: *mut gobject_sys::GObject, res: *mut gio_sys::GAsyncResult, user_data: glib_sys::gpointer) { + let mut error = ptr::null_mut(); + let ret = ostree_sys::ostree_repo_finder_resolve_all_finish(res, &mut error); + let result = if error.is_null() { Ok(FromGlibPtrContainer::from_glib_full(ret)) } else { Err(from_glib_full(error)) }; + let callback: Box_ = Box_::from_raw(user_data as *mut _); + callback(result); + } + let callback = resolve_all_async_trampoline::; + unsafe { + ostree_sys::ostree_repo_finder_resolve_all_async(finders.to_glib_none().0, refs.to_glib_none().0, parent_repo.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, Some(callback), Box_::into_raw(user_data) as *mut _); + } + } - // - //#[cfg(any(feature = "v2018_6", feature = "dox"))] - //pub fn resolve_all_async_future(finders: &[RepoFinder], refs: &[&CollectionRef], parent_repo: &Repo) -> Pin> + 'static>> { + + #[cfg(any(feature = "v2018_6", feature = "dox"))] + pub fn resolve_all_async_future(finders: &[RepoFinder], refs: &[&CollectionRef], parent_repo: &Repo) -> Pin, glib::Error>> + 'static>> { - //let finders = finders.clone(); - //let refs = refs.clone(); - //let parent_repo = parent_repo.clone(); - //Box_::pin(gio::GioFuture::new(&(), move |_obj, send| { - // let cancellable = gio::Cancellable::new(); - // Self::resolve_all_async( - // &finders, - // &refs, - // &parent_repo, - // Some(&cancellable), - // move |res| { - // send.resolve(res); - // }, - // ); + let finders = finders.clone(); + let refs = refs.clone(); + let parent_repo = parent_repo.clone(); + Box_::pin(gio::GioFuture::new(&(), move |_obj, send| { + let cancellable = gio::Cancellable::new(); + Self::resolve_all_async( + &finders, + &refs, + &parent_repo, + Some(&cancellable), + move |res| { + send.resolve(res); + }, + ); - // cancellable - //})) - //} + cancellable + })) + } } pub const NONE_REPO_FINDER: Option<&RepoFinder> = None; pub trait RepoFinderExt: 'static { - //#[cfg(any(feature = "v2018_6", feature = "dox"))] - //fn resolve_async, Q: FnOnce(Result) + Send + 'static>(&self, refs: &[&CollectionRef], parent_repo: &Repo, cancellable: Option<&P>, callback: Q); + #[cfg(any(feature = "v2018_6", feature = "dox"))] + fn resolve_async, Q: FnOnce(Result, glib::Error>) + Send + 'static>(&self, refs: &[&CollectionRef], parent_repo: &Repo, cancellable: Option<&P>, callback: Q); - // - //#[cfg(any(feature = "v2018_6", feature = "dox"))] - //fn resolve_async_future(&self, refs: &[&CollectionRef], parent_repo: &Repo) -> Pin> + 'static>>; + + #[cfg(any(feature = "v2018_6", feature = "dox"))] + fn resolve_async_future(&self, refs: &[&CollectionRef], parent_repo: &Repo) -> Pin, glib::Error>> + 'static>>; } impl> RepoFinderExt for O { - //#[cfg(any(feature = "v2018_6", feature = "dox"))] - //fn resolve_async, Q: FnOnce(Result) + Send + 'static>(&self, refs: &[&CollectionRef], parent_repo: &Repo, cancellable: Option<&P>, callback: Q) { - // unsafe { TODO: call ostree_sys:ostree_repo_finder_resolve_async() } - //} + #[cfg(any(feature = "v2018_6", feature = "dox"))] + fn resolve_async, Q: FnOnce(Result, glib::Error>) + Send + 'static>(&self, refs: &[&CollectionRef], parent_repo: &Repo, cancellable: Option<&P>, callback: Q) { + let user_data: Box_ = Box_::new(callback); + unsafe extern "C" fn resolve_async_trampoline, glib::Error>) + Send + 'static>(_source_object: *mut gobject_sys::GObject, res: *mut gio_sys::GAsyncResult, user_data: glib_sys::gpointer) { + let mut error = ptr::null_mut(); + let ret = ostree_sys::ostree_repo_finder_resolve_finish(_source_object as *mut _, res, &mut error); + let result = if error.is_null() { Ok(FromGlibPtrContainer::from_glib_full(ret)) } else { Err(from_glib_full(error)) }; + let callback: Box_ = Box_::from_raw(user_data as *mut _); + callback(result); + } + let callback = resolve_async_trampoline::; + unsafe { + ostree_sys::ostree_repo_finder_resolve_async(self.as_ref().to_glib_none().0, refs.to_glib_none().0, parent_repo.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, Some(callback), Box_::into_raw(user_data) as *mut _); + } + } - // - //#[cfg(any(feature = "v2018_6", feature = "dox"))] - //fn resolve_async_future(&self, refs: &[&CollectionRef], parent_repo: &Repo) -> Pin> + 'static>> { + + #[cfg(any(feature = "v2018_6", feature = "dox"))] + fn resolve_async_future(&self, refs: &[&CollectionRef], parent_repo: &Repo) -> Pin, glib::Error>> + 'static>> { - //let refs = refs.clone(); - //let parent_repo = parent_repo.clone(); - //Box_::pin(gio::GioFuture::new(self, move |obj, send| { - // let cancellable = gio::Cancellable::new(); - // obj.resolve_async( - // &refs, - // &parent_repo, - // Some(&cancellable), - // move |res| { - // send.resolve(res); - // }, - // ); + let refs = refs.clone(); + let parent_repo = parent_repo.clone(); + Box_::pin(gio::GioFuture::new(self, move |obj, send| { + let cancellable = gio::Cancellable::new(); + obj.resolve_async( + &refs, + &parent_repo, + Some(&cancellable), + move |res| { + send.resolve(res); + }, + ); - // cancellable - //})) - //} + cancellable + })) + } } impl fmt::Display for RepoFinder { diff --git a/rust-bindings/rust/src/auto/sysroot.rs b/rust-bindings/rust/src/auto/sysroot.rs index 613d46a1..213a5924 100644 --- a/rust-bindings/rust/src/auto/sysroot.rs +++ b/rust-bindings/rust/src/auto/sysroot.rs @@ -141,9 +141,11 @@ impl Sysroot { } } - //pub fn get_deployments(&self) -> /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 1, id: 22 } { - // unsafe { TODO: call ostree_sys:ostree_sysroot_get_deployments() } - //} + pub fn get_deployments(&self) -> Vec { + unsafe { + FromGlibPtrContainer::from_glib_container(ostree_sys::ostree_sysroot_get_deployments(self.to_glib_none().0)) + } + } pub fn get_fd(&self) -> i32 { unsafe { @@ -354,12 +356,16 @@ impl Sysroot { } } - //pub fn write_deployments>(&self, new_deployments: /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 1, id: 22 }, cancellable: Option<&P>) -> Result<(), glib::Error> { - // unsafe { TODO: call ostree_sys:ostree_sysroot_write_deployments() } - //} + pub fn write_deployments>(&self, new_deployments: &[Deployment], cancellable: Option<&P>) -> Result<(), glib::Error> { + unsafe { + let mut error = ptr::null_mut(); + let _ = ostree_sys::ostree_sysroot_write_deployments(self.to_glib_none().0, new_deployments.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); + if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } + } + } //#[cfg(any(feature = "v2017_4", feature = "dox"))] - //pub fn write_deployments_with_options>(&self, new_deployments: /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 1, id: 22 }, opts: /*Ignored*/&mut SysrootWriteDeploymentsOpts, cancellable: Option<&P>) -> Result<(), glib::Error> { + //pub fn write_deployments_with_options>(&self, new_deployments: &[Deployment], opts: /*Ignored*/&mut SysrootWriteDeploymentsOpts, cancellable: Option<&P>) -> Result<(), glib::Error> { // unsafe { TODO: call ostree_sys:ostree_sysroot_write_deployments_with_options() } //} @@ -386,7 +392,7 @@ impl Sysroot { unsafe { let f: Box_ = Box_::new(f); connect_raw(self.as_ptr() as *mut _, b"journal-msg\0".as_ptr() as *const _, - Some(transmute(journal_msg_trampoline:: as usize)), Box_::into_raw(f)) + Some(transmute::<_, unsafe extern "C" fn()>(journal_msg_trampoline:: as *const ())), Box_::into_raw(f)) } } } diff --git a/rust-bindings/rust/src/auto/versions.txt b/rust-bindings/rust/src/auto/versions.txt index f1b99505..2b2845ae 100644 --- a/rust-bindings/rust/src/auto/versions.txt +++ b/rust-bindings/rust/src/auto/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ d1e88f94) -from gir-files (https://github.com/gtk-rs/gir-files @ b20abec) +Generated by gir (https://github.com/gtk-rs/gir @ 60cbef05) +from gir-files (https://github.com/gtk-rs/gir-files @ e51adaf) diff --git a/rust-bindings/rust/sys/Cargo.toml b/rust-bindings/rust/sys/Cargo.toml index 72cc0fff..b4ec4b58 100644 --- a/rust-bindings/rust/sys/Cargo.toml +++ b/rust-bindings/rust/sys/Cargo.toml @@ -3,6 +3,7 @@ repository = "fkrull/ostree-rs" [build-dependencies] pkg-config = "0.3.7" +system-deps = "1.3" [dependencies] gio-sys = "0.9.1" @@ -66,3 +67,40 @@ repository = "https://gitlab.com/fkrull/ostree-rs" version = "0.5.4" [package.metadata.docs.rs] features = ["dox"] +[package.metadata.system-deps.ostree_1] +name = "ostree-1" +version = "0.0" + +[package.metadata.system-deps.ostree_1.feature-versions] +v2014_9 = "2014.9" +v2015_7 = "2015.7" +v2016_4 = "2016.4" +v2016_5 = "2016.5" +v2016_6 = "2016.6" +v2016_7 = "2016.7" +v2016_8 = "2016.8" +v2016_14 = "2016.14" +v2017_1 = "2017.1" +v2017_2 = "2017.2" +v2017_3 = "2017.3" +v2017_4 = "2017.4" +v2017_6 = "2017.6" +v2017_7 = "2017.7" +v2017_8 = "2017.8" +v2017_9 = "2017.9" +v2017_10 = "2017.10" +v2017_11 = "2017.11" +v2017_12 = "2017.12" +v2017_13 = "2017.13" +v2017_15 = "2017.15" +v2018_2 = "2018.2" +v2018_3 = "2018.3" +v2018_5 = "2018.5" +v2018_6 = "2018.6" +v2018_7 = "2018.7" +v2018_9 = "2018.9" +v2019_2 = "2019.2" +v2019_3 = "2019.3" +v2019_4 = "2019.4" +v2019_6 = "2019.6" +v2020_1 = "2020.1" diff --git a/rust-bindings/rust/sys/build.rs b/rust-bindings/rust/sys/build.rs index fcb4afe6..bd5481be 100644 --- a/rust-bindings/rust/sys/build.rs +++ b/rust-bindings/rust/sys/build.rs @@ -3,12 +3,8 @@ // DO NOT EDIT #[cfg(not(feature = "dox"))] -extern crate pkg_config; +extern crate system_deps; -#[cfg(not(feature = "dox"))] -use pkg_config::{Config, Error}; -#[cfg(not(feature = "dox"))] -use std::env; #[cfg(not(feature = "dox"))] use std::io::prelude::*; #[cfg(not(feature = "dox"))] @@ -21,125 +17,8 @@ fn main() {} // prevent linking libraries to avoid documentation failure #[cfg(not(feature = "dox"))] fn main() { - if let Err(s) = find() { - let _ = writeln!(io::stderr(), "{}", s); + if let Err(s) = system_deps::Config::new().probe() { + let _ = eprintln!("{}", s); process::exit(1); } } - -#[cfg(not(feature = "dox"))] -fn find() -> Result<(), Error> { - let package_name = "ostree-1"; - let shared_libs = ["ostree-1"]; - let version = if cfg!(feature = "v2020_1") { - "2020.1" - } else if cfg!(feature = "v2019_6") { - "2019.6" - } else if cfg!(feature = "v2019_4") { - "2019.4" - } else if cfg!(feature = "v2019_3") { - "2019.3" - } else if cfg!(feature = "v2019_2") { - "2019.2" - } else if cfg!(feature = "v2018_9") { - "2018.9" - } else if cfg!(feature = "v2018_7") { - "2018.7" - } else if cfg!(feature = "v2018_6") { - "2018.6" - } else if cfg!(feature = "v2018_5") { - "2018.5" - } else if cfg!(feature = "v2018_3") { - "2018.3" - } else if cfg!(feature = "v2018_2") { - "2018.2" - } else if cfg!(feature = "v2017_15") { - "2017.15" - } else if cfg!(feature = "v2017_13") { - "2017.13" - } else if cfg!(feature = "v2017_12") { - "2017.12" - } else if cfg!(feature = "v2017_11") { - "2017.11" - } else if cfg!(feature = "v2017_10") { - "2017.10" - } else if cfg!(feature = "v2017_9") { - "2017.9" - } else if cfg!(feature = "v2017_8") { - "2017.8" - } else if cfg!(feature = "v2017_7") { - "2017.7" - } else if cfg!(feature = "v2017_6") { - "2017.6" - } else if cfg!(feature = "v2017_4") { - "2017.4" - } else if cfg!(feature = "v2017_3") { - "2017.3" - } else if cfg!(feature = "v2017_2") { - "2017.2" - } else if cfg!(feature = "v2017_1") { - "2017.1" - } else if cfg!(feature = "v2016_14") { - "2016.14" - } else if cfg!(feature = "v2016_8") { - "2016.8" - } else if cfg!(feature = "v2016_7") { - "2016.7" - } else if cfg!(feature = "v2016_6") { - "2016.6" - } else if cfg!(feature = "v2016_5") { - "2016.5" - } else if cfg!(feature = "v2016_4") { - "2016.4" - } else if cfg!(feature = "v2015_7") { - "2015.7" - } else { - "0.0" - }; - - if let Ok(inc_dir) = env::var("GTK_INCLUDE_DIR") { - println!("cargo:include={}", inc_dir); - } - if let Ok(lib_dir) = env::var("GTK_LIB_DIR") { - for lib_ in shared_libs.iter() { - println!("cargo:rustc-link-lib=dylib={}", lib_); - } - println!("cargo:rustc-link-search=native={}", lib_dir); - return Ok(()) - } - - let target = env::var("TARGET").expect("TARGET environment variable doesn't exist"); - let hardcode_shared_libs = target.contains("windows"); - - let mut config = Config::new(); - config.atleast_version(version); - config.print_system_libs(false); - if hardcode_shared_libs { - config.cargo_metadata(false); - } - match config.probe(package_name) { - Ok(library) => { - if let Ok(paths) = std::env::join_paths(library.include_paths) { - println!("cargo:include={}", paths.to_string_lossy()); - } - if hardcode_shared_libs { - for lib_ in shared_libs.iter() { - println!("cargo:rustc-link-lib=dylib={}", lib_); - } - for path in library.link_paths.iter() { - println!("cargo:rustc-link-search=native={}", - path.to_str().expect("library path doesn't exist")); - } - } - Ok(()) - } - Err(Error::EnvNoPkgConfig(_)) | Err(Error::Command { .. }) => { - for lib_ in shared_libs.iter() { - println!("cargo:rustc-link-lib=dylib={}", lib_); - } - Ok(()) - } - Err(err) => Err(err), - } -} - diff --git a/rust-bindings/rust/sys/src/auto/versions.txt b/rust-bindings/rust/sys/src/auto/versions.txt index f1b99505..2b2845ae 100644 --- a/rust-bindings/rust/sys/src/auto/versions.txt +++ b/rust-bindings/rust/sys/src/auto/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ d1e88f94) -from gir-files (https://github.com/gtk-rs/gir-files @ b20abec) +Generated by gir (https://github.com/gtk-rs/gir @ 60cbef05) +from gir-files (https://github.com/gtk-rs/gir-files @ e51adaf) diff --git a/rust-bindings/rust/sys/src/lib.rs b/rust-bindings/rust/sys/src/lib.rs index aa3942a0..cf6f5a10 100644 --- a/rust-bindings/rust/sys/src/lib.rs +++ b/rust-bindings/rust/sys/src/lib.rs @@ -96,6 +96,7 @@ pub const OSTREE_REPO_COMMIT_ITER_RESULT_DIR: OstreeRepoCommitIterResult = 3; pub type OstreeRepoMode = c_int; pub const OSTREE_REPO_MODE_BARE: OstreeRepoMode = 0; pub const OSTREE_REPO_MODE_ARCHIVE: OstreeRepoMode = 1; +pub const OSTREE_REPO_MODE_ARCHIVE_Z2: OstreeRepoMode = 1; pub const OSTREE_REPO_MODE_BARE_USER: OstreeRepoMode = 2; pub const OSTREE_REPO_MODE_BARE_USER_ONLY: OstreeRepoMode = 3; @@ -914,6 +915,7 @@ extern "C" { //========================================================================= // OstreeCollectionRef //========================================================================= + #[cfg(any(feature = "v2018_6", feature = "dox"))] pub fn ostree_collection_ref_get_type() -> GType; #[cfg(any(feature = "v2018_6", feature = "dox"))] pub fn ostree_collection_ref_new(collection_id: *const c_char, ref_name: *const c_char) -> *mut OstreeCollectionRef; @@ -933,6 +935,7 @@ extern "C" { //========================================================================= // OstreeCommitSizesEntry //========================================================================= + #[cfg(any(feature = "v2020_1", feature = "dox"))] pub fn ostree_commit_sizes_entry_get_type() -> GType; #[cfg(any(feature = "v2020_1", feature = "dox"))] pub fn ostree_commit_sizes_entry_new(checksum: *const c_char, objtype: OstreeObjectType, unpacked: u64, archived: u64) -> *mut OstreeCommitSizesEntry; @@ -990,6 +993,7 @@ extern "C" { //========================================================================= // OstreeRemote //========================================================================= + #[cfg(any(feature = "v2018_6", feature = "dox"))] pub fn ostree_remote_get_type() -> GType; #[cfg(any(feature = "v2018_6", feature = "dox"))] pub fn ostree_remote_get_name(remote: *mut OstreeRemote) -> *const c_char; @@ -1040,6 +1044,7 @@ extern "C" { //========================================================================= // OstreeRepoFinderResult //========================================================================= + #[cfg(any(feature = "v2018_6", feature = "dox"))] pub fn ostree_repo_finder_result_get_type() -> GType; #[cfg(any(feature = "v2018_6", feature = "dox"))] pub fn ostree_repo_finder_result_new(remote: *mut OstreeRemote, finder: *mut OstreeRepoFinder, priority: c_int, ref_to_checksum: *mut glib::GHashTable, ref_to_timestamp: *mut glib::GHashTable, summary_last_modified: u64) -> *mut OstreeRepoFinderResult;