From 19fef715921538012301d7af7540db414800a429 Mon Sep 17 00:00:00 2001 From: Felix Krull Date: Sat, 29 Sep 2018 19:14:14 +0200 Subject: [PATCH] Add as much of Repo as easily possible --- rust-bindings/rust/conf/libostree.toml | 69 +- rust-bindings/rust/libostree/Cargo.lock | 3 + rust-bindings/rust/libostree/Cargo.toml | 3 + .../rust/libostree/src/auto/async_progress.rs | 161 +++++ .../rust/libostree/src/auto/collection_ref.rs | 84 +++ .../rust/libostree/src/auto/enums.rs | 244 ++++++- .../rust/libostree/src/auto/flags.rs | 84 +++ .../libostree/src/auto/gpg_verify_result.rs | 96 +++ rust-bindings/rust/libostree/src/auto/mod.rs | 61 +- .../rust/libostree/src/auto/mutable_tree.rs | 142 ++++ .../rust/libostree/src/auto/remote.rs | 37 ++ rust-bindings/rust/libostree/src/auto/repo.rs | 617 +++++++++++++----- .../src/auto/repo_commit_modifier.rs | 49 ++ .../libostree/src/auto/repo_dev_ino_cache.rs | 35 + .../rust/libostree/src/auto/repo_file.rs | 104 +++ .../src/auto/repo_transaction_stats.rs | 21 + .../rust/libostree/src/auto/se_policy.rs | 127 ++++ .../rust/libostree/src/auto/versions.txt | 2 - rust-bindings/rust/libostree/src/lib.rs | 6 +- rust-bindings/rust/sample/Cargo.lock | 3 + 20 files changed, 1765 insertions(+), 183 deletions(-) create mode 100644 rust-bindings/rust/libostree/src/auto/async_progress.rs create mode 100644 rust-bindings/rust/libostree/src/auto/collection_ref.rs create mode 100644 rust-bindings/rust/libostree/src/auto/flags.rs create mode 100644 rust-bindings/rust/libostree/src/auto/gpg_verify_result.rs create mode 100644 rust-bindings/rust/libostree/src/auto/mutable_tree.rs create mode 100644 rust-bindings/rust/libostree/src/auto/remote.rs create mode 100644 rust-bindings/rust/libostree/src/auto/repo_commit_modifier.rs create mode 100644 rust-bindings/rust/libostree/src/auto/repo_dev_ino_cache.rs create mode 100644 rust-bindings/rust/libostree/src/auto/repo_file.rs create mode 100644 rust-bindings/rust/libostree/src/auto/repo_transaction_stats.rs create mode 100644 rust-bindings/rust/libostree/src/auto/se_policy.rs delete mode 100644 rust-bindings/rust/libostree/src/auto/versions.txt diff --git a/rust-bindings/rust/conf/libostree.toml b/rust-bindings/rust/conf/libostree.toml index 8a147270..045041ea 100644 --- a/rust-bindings/rust/conf/libostree.toml +++ b/rust-bindings/rust/conf/libostree.toml @@ -4,20 +4,48 @@ library = "OSTree" version = "1.0" target_path = "../libostree" deprecate_by_min_version = true -single_version_file = true girs_dir = "../gir-files" generate = [ - "OSTree.RepoMode", + "OSTree.AsyncProgress", + "OSTree.CollectionRef", + "OSTree.GpgSignatureFormatFlags", + "OSTree.GpgVerifyResult", "OSTree.ObjectType", + "OSTree.Remote", + "OSTree.RepoCheckoutMode", + "OSTree.RepoCheckoutOverwriteMode", + "OSTree.RepoCommitModifier", + "OSTree.RepoCommitState", + "OSTree.RepoDevInoCache", + "OSTree.RepoMode", + "OSTree.RepoPruneFlags", + "OSTree.RepoPullFlags", + "OSTree.RepoRemoteChange", + "OSTree.RepoResolveRevExtFlags", + "OSTree.RepoTransactionStats", + "OSTree.SePolicy", + "OSTree.SePolicyRestoreconFlags", + "OSTree.StaticDeltaGenerateOpt", + + #"OSTree.RepoPruneOptions", + #"OSTree.RepoExportArchiveOptions", + #"OSTree.RepoCheckoutOptions", + #"OSTree.RepoCheckoutAtOptions", ] manual = [ - "GLib.Error", - "GLib.Variant", "Gio.Cancellable", "Gio.File", + "Gio.FileInfo", + "Gio.FileQueryInfoFlags", + "Gio.InputStream", + "GLib.Bytes", + "GLib.Error", + "GLib.KeyFile", + "GLib.String", + "GLib.Variant", ] [[object]] @@ -27,12 +55,33 @@ status = "generate" pattern = ".+_async" ignore = true - [[object.function]] - pattern = "checkout_at" - [[object.function.parameter]] - name = "options" - const = true - [[object.function]] pattern = "mode_from_string" ignore = true + + [[object.function]] + pattern = "remote_gpg_import" + ignore = true + +[[object]] +name = "OSTree.RepoFile" +status = "generate" + [[object.function]] + pattern = "get_xattrs" + ignore = true + + [[object.function]] + pattern = "tree_find_child" + ignore = true + + [[object.function]] + pattern = "tree_query_child" + ignore = true + +[[object]] +name = "OSTree.MutableTree" +status = "generate" + [[object.function]] + pattern = "lookup" + ignore = true + diff --git a/rust-bindings/rust/libostree/Cargo.lock b/rust-bindings/rust/libostree/Cargo.lock index 966db214..f5f15b57 100644 --- a/rust-bindings/rust/libostree/Cargo.lock +++ b/rust-bindings/rust/libostree/Cargo.lock @@ -82,10 +82,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" name = "libostree" version = "0.2.0" dependencies = [ + "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", "gio 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "gio-sys 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "glib 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "glib-sys 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "gobject-sys 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", "libostree-sys 0.2.0", ] diff --git a/rust-bindings/rust/libostree/Cargo.toml b/rust-bindings/rust/libostree/Cargo.toml index a822c35d..8202c2ed 100644 --- a/rust-bindings/rust/libostree/Cargo.toml +++ b/rust-bindings/rust/libostree/Cargo.toml @@ -6,8 +6,11 @@ version = "0.2.0" name = "libostree" [dependencies] +libc = "^0.2.0" +bitflags = "^1.0.0" glib = "^0.6.0" gio = "^0.5.0" glib-sys = "^0.7" gobject-sys = "^0.7" +gio-sys = "^0.7" libostree-sys = { path = "../libostree-sys" } diff --git a/rust-bindings/rust/libostree/src/auto/async_progress.rs b/rust-bindings/rust/libostree/src/auto/async_progress.rs new file mode 100644 index 00000000..587602d8 --- /dev/null +++ b/rust-bindings/rust/libostree/src/auto/async_progress.rs @@ -0,0 +1,161 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir @ c385982) +// from gir-files (https://github.com/gtk-rs/gir-files @ ???) +// DO NOT EDIT + +use ffi; +use glib; +use glib::object::Downcast; +use glib::object::IsA; +use glib::signal::SignalHandlerId; +use glib::signal::connect; +use glib::translate::*; +use glib_ffi; +use gobject_ffi; +use std::boxed::Box as Box_; +use std::mem; +use std::mem::transmute; +use std::ptr; + +glib_wrapper! { + pub struct AsyncProgress(Object); + + match fn { + get_type => || ffi::ostree_async_progress_get_type(), + } +} + +impl AsyncProgress { + pub fn new() -> AsyncProgress { + unsafe { + from_glib_full(ffi::ostree_async_progress_new()) + } + } + + //pub fn new_and_connect>, Q: Into>>(changed: P, user_data: Q) -> AsyncProgress { + // unsafe { TODO: call ffi::ostree_async_progress_new_and_connect() } + //} +} + +impl Default for AsyncProgress { + fn default() -> Self { + Self::new() + } +} + +pub trait AsyncProgressExt { + fn finish(&self); + + //#[cfg(any(feature = "v2017_6", feature = "dox"))] + //fn get(&self, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs); + + #[cfg(any(feature = "v2017_6", feature = "dox"))] + fn get_status(&self) -> Option; + + fn get_uint(&self, key: &str) -> u32; + + fn get_uint64(&self, key: &str) -> u64; + + #[cfg(any(feature = "v2017_6", feature = "dox"))] + fn get_variant(&self, key: &str) -> Option; + + //#[cfg(any(feature = "v2017_6", feature = "dox"))] + //fn set(&self, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs); + + #[cfg(any(feature = "v2017_6", feature = "dox"))] + fn set_status<'a, P: Into>>(&self, status: P); + + fn set_uint(&self, key: &str, value: u32); + + fn set_uint64(&self, key: &str, value: u64); + + #[cfg(any(feature = "v2017_6", feature = "dox"))] + fn set_variant(&self, key: &str, value: &glib::Variant); + + fn connect_changed(&self, f: F) -> SignalHandlerId; +} + +impl + IsA> AsyncProgressExt for O { + fn finish(&self) { + unsafe { + ffi::ostree_async_progress_finish(self.to_glib_none().0); + } + } + + //#[cfg(any(feature = "v2017_6", feature = "dox"))] + //fn get(&self, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs) { + // unsafe { TODO: call ffi::ostree_async_progress_get() } + //} + + #[cfg(any(feature = "v2017_6", feature = "dox"))] + fn get_status(&self) -> Option { + unsafe { + from_glib_full(ffi::ostree_async_progress_get_status(self.to_glib_none().0)) + } + } + + fn get_uint(&self, key: &str) -> u32 { + unsafe { + ffi::ostree_async_progress_get_uint(self.to_glib_none().0, key.to_glib_none().0) + } + } + + fn get_uint64(&self, key: &str) -> u64 { + unsafe { + ffi::ostree_async_progress_get_uint64(self.to_glib_none().0, key.to_glib_none().0) + } + } + + #[cfg(any(feature = "v2017_6", feature = "dox"))] + fn get_variant(&self, key: &str) -> Option { + unsafe { + from_glib_full(ffi::ostree_async_progress_get_variant(self.to_glib_none().0, key.to_glib_none().0)) + } + } + + //#[cfg(any(feature = "v2017_6", feature = "dox"))] + //fn set(&self, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs) { + // unsafe { TODO: call ffi::ostree_async_progress_set() } + //} + + #[cfg(any(feature = "v2017_6", feature = "dox"))] + fn set_status<'a, P: Into>>(&self, status: P) { + let status = status.into(); + let status = status.to_glib_none(); + unsafe { + ffi::ostree_async_progress_set_status(self.to_glib_none().0, status.0); + } + } + + fn set_uint(&self, key: &str, value: u32) { + unsafe { + ffi::ostree_async_progress_set_uint(self.to_glib_none().0, key.to_glib_none().0, value); + } + } + + fn set_uint64(&self, key: &str, value: u64) { + unsafe { + ffi::ostree_async_progress_set_uint64(self.to_glib_none().0, key.to_glib_none().0, value); + } + } + + #[cfg(any(feature = "v2017_6", feature = "dox"))] + fn set_variant(&self, key: &str, value: &glib::Variant) { + unsafe { + ffi::ostree_async_progress_set_variant(self.to_glib_none().0, key.to_glib_none().0, value.to_glib_none().0); + } + } + + fn connect_changed(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "changed", + transmute(changed_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } +} + +unsafe extern "C" fn changed_trampoline

(this: *mut ffi::OstreeAsyncProgress, f: glib_ffi::gpointer) +where P: IsA { + let f: &&(Fn(&P) + 'static) = transmute(f); + f(&AsyncProgress::from_glib_borrow(this).downcast_unchecked()) +} diff --git a/rust-bindings/rust/libostree/src/auto/collection_ref.rs b/rust-bindings/rust/libostree/src/auto/collection_ref.rs new file mode 100644 index 00000000..c4dad645 --- /dev/null +++ b/rust-bindings/rust/libostree/src/auto/collection_ref.rs @@ -0,0 +1,84 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir @ c385982) +// from gir-files (https://github.com/gtk-rs/gir-files @ ???) +// DO NOT EDIT + +use ffi; +use glib::translate::*; +use glib_ffi; +use gobject_ffi; +use std::hash; +use std::mem; +use std::ptr; + +glib_wrapper! { + #[derive(Debug, PartialOrd, Ord)] + pub struct CollectionRef(Boxed); + + match fn { + copy => |ptr| gobject_ffi::g_boxed_copy(ffi::ostree_collection_ref_get_type(), ptr as *mut _) as *mut ffi::OstreeCollectionRef, + free => |ptr| gobject_ffi::g_boxed_free(ffi::ostree_collection_ref_get_type(), ptr as *mut _), + get_type => || ffi::ostree_collection_ref_get_type(), + } +} + +impl CollectionRef { + #[cfg(any(feature = "v2018_6", feature = "dox"))] + pub fn new<'a, P: Into>>(collection_id: P, ref_name: &str) -> CollectionRef { + let collection_id = collection_id.into(); + let collection_id = collection_id.to_glib_none(); + unsafe { + from_glib_full(ffi::ostree_collection_ref_new(collection_id.0, ref_name.to_glib_none().0)) + } + } + + #[cfg(any(feature = "v2018_6", feature = "dox"))] + pub fn dup(&self) -> Option { + unsafe { + from_glib_full(ffi::ostree_collection_ref_dup(self.to_glib_none().0)) + } + } + + #[cfg(any(feature = "v2018_6", feature = "dox"))] + pub fn dupv(refs: &[&CollectionRef]) -> Vec { + unsafe { + FromGlibPtrContainer::from_glib_full(ffi::ostree_collection_ref_dupv(refs.to_glib_none().0)) + } + } + + #[cfg(any(feature = "v2018_6", feature = "dox"))] + fn equal<'a, P: Into>>(&self, ref2: P) -> bool { + unsafe { + from_glib(ffi::ostree_collection_ref_equal(ToGlibPtr::<*mut ffi::OstreeCollectionRef>::to_glib_none(self).0 as glib_ffi::gconstpointer, ToGlibPtr::<*mut ffi::OstreeCollectionRef>::to_glib_none(ref2).0 as glib_ffi::gconstpointer)) + } + } + + #[cfg(any(feature = "v2018_6", feature = "dox"))] + pub fn freev(refs: &[&CollectionRef]) { + unsafe { + ffi::ostree_collection_ref_freev(refs.to_glib_full()); + } + } + + #[cfg(any(feature = "v2018_6", feature = "dox"))] + fn hash(&self) -> u32 { + unsafe { + ffi::ostree_collection_ref_hash(ToGlibPtr::<*mut ffi::OstreeCollectionRef>::to_glib_none(self).0 as glib_ffi::gconstpointer) + } + } +} + +impl PartialEq for CollectionRef { + #[inline] + fn eq(&self, other: &Self) -> bool { + self.equal(other) + } +} + +impl Eq for CollectionRef {} + +impl hash::Hash for CollectionRef { + #[inline] + fn hash(&self, state: &mut H) where H: hash::Hasher { + hash::Hash::hash(&self.hash(), state) + } +} diff --git a/rust-bindings/rust/libostree/src/auto/enums.rs b/rust-bindings/rust/libostree/src/auto/enums.rs index fd389246..85260f12 100644 --- a/rust-bindings/rust/libostree/src/auto/enums.rs +++ b/rust-bindings/rust/libostree/src/auto/enums.rs @@ -1,10 +1,40 @@ -// This file was generated by gir (https://github.com/gtk-rs/gir) -// from gir-files (https://github.com/gtk-rs/gir-files) +// This file was generated by gir (https://github.com/gtk-rs/gir @ c385982) +// from gir-files (https://github.com/gtk-rs/gir-files @ ???) // DO NOT EDIT use ffi; use glib::translate::*; +#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)] +#[derive(Clone, Copy)] +pub enum GpgSignatureFormatFlags { + GpgSignatureFormatDefault, + #[doc(hidden)] + __Unknown(i32), +} + +#[doc(hidden)] +impl ToGlib for GpgSignatureFormatFlags { + type GlibType = ffi::OstreeGpgSignatureFormatFlags; + + fn to_glib(&self) -> ffi::OstreeGpgSignatureFormatFlags { + match *self { + GpgSignatureFormatFlags::GpgSignatureFormatDefault => ffi::OSTREE_GPG_SIGNATURE_FORMAT_DEFAULT, + GpgSignatureFormatFlags::__Unknown(value) => value + } + } +} + +#[doc(hidden)] +impl FromGlib for GpgSignatureFormatFlags { + fn from_glib(value: ffi::OstreeGpgSignatureFormatFlags) -> Self { + match value { + 0 => GpgSignatureFormatFlags::GpgSignatureFormatDefault, + value => GpgSignatureFormatFlags::__Unknown(value), + } + } +} + #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)] #[derive(Clone, Copy)] pub enum ObjectType { @@ -53,6 +83,78 @@ impl FromGlib for ObjectType { } } +#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)] +#[derive(Clone, Copy)] +pub enum RepoCheckoutMode { + None, + User, + #[doc(hidden)] + __Unknown(i32), +} + +#[doc(hidden)] +impl ToGlib for RepoCheckoutMode { + type GlibType = ffi::OstreeRepoCheckoutMode; + + fn to_glib(&self) -> ffi::OstreeRepoCheckoutMode { + match *self { + RepoCheckoutMode::None => ffi::OSTREE_REPO_CHECKOUT_MODE_NONE, + RepoCheckoutMode::User => ffi::OSTREE_REPO_CHECKOUT_MODE_USER, + RepoCheckoutMode::__Unknown(value) => value + } + } +} + +#[doc(hidden)] +impl FromGlib for RepoCheckoutMode { + fn from_glib(value: ffi::OstreeRepoCheckoutMode) -> Self { + match value { + 0 => RepoCheckoutMode::None, + 1 => RepoCheckoutMode::User, + value => RepoCheckoutMode::__Unknown(value), + } + } +} + +#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)] +#[derive(Clone, Copy)] +pub enum RepoCheckoutOverwriteMode { + None, + UnionFiles, + AddFiles, + UnionIdentical, + #[doc(hidden)] + __Unknown(i32), +} + +#[doc(hidden)] +impl ToGlib for RepoCheckoutOverwriteMode { + type GlibType = ffi::OstreeRepoCheckoutOverwriteMode; + + fn to_glib(&self) -> ffi::OstreeRepoCheckoutOverwriteMode { + match *self { + RepoCheckoutOverwriteMode::None => ffi::OSTREE_REPO_CHECKOUT_OVERWRITE_NONE, + RepoCheckoutOverwriteMode::UnionFiles => ffi::OSTREE_REPO_CHECKOUT_OVERWRITE_UNION_FILES, + RepoCheckoutOverwriteMode::AddFiles => ffi::OSTREE_REPO_CHECKOUT_OVERWRITE_ADD_FILES, + RepoCheckoutOverwriteMode::UnionIdentical => ffi::OSTREE_REPO_CHECKOUT_OVERWRITE_UNION_IDENTICAL, + RepoCheckoutOverwriteMode::__Unknown(value) => value + } + } +} + +#[doc(hidden)] +impl FromGlib for RepoCheckoutOverwriteMode { + fn from_glib(value: ffi::OstreeRepoCheckoutOverwriteMode) -> Self { + match value { + 0 => RepoCheckoutOverwriteMode::None, + 1 => RepoCheckoutOverwriteMode::UnionFiles, + 2 => RepoCheckoutOverwriteMode::AddFiles, + 3 => RepoCheckoutOverwriteMode::UnionIdentical, + value => RepoCheckoutOverwriteMode::__Unknown(value), + } + } +} + #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)] #[derive(Clone, Copy)] pub enum RepoMode { @@ -92,3 +194,141 @@ impl FromGlib for RepoMode { } } +#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)] +#[derive(Clone, Copy)] +pub enum RepoPruneFlags { + None, + NoPrune, + RefsOnly, + #[doc(hidden)] + __Unknown(i32), +} + +#[doc(hidden)] +impl ToGlib for RepoPruneFlags { + type GlibType = ffi::OstreeRepoPruneFlags; + + fn to_glib(&self) -> ffi::OstreeRepoPruneFlags { + match *self { + RepoPruneFlags::None => ffi::OSTREE_REPO_PRUNE_FLAGS_NONE, + RepoPruneFlags::NoPrune => ffi::OSTREE_REPO_PRUNE_FLAGS_NO_PRUNE, + RepoPruneFlags::RefsOnly => ffi::OSTREE_REPO_PRUNE_FLAGS_REFS_ONLY, + RepoPruneFlags::__Unknown(value) => value + } + } +} + +#[doc(hidden)] +impl FromGlib for RepoPruneFlags { + fn from_glib(value: ffi::OstreeRepoPruneFlags) -> Self { + match value { + 0 => RepoPruneFlags::None, + 1 => RepoPruneFlags::NoPrune, + 2 => RepoPruneFlags::RefsOnly, + value => RepoPruneFlags::__Unknown(value), + } + } +} + +#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)] +#[derive(Clone, Copy)] +pub enum RepoRemoteChange { + Add, + AddIfNotExists, + Delete, + DeleteIfExists, + #[doc(hidden)] + __Unknown(i32), +} + +#[doc(hidden)] +impl ToGlib for RepoRemoteChange { + type GlibType = ffi::OstreeRepoRemoteChange; + + fn to_glib(&self) -> ffi::OstreeRepoRemoteChange { + match *self { + RepoRemoteChange::Add => ffi::OSTREE_REPO_REMOTE_CHANGE_ADD, + RepoRemoteChange::AddIfNotExists => ffi::OSTREE_REPO_REMOTE_CHANGE_ADD_IF_NOT_EXISTS, + RepoRemoteChange::Delete => ffi::OSTREE_REPO_REMOTE_CHANGE_DELETE, + RepoRemoteChange::DeleteIfExists => ffi::OSTREE_REPO_REMOTE_CHANGE_DELETE_IF_EXISTS, + RepoRemoteChange::__Unknown(value) => value + } + } +} + +#[doc(hidden)] +impl FromGlib for RepoRemoteChange { + fn from_glib(value: ffi::OstreeRepoRemoteChange) -> Self { + match value { + 0 => RepoRemoteChange::Add, + 1 => RepoRemoteChange::AddIfNotExists, + 2 => RepoRemoteChange::Delete, + 3 => RepoRemoteChange::DeleteIfExists, + value => RepoRemoteChange::__Unknown(value), + } + } +} + +#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)] +#[derive(Clone, Copy)] +pub enum RepoResolveRevExtFlags { + RepoResolveRevExtNone, + #[doc(hidden)] + __Unknown(i32), +} + +#[doc(hidden)] +impl ToGlib for RepoResolveRevExtFlags { + type GlibType = ffi::OstreeRepoResolveRevExtFlags; + + fn to_glib(&self) -> ffi::OstreeRepoResolveRevExtFlags { + match *self { + RepoResolveRevExtFlags::RepoResolveRevExtNone => ffi::OSTREE_REPO_RESOLVE_REV_EXT_NONE, + RepoResolveRevExtFlags::__Unknown(value) => value + } + } +} + +#[doc(hidden)] +impl FromGlib for RepoResolveRevExtFlags { + fn from_glib(value: ffi::OstreeRepoResolveRevExtFlags) -> Self { + match value { + 0 => RepoResolveRevExtFlags::RepoResolveRevExtNone, + value => RepoResolveRevExtFlags::__Unknown(value), + } + } +} + +#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)] +#[derive(Clone, Copy)] +pub enum StaticDeltaGenerateOpt { + Lowlatency, + Major, + #[doc(hidden)] + __Unknown(i32), +} + +#[doc(hidden)] +impl ToGlib for StaticDeltaGenerateOpt { + type GlibType = ffi::OstreeStaticDeltaGenerateOpt; + + fn to_glib(&self) -> ffi::OstreeStaticDeltaGenerateOpt { + match *self { + StaticDeltaGenerateOpt::Lowlatency => ffi::OSTREE_STATIC_DELTA_GENERATE_OPT_LOWLATENCY, + StaticDeltaGenerateOpt::Major => ffi::OSTREE_STATIC_DELTA_GENERATE_OPT_MAJOR, + StaticDeltaGenerateOpt::__Unknown(value) => value + } + } +} + +#[doc(hidden)] +impl FromGlib for StaticDeltaGenerateOpt { + fn from_glib(value: ffi::OstreeStaticDeltaGenerateOpt) -> Self { + match value { + 0 => StaticDeltaGenerateOpt::Lowlatency, + 1 => StaticDeltaGenerateOpt::Major, + value => StaticDeltaGenerateOpt::__Unknown(value), + } + } +} + diff --git a/rust-bindings/rust/libostree/src/auto/flags.rs b/rust-bindings/rust/libostree/src/auto/flags.rs new file mode 100644 index 00000000..6bc288a9 --- /dev/null +++ b/rust-bindings/rust/libostree/src/auto/flags.rs @@ -0,0 +1,84 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir @ c385982) +// from gir-files (https://github.com/gtk-rs/gir-files @ ???) +// DO NOT EDIT + +use ffi; +use glib::translate::*; + +#[cfg(any(feature = "v2015_7", feature = "dox"))] +bitflags! { + pub struct RepoCommitState: u32 { + const NORMAL = 0; + const PARTIAL = 1; + } +} + +#[cfg(any(feature = "v2015_7", feature = "dox"))] +#[doc(hidden)] +impl ToGlib for RepoCommitState { + type GlibType = ffi::OstreeRepoCommitState; + + fn to_glib(&self) -> ffi::OstreeRepoCommitState { + self.bits() + } +} + +#[cfg(any(feature = "v2015_7", feature = "dox"))] +#[doc(hidden)] +impl FromGlib for RepoCommitState { + fn from_glib(value: ffi::OstreeRepoCommitState) -> RepoCommitState { + RepoCommitState::from_bits_truncate(value) + } +} + +bitflags! { + pub struct RepoPullFlags: u32 { + const NONE = 0; + const MIRROR = 1; + const COMMIT_ONLY = 2; + const UNTRUSTED = 4; + const BAREUSERONLY_FILES = 8; + const TRUSTED_HTTP = 16; + } +} + +#[doc(hidden)] +impl ToGlib for RepoPullFlags { + type GlibType = ffi::OstreeRepoPullFlags; + + fn to_glib(&self) -> ffi::OstreeRepoPullFlags { + self.bits() + } +} + +#[doc(hidden)] +impl FromGlib for RepoPullFlags { + fn from_glib(value: ffi::OstreeRepoPullFlags) -> RepoPullFlags { + RepoPullFlags::from_bits_truncate(value) + } +} + +bitflags! { + pub struct SePolicyRestoreconFlags: u32 { + const NONE = 0; + const ALLOW_NOLABEL = 1; + const KEEP_EXISTING = 2; + } +} + +#[doc(hidden)] +impl ToGlib for SePolicyRestoreconFlags { + type GlibType = ffi::OstreeSePolicyRestoreconFlags; + + fn to_glib(&self) -> ffi::OstreeSePolicyRestoreconFlags { + self.bits() + } +} + +#[doc(hidden)] +impl FromGlib for SePolicyRestoreconFlags { + fn from_glib(value: ffi::OstreeSePolicyRestoreconFlags) -> SePolicyRestoreconFlags { + SePolicyRestoreconFlags::from_bits_truncate(value) + } +} + diff --git a/rust-bindings/rust/libostree/src/auto/gpg_verify_result.rs b/rust-bindings/rust/libostree/src/auto/gpg_verify_result.rs new file mode 100644 index 00000000..c6f32955 --- /dev/null +++ b/rust-bindings/rust/libostree/src/auto/gpg_verify_result.rs @@ -0,0 +1,96 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir @ c385982) +// from gir-files (https://github.com/gtk-rs/gir-files @ ???) +// DO NOT EDIT + +use Error; +use GpgSignatureFormatFlags; +use ffi; +use glib; +use glib::object::IsA; +use glib::translate::*; +use glib_ffi; +use gobject_ffi; +use std::mem; +use std::ptr; + +glib_wrapper! { + pub struct GpgVerifyResult(Object); + + match fn { + get_type => || ffi::ostree_gpg_verify_result_get_type(), + } +} + +impl GpgVerifyResult { + pub fn describe_variant<'a, P: Into>>(variant: &glib::Variant, output_buffer: &mut glib::String, line_prefix: P, flags: GpgSignatureFormatFlags) { + let line_prefix = line_prefix.into(); + let line_prefix = line_prefix.to_glib_none(); + unsafe { + ffi::ostree_gpg_verify_result_describe_variant(variant.to_glib_none().0, output_buffer.to_glib_none_mut().0, line_prefix.0, flags.to_glib()); + } + } +} + +pub trait GpgVerifyResultExt { + fn count_all(&self) -> u32; + + fn count_valid(&self) -> u32; + + fn describe<'a, P: Into>>(&self, signature_index: u32, output_buffer: &mut glib::String, line_prefix: P, flags: GpgSignatureFormatFlags); + + //fn get(&self, signature_index: u32, attrs: /*Unimplemented*/&CArray TypeId { ns_id: 1, id: 26 }) -> Option; + + fn get_all(&self, signature_index: u32) -> Option; + + fn lookup(&self, key_id: &str) -> Option; + + fn require_valid_signature(&self) -> Result<(), Error>; +} + +impl> GpgVerifyResultExt for O { + fn count_all(&self) -> u32 { + unsafe { + ffi::ostree_gpg_verify_result_count_all(self.to_glib_none().0) + } + } + + fn count_valid(&self) -> u32 { + unsafe { + ffi::ostree_gpg_verify_result_count_valid(self.to_glib_none().0) + } + } + + fn describe<'a, P: Into>>(&self, signature_index: u32, output_buffer: &mut glib::String, line_prefix: P, flags: GpgSignatureFormatFlags) { + let line_prefix = line_prefix.into(); + let line_prefix = line_prefix.to_glib_none(); + unsafe { + ffi::ostree_gpg_verify_result_describe(self.to_glib_none().0, signature_index, output_buffer.to_glib_none_mut().0, line_prefix.0, flags.to_glib()); + } + } + + //fn get(&self, signature_index: u32, attrs: /*Unimplemented*/&CArray TypeId { ns_id: 1, id: 26 }) -> Option { + // unsafe { TODO: call ffi::ostree_gpg_verify_result_get() } + //} + + fn get_all(&self, signature_index: u32) -> Option { + unsafe { + from_glib_full(ffi::ostree_gpg_verify_result_get_all(self.to_glib_none().0, signature_index)) + } + } + + fn lookup(&self, key_id: &str) -> Option { + unsafe { + let mut out_signature_index = mem::uninitialized(); + let ret = from_glib(ffi::ostree_gpg_verify_result_lookup(self.to_glib_none().0, key_id.to_glib_none().0, &mut out_signature_index)); + if ret { Some(out_signature_index) } else { None } + } + } + + fn require_valid_signature(&self) -> Result<(), Error> { + unsafe { + let mut error = ptr::null_mut(); + let _ = ffi::ostree_gpg_verify_result_require_valid_signature(self.to_glib_none().0, &mut error); + if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } + } + } +} diff --git a/rust-bindings/rust/libostree/src/auto/mod.rs b/rust-bindings/rust/libostree/src/auto/mod.rs index a520b4f9..97d3482e 100644 --- a/rust-bindings/rust/libostree/src/auto/mod.rs +++ b/rust-bindings/rust/libostree/src/auto/mod.rs @@ -1,16 +1,73 @@ -// This file was generated by gir (https://github.com/gtk-rs/gir) -// from gir-files (https://github.com/gtk-rs/gir-files) +// This file was generated by gir (https://github.com/gtk-rs/gir @ c385982) +// from gir-files (https://github.com/gtk-rs/gir-files @ ???) // DO NOT EDIT +mod async_progress; +pub use self::async_progress::AsyncProgress; +pub use self::async_progress::AsyncProgressExt; + +mod gpg_verify_result; +pub use self::gpg_verify_result::GpgVerifyResult; +pub use self::gpg_verify_result::GpgVerifyResultExt; + +mod mutable_tree; +pub use self::mutable_tree::MutableTree; +pub use self::mutable_tree::MutableTreeExt; + mod repo; pub use self::repo::Repo; pub use self::repo::RepoExt; +mod repo_file; +pub use self::repo_file::RepoFile; +pub use self::repo_file::RepoFileExt; + +mod se_policy; +pub use self::se_policy::SePolicy; +pub use self::se_policy::SePolicyExt; + +#[cfg(any(feature = "v2018_6", feature = "dox"))] +mod collection_ref; +#[cfg(any(feature = "v2018_6", feature = "dox"))] +pub use self::collection_ref::CollectionRef; + +#[cfg(any(feature = "v2018_6", feature = "dox"))] +mod remote; +#[cfg(any(feature = "v2018_6", feature = "dox"))] +pub use self::remote::Remote; + +mod repo_commit_modifier; +pub use self::repo_commit_modifier::RepoCommitModifier; + +mod repo_dev_ino_cache; +pub use self::repo_dev_ino_cache::RepoDevInoCache; + +mod repo_transaction_stats; +pub use self::repo_transaction_stats::RepoTransactionStats; + mod enums; +pub use self::enums::GpgSignatureFormatFlags; pub use self::enums::ObjectType; +pub use self::enums::RepoCheckoutMode; +pub use self::enums::RepoCheckoutOverwriteMode; pub use self::enums::RepoMode; +pub use self::enums::RepoPruneFlags; +pub use self::enums::RepoRemoteChange; +pub use self::enums::RepoResolveRevExtFlags; +pub use self::enums::StaticDeltaGenerateOpt; + +mod flags; +#[cfg(any(feature = "v2015_7", feature = "dox"))] +pub use self::flags::RepoCommitState; +pub use self::flags::RepoPullFlags; +pub use self::flags::SePolicyRestoreconFlags; #[doc(hidden)] pub mod traits { + pub use super::AsyncProgressExt; + pub use super::GpgVerifyResultExt; + pub use super::MutableTreeExt; pub use super::RepoExt; + pub use super::RepoFileExt; + pub use super::SePolicyExt; } diff --git a/rust-bindings/rust/libostree/src/auto/mutable_tree.rs b/rust-bindings/rust/libostree/src/auto/mutable_tree.rs new file mode 100644 index 00000000..e4c368d1 --- /dev/null +++ b/rust-bindings/rust/libostree/src/auto/mutable_tree.rs @@ -0,0 +1,142 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir @ c385982) +// from gir-files (https://github.com/gtk-rs/gir-files @ ???) +// DO NOT EDIT + +use Error; +use Repo; +use ffi; +use glib::object::IsA; +use glib::translate::*; +use glib_ffi; +use gobject_ffi; +use std::mem; +use std::ptr; + +glib_wrapper! { + pub struct MutableTree(Object); + + match fn { + get_type => || ffi::ostree_mutable_tree_get_type(), + } +} + +impl MutableTree { + pub fn new() -> MutableTree { + unsafe { + from_glib_full(ffi::ostree_mutable_tree_new()) + } + } + + pub fn new_from_checksum(repo: &Repo, contents_checksum: &str, metadata_checksum: &str) -> MutableTree { + unsafe { + from_glib_full(ffi::ostree_mutable_tree_new_from_checksum(repo.to_glib_none().0, contents_checksum.to_glib_none().0, metadata_checksum.to_glib_none().0)) + } + } +} + +impl Default for MutableTree { + fn default() -> Self { + Self::new() + } +} + +pub trait MutableTreeExt { + #[cfg(any(feature = "v2018_7", feature = "dox"))] + fn check_error(&self) -> Result<(), Error>; + + 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 fill_empty_from_dirtree(&self, repo: &Repo, contents_checksum: &str, metadata_checksum: &str) -> bool; + + fn get_contents_checksum(&self) -> Option; + + //fn get_files(&self) -> /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 0, id: 28 }/TypeId { ns_id: 0, id: 28 }; + + fn get_metadata_checksum(&self) -> Option; + + //fn get_subdirs(&self) -> /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 0, id: 28 }/TypeId { ns_id: 1, id: 37 }; + + fn replace_file(&self, name: &str, checksum: &str) -> Result<(), Error>; + + fn set_contents_checksum(&self, checksum: &str); + + 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; +} + +impl> MutableTreeExt for O { + #[cfg(any(feature = "v2018_7", feature = "dox"))] + fn check_error(&self) -> Result<(), Error> { + unsafe { + let mut error = ptr::null_mut(); + let _ = ffi::ostree_mutable_tree_check_error(self.to_glib_none().0, &mut error); + if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } + } + } + + fn ensure_dir(&self, name: &str) -> Result { + unsafe { + let mut out_subdir = ptr::null_mut(); + let mut error = ptr::null_mut(); + let _ = ffi::ostree_mutable_tree_ensure_dir(self.to_glib_none().0, name.to_glib_none().0, &mut out_subdir, &mut error); + if error.is_null() { Ok(from_glib_full(out_subdir)) } else { Err(from_glib_full(error)) } + } + } + + //fn ensure_parent_dirs(&self, split_path: /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 0, id: 28 }, metadata_checksum: &str) -> Result { + // unsafe { TODO: call ffi::ostree_mutable_tree_ensure_parent_dirs() } + //} + + fn fill_empty_from_dirtree(&self, repo: &Repo, contents_checksum: &str, metadata_checksum: &str) -> bool { + unsafe { + from_glib(ffi::ostree_mutable_tree_fill_empty_from_dirtree(self.to_glib_none().0, repo.to_glib_none().0, contents_checksum.to_glib_none().0, metadata_checksum.to_glib_none().0)) + } + } + + fn get_contents_checksum(&self) -> Option { + unsafe { + from_glib_none(ffi::ostree_mutable_tree_get_contents_checksum(self.to_glib_none().0)) + } + } + + //fn get_files(&self) -> /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 0, id: 28 }/TypeId { ns_id: 0, id: 28 } { + // unsafe { TODO: call ffi::ostree_mutable_tree_get_files() } + //} + + fn get_metadata_checksum(&self) -> Option { + unsafe { + from_glib_none(ffi::ostree_mutable_tree_get_metadata_checksum(self.to_glib_none().0)) + } + } + + //fn get_subdirs(&self) -> /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 0, id: 28 }/TypeId { ns_id: 1, id: 37 } { + // unsafe { TODO: call ffi::ostree_mutable_tree_get_subdirs() } + //} + + fn replace_file(&self, name: &str, checksum: &str) -> Result<(), Error> { + unsafe { + let mut error = ptr::null_mut(); + let _ = ffi::ostree_mutable_tree_replace_file(self.to_glib_none().0, name.to_glib_none().0, checksum.to_glib_none().0, &mut error); + if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } + } + } + + fn set_contents_checksum(&self, checksum: &str) { + unsafe { + ffi::ostree_mutable_tree_set_contents_checksum(self.to_glib_none().0, checksum.to_glib_none().0); + } + } + + fn set_metadata_checksum(&self, checksum: &str) { + unsafe { + ffi::ostree_mutable_tree_set_metadata_checksum(self.to_glib_none().0, checksum.to_glib_none().0); + } + } + + //fn walk(&self, split_path: /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 0, id: 28 }, start: u32) -> Result { + // unsafe { TODO: call ffi::ostree_mutable_tree_walk() } + //} +} diff --git a/rust-bindings/rust/libostree/src/auto/remote.rs b/rust-bindings/rust/libostree/src/auto/remote.rs new file mode 100644 index 00000000..51d6b49e --- /dev/null +++ b/rust-bindings/rust/libostree/src/auto/remote.rs @@ -0,0 +1,37 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir @ c385982) +// from gir-files (https://github.com/gtk-rs/gir-files @ ???) +// DO NOT EDIT + +use ffi; +use glib::translate::*; +use glib_ffi; +use gobject_ffi; +use std::mem; +use std::ptr; + +glib_wrapper! { + #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] + pub struct Remote(Shared); + + match fn { + ref => |ptr| ffi::ostree_remote_ref(ptr), + unref => |ptr| ffi::ostree_remote_unref(ptr), + get_type => || ffi::ostree_remote_get_type(), + } +} + +impl Remote { + #[cfg(any(feature = "v2018_6", feature = "dox"))] + pub fn get_name(&self) -> Option { + unsafe { + from_glib_none(ffi::ostree_remote_get_name(self.to_glib_none().0)) + } + } + + #[cfg(any(feature = "v2018_6", feature = "dox"))] + pub fn get_url(&self) -> Option { + unsafe { + from_glib_full(ffi::ostree_remote_get_url(self.to_glib_none().0)) + } + } +} diff --git a/rust-bindings/rust/libostree/src/auto/repo.rs b/rust-bindings/rust/libostree/src/auto/repo.rs index fda2909e..fa58c00a 100644 --- a/rust-bindings/rust/libostree/src/auto/repo.rs +++ b/rust-bindings/rust/libostree/src/auto/repo.rs @@ -1,20 +1,45 @@ -// This file was generated by gir (https://github.com/gtk-rs/gir) -// from gir-files (https://github.com/gtk-rs/gir-files) +// This file was generated by gir (https://github.com/gtk-rs/gir @ c385982) +// from gir-files (https://github.com/gtk-rs/gir-files @ ???) // DO NOT EDIT +use AsyncProgress; +#[cfg(any(feature = "v2018_6", feature = "dox"))] +use CollectionRef; use Error; +use GpgVerifyResult; +use MutableTree; use ObjectType; +#[cfg(any(feature = "v2018_6", feature = "dox"))] +use Remote; +use RepoCheckoutMode; +use RepoCheckoutOverwriteMode; +use RepoCommitModifier; +#[cfg(any(feature = "v2015_7", feature = "dox"))] +use RepoCommitState; +use RepoFile; use RepoMode; +use RepoPruneFlags; +use RepoPullFlags; +use RepoRemoteChange; +use RepoResolveRevExtFlags; +use RepoTransactionStats; +use StaticDeltaGenerateOpt; use ffi; use gio; use glib; use glib::StaticType; use glib::Value; +use glib::object::Downcast; use glib::object::IsA; +use glib::signal::SignalHandlerId; +use glib::signal::connect; use glib::translate::*; use glib_ffi; use gobject_ffi; +use libc; +use std::boxed::Box as Box_; use std::mem; +use std::mem::transmute; use std::ptr; glib_wrapper! { @@ -64,7 +89,7 @@ impl Repo { } } - //pub fn pull_default_console_progress_changed>>(progress: /*Ignored*/&AsyncProgress, user_data: P) { + //pub fn pull_default_console_progress_changed>>(progress: &AsyncProgress, user_data: P) { // unsafe { TODO: call ffi::ostree_repo_pull_default_console_progress_changed() } //} @@ -88,19 +113,19 @@ pub trait RepoExt { fn add_gpg_signature_summary<'a, 'b, P: Into>, Q: Into>>(&self, key_id: &[&str], homedir: P, cancellable: Q) -> Result<(), Error>; - //fn append_gpg_signature<'a, P: Into>>(&self, commit_checksum: &str, signature_bytes: /*Ignored*/&glib::Bytes, cancellable: P) -> Result<(), Error>; + fn append_gpg_signature<'a, P: Into>>(&self, commit_checksum: &str, signature_bytes: &glib::Bytes, cancellable: P) -> Result<(), Error>; //fn checkout_at<'a, 'b, P: Into>, Q: Into>>(&self, options: P, destination_dfd: i32, destination_path: &str, commit: &str, cancellable: Q) -> Result<(), Error>; fn checkout_gc<'a, P: Into>>(&self, cancellable: P) -> Result<(), Error>; - //fn checkout_tree<'a, P: IsA, Q: Into>>(&self, mode: /*Ignored*/RepoCheckoutMode, overwrite_mode: /*Ignored*/RepoCheckoutOverwriteMode, destination: &P, source: /*Ignored*/&RepoFile, source_info: /*Ignored*/&gio::FileInfo, cancellable: Q) -> Result<(), Error>; + fn checkout_tree<'a, P: IsA, Q: Into>>(&self, mode: RepoCheckoutMode, overwrite_mode: RepoCheckoutOverwriteMode, destination: &P, source: &RepoFile, source_info: &gio::FileInfo, cancellable: Q) -> Result<(), Error>; //fn checkout_tree_at<'a, 'b, P: Into>, Q: Into>>(&self, options: P, destination_dfd: i32, destination_path: &str, commit: &str, cancellable: Q) -> Result<(), Error>; - //fn commit_transaction<'a, P: Into>>(&self, out_stats: /*Ignored*/RepoTransactionStats, cancellable: P) -> Result<(), Error>; + fn commit_transaction<'a, P: Into>>(&self, cancellable: P) -> Result; - //fn copy_config(&self) -> /*Ignored*/Option; + fn copy_config(&self) -> Option; fn create<'a, P: Into>>(&self, mode: RepoMode, cancellable: P) -> Result<(), Error>; @@ -109,7 +134,7 @@ pub trait RepoExt { #[cfg(any(feature = "v2017_12", feature = "dox"))] fn equal(&self, b: &Repo) -> bool; - //fn export_tree_to_archive<'a, P: Into>, Q: Into>>(&self, opts: /*Ignored*/&mut RepoExportArchiveOptions, root: /*Ignored*/&RepoFile, archive: P, cancellable: Q) -> Result<(), Error>; + //fn export_tree_to_archive<'a, P: Into>, Q: Into>>(&self, opts: /*Ignored*/&mut RepoExportArchiveOptions, root: &RepoFile, archive: P, cancellable: Q) -> Result<(), Error>; #[cfg(any(feature = "v2017_15", feature = "dox"))] fn fsck_object<'a, P: Into>>(&self, objtype: ObjectType, sha256: &str, cancellable: P) -> Result<(), Error>; @@ -117,7 +142,7 @@ pub trait RepoExt { #[cfg(any(feature = "v2018_6", feature = "dox"))] fn get_collection_id(&self) -> Option; - //fn get_config(&self) -> /*Ignored*/Option; + fn get_config(&self) -> Option; fn get_dfd(&self) -> i32; @@ -135,14 +160,14 @@ pub trait RepoExt { fn get_remote_option<'a, P: Into>>(&self, remote_name: &str, option_name: &str, default_value: P) -> Result; - //fn gpg_verify_data<'a, 'b, 'c, 'd, P: Into>, Q: IsA + 'b, R: Into>, S: IsA + 'c, T: Into>, U: Into>>(&self, remote_name: P, data: /*Ignored*/&glib::Bytes, signatures: /*Ignored*/&glib::Bytes, keyringdir: R, extra_keyring: T, cancellable: U) -> Result; + fn gpg_verify_data<'a, 'b, 'c, 'd, P: Into>, Q: IsA + 'b, R: Into>, S: IsA + 'c, T: Into>, U: Into>>(&self, remote_name: P, data: &glib::Bytes, signatures: &glib::Bytes, keyringdir: R, extra_keyring: T, cancellable: U) -> Result; fn has_object<'a, P: Into>>(&self, objtype: ObjectType, checksum: &str, cancellable: P) -> Result; #[cfg(any(feature = "v2017_12", feature = "dox"))] fn hash(&self) -> u32; - //fn import_archive_to_mtree<'a, 'b, P: Into>, Q: Into>, R: Into>>(&self, opts: /*Ignored*/&mut RepoImportArchiveOptions, archive: P, mtree: /*Ignored*/&MutableTree, modifier: Q, cancellable: R) -> Result<(), Error>; + //fn import_archive_to_mtree<'a, 'b, P: Into>, Q: Into>, R: Into>>(&self, opts: /*Ignored*/&mut RepoImportArchiveOptions, archive: P, mtree: &MutableTree, modifier: Q, cancellable: R) -> Result<(), Error>; fn import_object_from<'a, P: Into>>(&self, source: &Repo, objtype: ObjectType, checksum: &str, cancellable: P) -> Result<(), Error>; @@ -165,12 +190,12 @@ pub trait RepoExt { //fn list_static_delta_names<'a, P: Into>>(&self, out_deltas: /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 0, id: 28 }, cancellable: P) -> Result<(), Error>; - //#[cfg(any(feature = "v2015_7", feature = "dox"))] - //fn load_commit(&self, checksum: &str) -> Result<(glib::Variant, /*Ignored*/RepoCommitState), Error>; + #[cfg(any(feature = "v2015_7", feature = "dox"))] + fn load_commit(&self, checksum: &str) -> Result<(glib::Variant, RepoCommitState), Error>; - //fn load_file<'a, P: Into>>(&self, checksum: &str, out_input: /*Ignored*/Option, out_file_info: /*Ignored*/Option, cancellable: P) -> Result, Error>; + fn load_file<'a, P: Into>>(&self, checksum: &str, cancellable: P) -> Result<(Option, Option, Option), Error>; - //fn load_object_stream<'a, P: Into>>(&self, objtype: ObjectType, checksum: &str, out_input: /*Ignored*/gio::InputStream, cancellable: P) -> Result; + fn load_object_stream<'a, P: Into>>(&self, objtype: ObjectType, checksum: &str, cancellable: P) -> Result<(gio::InputStream, u64), Error>; fn load_variant(&self, objtype: ObjectType, sha256: &str) -> Result; @@ -183,17 +208,17 @@ pub trait RepoExt { fn prepare_transaction<'a, P: Into>>(&self, cancellable: P) -> Result; - //fn prune<'a, P: Into>>(&self, flags: /*Ignored*/RepoPruneFlags, depth: i32, cancellable: P) -> Result<(i32, i32, u64), Error>; + fn prune<'a, P: Into>>(&self, flags: RepoPruneFlags, depth: i32, cancellable: P) -> Result<(i32, i32, u64), Error>; //fn prune_from_reachable<'a, P: Into>>(&self, options: /*Ignored*/&mut RepoPruneOptions, cancellable: P) -> Result<(i32, i32, u64), Error>; fn prune_static_deltas<'a, 'b, P: Into>, Q: Into>>(&self, commit: P, cancellable: Q) -> Result<(), Error>; - //fn pull<'a, 'b, P: Into>, Q: Into>>(&self, remote_name: &str, refs_to_fetch: &[&str], flags: /*Ignored*/RepoPullFlags, progress: P, cancellable: Q) -> Result<(), Error>; + fn pull<'a, 'b, P: Into>, Q: Into>>(&self, remote_name: &str, refs_to_fetch: &[&str], flags: RepoPullFlags, progress: P, cancellable: Q) -> Result<(), Error>; - //fn pull_one_dir<'a, 'b, P: Into>, Q: Into>>(&self, remote_name: &str, dir_to_pull: &str, refs_to_fetch: &[&str], flags: /*Ignored*/RepoPullFlags, progress: P, cancellable: Q) -> Result<(), Error>; + fn pull_one_dir<'a, 'b, P: Into>, Q: Into>>(&self, remote_name: &str, dir_to_pull: &str, refs_to_fetch: &[&str], flags: RepoPullFlags, progress: P, cancellable: Q) -> Result<(), Error>; - //fn pull_with_options<'a, 'b, P: Into>, Q: Into>>(&self, remote_name_or_baseurl: &str, options: &glib::Variant, progress: P, cancellable: Q) -> Result<(), Error>; + fn pull_with_options<'a, 'b, P: Into>, Q: Into>>(&self, remote_name_or_baseurl: &str, options: &glib::Variant, progress: P, cancellable: Q) -> Result<(), Error>; fn query_object_storage_size<'a, P: Into>>(&self, objtype: ObjectType, sha256: &str, cancellable: P) -> Result; @@ -207,13 +232,13 @@ pub trait RepoExt { fn remote_add<'a, 'b, P: Into>, Q: Into>>(&self, name: &str, url: &str, options: P, cancellable: Q) -> Result<(), Error>; - //fn remote_change<'a, 'b, 'c, P: IsA + 'a, Q: Into>, R: Into>, S: Into>>(&self, sysroot: Q, changeop: /*Ignored*/RepoRemoteChange, name: &str, url: &str, options: R, cancellable: S) -> Result<(), Error>; + fn remote_change<'a, 'b, 'c, P: IsA + 'a, Q: Into>, R: Into>, S: Into>>(&self, sysroot: Q, changeop: RepoRemoteChange, name: &str, url: &str, options: R, cancellable: S) -> Result<(), Error>; fn remote_delete<'a, P: Into>>(&self, name: &str, cancellable: P) -> Result<(), Error>; - //fn remote_fetch_summary<'a, P: Into>>(&self, name: &str, out_summary: /*Ignored*/glib::Bytes, out_signatures: /*Ignored*/glib::Bytes, cancellable: P) -> Result<(), Error>; + fn remote_fetch_summary<'a, P: Into>>(&self, name: &str, cancellable: P) -> Result<(glib::Bytes, glib::Bytes), Error>; - //fn remote_fetch_summary_with_options<'a, 'b, P: Into>, Q: Into>>(&self, name: &str, options: P, out_summary: /*Ignored*/glib::Bytes, out_signatures: /*Ignored*/glib::Bytes, cancellable: Q) -> Result<(), Error>; + fn remote_fetch_summary_with_options<'a, 'b, P: Into>, Q: Into>>(&self, name: &str, options: P, cancellable: Q) -> Result<(glib::Bytes, glib::Bytes), Error>; fn remote_get_gpg_verify(&self, name: &str) -> Result; @@ -221,8 +246,6 @@ pub trait RepoExt { fn remote_get_url(&self, name: &str) -> Result; - //fn remote_gpg_import<'a, 'b, P: IsA + 'a, Q: Into>, R: Into>, S: Into>>(&self, name: &str, source_stream: Q, key_ids: &[&str], out_imported: R, cancellable: S) -> Result<(), Error>; - fn remote_list(&self) -> Vec; //#[cfg(any(feature = "v2018_6", feature = "dox"))] @@ -230,15 +253,15 @@ pub trait RepoExt { //fn remote_list_refs<'a, P: Into>>(&self, remote_name: &str, out_all_refs: /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 0, id: 28 }/TypeId { ns_id: 0, id: 28 }, cancellable: P) -> Result<(), Error>; - //#[cfg(any(feature = "v2018_6", feature = "dox"))] - //fn resolve_collection_ref<'a, P: Into>>(&self, ref_: /*Ignored*/&CollectionRef, allow_noent: bool, flags: /*Ignored*/RepoResolveRevExtFlags, cancellable: P) -> Result, Error>; + #[cfg(any(feature = "v2018_6", feature = "dox"))] + fn resolve_collection_ref<'a, P: Into>>(&self, ref_: &CollectionRef, allow_noent: bool, flags: RepoResolveRevExtFlags, cancellable: P) -> Result, Error>; - //#[cfg(any(feature = "v2018_6", feature = "dox"))] - //fn resolve_keyring_for_collection<'a, P: Into>>(&self, collection_id: &str, cancellable: P) -> Result; + #[cfg(any(feature = "v2018_6", feature = "dox"))] + fn resolve_keyring_for_collection<'a, P: Into>>(&self, collection_id: &str, cancellable: P) -> Result; fn resolve_rev(&self, refspec: &str, allow_noent: bool) -> Result; - //fn resolve_rev_ext(&self, refspec: &str, allow_noent: bool, flags: /*Ignored*/RepoResolveRevExtFlags) -> Result; + fn resolve_rev_ext(&self, refspec: &str, allow_noent: bool, flags: RepoResolveRevExtFlags) -> Result; fn scan_hardlinks<'a, P: Into>>(&self, cancellable: P) -> Result<(), Error>; @@ -249,8 +272,8 @@ pub trait RepoExt { #[cfg(any(feature = "v2018_6", feature = "dox"))] fn set_collection_id<'a, P: Into>>(&self, collection_id: P) -> Result<(), Error>; - //#[cfg(any(feature = "v2018_6", feature = "dox"))] - //fn set_collection_ref_immediate<'a, 'b, P: Into>, Q: Into>>(&self, ref_: /*Ignored*/&CollectionRef, checksum: P, cancellable: Q) -> Result<(), Error>; + #[cfg(any(feature = "v2018_6", feature = "dox"))] + fn set_collection_ref_immediate<'a, 'b, P: Into>, Q: Into>>(&self, ref_: &CollectionRef, checksum: P, cancellable: Q) -> Result<(), Error>; fn set_disable_fsync(&self, disable_fsync: bool); @@ -262,10 +285,10 @@ pub trait RepoExt { fn static_delta_execute_offline<'a, P: IsA, Q: Into>>(&self, dir_or_file: &P, skip_validation: bool, cancellable: Q) -> Result<(), Error>; - //fn static_delta_generate<'a, 'b, 'c, P: Into>, Q: Into>, R: Into>>(&self, opt: /*Ignored*/StaticDeltaGenerateOpt, from: &str, to: &str, metadata: P, params: Q, cancellable: R) -> Result<(), Error>; + fn static_delta_generate<'a, 'b, 'c, P: Into>, Q: Into>, R: Into>>(&self, opt: StaticDeltaGenerateOpt, from: &str, to: &str, metadata: P, params: Q, cancellable: R) -> Result<(), Error>; - //#[cfg(any(feature = "v2018_6", feature = "dox"))] - //fn transaction_set_collection_ref<'a, P: Into>>(&self, ref_: /*Ignored*/&CollectionRef, checksum: P); + #[cfg(any(feature = "v2018_6", feature = "dox"))] + fn transaction_set_collection_ref<'a, P: Into>>(&self, ref_: &CollectionRef, checksum: P); fn transaction_set_ref<'a, 'b, P: Into>, Q: Into>>(&self, remote: P, ref_: &str, checksum: Q); @@ -283,43 +306,43 @@ pub trait RepoExt { fn verify_commit<'a, 'b, 'c, P: IsA + 'a, Q: Into>, R: IsA + 'b, S: Into>, T: Into>>(&self, commit_checksum: &str, keyringdir: Q, extra_keyring: S, cancellable: T) -> Result<(), Error>; - //fn verify_commit_ext<'a, 'b, 'c, P: IsA + 'a, Q: Into>, R: IsA + 'b, S: Into>, T: Into>>(&self, commit_checksum: &str, keyringdir: Q, extra_keyring: S, cancellable: T) -> Result; + fn verify_commit_ext<'a, 'b, 'c, P: IsA + 'a, Q: Into>, R: IsA + 'b, S: Into>, T: Into>>(&self, commit_checksum: &str, keyringdir: Q, extra_keyring: S, cancellable: T) -> Result; - //fn verify_commit_for_remote<'a, P: Into>>(&self, commit_checksum: &str, remote_name: &str, cancellable: P) -> Result; + fn verify_commit_for_remote<'a, P: Into>>(&self, commit_checksum: &str, remote_name: &str, cancellable: P) -> Result; - //fn verify_summary<'a, P: Into>>(&self, remote_name: &str, summary: /*Ignored*/&glib::Bytes, signatures: /*Ignored*/&glib::Bytes, cancellable: P) -> Result; + fn verify_summary<'a, P: Into>>(&self, remote_name: &str, summary: &glib::Bytes, signatures: &glib::Bytes, cancellable: P) -> Result; - //fn write_archive_to_mtree<'a, 'b, P: IsA, Q: Into>, R: Into>>(&self, archive: &P, mtree: /*Ignored*/&MutableTree, modifier: Q, autocreate_parents: bool, cancellable: R) -> Result<(), Error>; + fn write_archive_to_mtree<'a, 'b, P: IsA, Q: Into>, R: Into>>(&self, archive: &P, mtree: &MutableTree, modifier: Q, autocreate_parents: bool, cancellable: R) -> Result<(), Error>; - //fn write_commit<'a, 'b, 'c, 'd, 'e, P: Into>, Q: Into>, R: Into>, S: Into>, T: Into>>(&self, parent: P, subject: Q, body: R, metadata: S, root: /*Ignored*/&RepoFile, cancellable: T) -> Result; + fn write_commit<'a, 'b, 'c, 'd, 'e, P: Into>, Q: Into>, R: Into>, S: Into>, T: Into>>(&self, parent: P, subject: Q, body: R, metadata: S, root: &RepoFile, cancellable: T) -> Result; fn write_commit_detached_metadata<'a, 'b, P: Into>, Q: Into>>(&self, checksum: &str, metadata: P, cancellable: Q) -> Result<(), Error>; - //fn write_commit_with_time<'a, 'b, 'c, 'd, 'e, P: Into>, Q: Into>, R: Into>, S: Into>, T: Into>>(&self, parent: P, subject: Q, body: R, metadata: S, root: /*Ignored*/&RepoFile, time: u64, cancellable: T) -> Result; + fn write_commit_with_time<'a, 'b, 'c, 'd, 'e, P: Into>, Q: Into>, R: Into>, S: Into>, T: Into>>(&self, parent: P, subject: Q, body: R, metadata: S, root: &RepoFile, time: u64, cancellable: T) -> Result; - //fn write_config(&self, new_config: /*Ignored*/&glib::KeyFile) -> Result<(), Error>; + fn write_config(&self, new_config: &glib::KeyFile) -> Result<(), Error>; - //fn write_content<'a, 'b, P: Into>, Q: IsA, R: Into>>(&self, expected_checksum: P, object_input: &Q, length: u64, out_csum: /*Unknown conversion*//*Unimplemented*/FixedArray TypeId { ns_id: 0, id: 3 }; 32, cancellable: R) -> Result<(), Error>; + //fn write_content<'a, 'b, P: Into>, Q: IsA, R: Into>>(&self, expected_checksum: P, object_input: &Q, length: u64, out_csum: /*Unknown conversion*//*Unimplemented*/FixedArray TypeId { ns_id: 0, id: 3 }; 32, cancellable: R) -> Result<(), Error>; - //fn write_content_trusted<'a, P: IsA, Q: Into>>(&self, checksum: &str, object_input: &P, length: u64, cancellable: Q) -> Result<(), Error>; + fn write_content_trusted<'a, P: IsA, Q: Into>>(&self, checksum: &str, object_input: &P, length: u64, cancellable: Q) -> Result<(), Error>; - //fn write_dfd_to_mtree<'a, 'b, P: Into>, Q: Into>>(&self, dfd: i32, path: &str, mtree: /*Ignored*/&MutableTree, modifier: P, cancellable: Q) -> Result<(), Error>; + fn write_dfd_to_mtree<'a, 'b, P: Into>, Q: Into>>(&self, dfd: i32, path: &str, mtree: &MutableTree, modifier: P, cancellable: Q) -> Result<(), Error>; - //fn write_directory_to_mtree<'a, 'b, P: IsA, Q: Into>, R: Into>>(&self, dir: &P, mtree: /*Ignored*/&MutableTree, modifier: Q, cancellable: R) -> Result<(), Error>; + fn write_directory_to_mtree<'a, 'b, P: IsA, Q: Into>, R: Into>>(&self, dir: &P, mtree: &MutableTree, modifier: Q, cancellable: R) -> Result<(), Error>; //fn write_metadata<'a, 'b, P: Into>, Q: Into>>(&self, objtype: ObjectType, expected_checksum: P, object: &glib::Variant, out_csum: /*Unknown conversion*//*Unimplemented*/FixedArray TypeId { ns_id: 0, id: 3 }; 32, cancellable: Q) -> Result<(), Error>; - //fn write_metadata_stream_trusted<'a, P: IsA, Q: Into>>(&self, objtype: ObjectType, checksum: &str, object_input: &P, length: u64, cancellable: Q) -> Result<(), Error>; + fn write_metadata_stream_trusted<'a, P: IsA, Q: Into>>(&self, objtype: ObjectType, checksum: &str, object_input: &P, length: u64, cancellable: Q) -> Result<(), Error>; fn write_metadata_trusted<'a, P: Into>>(&self, objtype: ObjectType, checksum: &str, variant: &glib::Variant, cancellable: P) -> Result<(), Error>; - //fn write_mtree<'a, P: Into>>(&self, mtree: /*Ignored*/&MutableTree, cancellable: P) -> Result; + fn write_mtree<'a, P: Into>>(&self, mtree: &MutableTree, cancellable: P) -> Result; fn get_property_remotes_config_dir(&self) -> Option; fn get_property_sysroot_path(&self) -> Option; - //fn connect_gpg_verify_result(&self, f: F) -> SignalHandlerId; + fn connect_gpg_verify_result(&self, f: F) -> SignalHandlerId; } impl + IsA> RepoExt for O { @@ -345,9 +368,15 @@ impl + IsA> RepoExt for O { } } - //fn append_gpg_signature<'a, P: Into>>(&self, commit_checksum: &str, signature_bytes: /*Ignored*/&glib::Bytes, cancellable: P) -> Result<(), Error> { - // unsafe { TODO: call ffi::ostree_repo_append_gpg_signature() } - //} + fn append_gpg_signature<'a, P: Into>>(&self, commit_checksum: &str, signature_bytes: &glib::Bytes, cancellable: P) -> Result<(), Error> { + let cancellable = cancellable.into(); + let cancellable = cancellable.to_glib_none(); + unsafe { + let mut error = ptr::null_mut(); + let _ = ffi::ostree_repo_append_gpg_signature(self.to_glib_none().0, commit_checksum.to_glib_none().0, signature_bytes.to_glib_none().0, cancellable.0, &mut error); + if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } + } + } //fn checkout_at<'a, 'b, P: Into>, Q: Into>>(&self, options: P, destination_dfd: i32, destination_path: &str, commit: &str, cancellable: Q) -> Result<(), Error> { // unsafe { TODO: call ffi::ostree_repo_checkout_at() } @@ -363,21 +392,36 @@ impl + IsA> RepoExt for O { } } - //fn checkout_tree<'a, P: IsA, Q: Into>>(&self, mode: /*Ignored*/RepoCheckoutMode, overwrite_mode: /*Ignored*/RepoCheckoutOverwriteMode, destination: &P, source: /*Ignored*/&RepoFile, source_info: /*Ignored*/&gio::FileInfo, cancellable: Q) -> Result<(), Error> { - // unsafe { TODO: call ffi::ostree_repo_checkout_tree() } - //} + fn checkout_tree<'a, P: IsA, Q: Into>>(&self, mode: RepoCheckoutMode, overwrite_mode: RepoCheckoutOverwriteMode, destination: &P, source: &RepoFile, source_info: &gio::FileInfo, cancellable: Q) -> Result<(), Error> { + let cancellable = cancellable.into(); + let cancellable = cancellable.to_glib_none(); + unsafe { + let mut error = ptr::null_mut(); + let _ = ffi::ostree_repo_checkout_tree(self.to_glib_none().0, mode.to_glib(), overwrite_mode.to_glib(), destination.to_glib_none().0, source.to_glib_none().0, source_info.to_glib_none().0, cancellable.0, &mut error); + if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } + } + } //fn checkout_tree_at<'a, 'b, P: Into>, Q: Into>>(&self, options: P, destination_dfd: i32, destination_path: &str, commit: &str, cancellable: Q) -> Result<(), Error> { // unsafe { TODO: call ffi::ostree_repo_checkout_tree_at() } //} - //fn commit_transaction<'a, P: Into>>(&self, out_stats: /*Ignored*/RepoTransactionStats, cancellable: P) -> Result<(), Error> { - // unsafe { TODO: call ffi::ostree_repo_commit_transaction() } - //} + fn commit_transaction<'a, P: Into>>(&self, cancellable: P) -> Result { + let cancellable = cancellable.into(); + let cancellable = cancellable.to_glib_none(); + unsafe { + let mut out_stats = RepoTransactionStats::uninitialized(); + let mut error = ptr::null_mut(); + let _ = ffi::ostree_repo_commit_transaction(self.to_glib_none().0, out_stats.to_glib_none_mut().0, cancellable.0, &mut error); + if error.is_null() { Ok(out_stats) } else { Err(from_glib_full(error)) } + } + } - //fn copy_config(&self) -> /*Ignored*/Option { - // unsafe { TODO: call ffi::ostree_repo_copy_config() } - //} + fn copy_config(&self) -> Option { + unsafe { + from_glib_full(ffi::ostree_repo_copy_config(self.to_glib_none().0)) + } + } fn create<'a, P: Into>>(&self, mode: RepoMode, cancellable: P) -> Result<(), Error> { let cancellable = cancellable.into(); @@ -406,7 +450,7 @@ impl + IsA> RepoExt for O { } } - //fn export_tree_to_archive<'a, P: Into>, Q: Into>>(&self, opts: /*Ignored*/&mut RepoExportArchiveOptions, root: /*Ignored*/&RepoFile, archive: P, cancellable: Q) -> Result<(), Error> { + //fn export_tree_to_archive<'a, P: Into>, Q: Into>>(&self, opts: /*Ignored*/&mut RepoExportArchiveOptions, root: &RepoFile, archive: P, cancellable: Q) -> Result<(), Error> { // unsafe { TODO: call ffi::ostree_repo_export_tree_to_archive() } //} @@ -428,9 +472,11 @@ impl + IsA> RepoExt for O { } } - //fn get_config(&self) -> /*Ignored*/Option { - // unsafe { TODO: call ffi::ostree_repo_get_config() } - //} + fn get_config(&self) -> Option { + unsafe { + from_glib_none(ffi::ostree_repo_get_config(self.to_glib_none().0)) + } + } fn get_dfd(&self) -> i32 { unsafe { @@ -491,9 +537,21 @@ impl + IsA> RepoExt for O { } } - //fn gpg_verify_data<'a, 'b, 'c, 'd, P: Into>, Q: IsA + 'b, R: Into>, S: IsA + 'c, T: Into>, U: Into>>(&self, remote_name: P, data: /*Ignored*/&glib::Bytes, signatures: /*Ignored*/&glib::Bytes, keyringdir: R, extra_keyring: T, cancellable: U) -> Result { - // unsafe { TODO: call ffi::ostree_repo_gpg_verify_data() } - //} + fn gpg_verify_data<'a, 'b, 'c, 'd, P: Into>, Q: IsA + 'b, R: Into>, S: IsA + 'c, T: Into>, U: Into>>(&self, remote_name: P, data: &glib::Bytes, signatures: &glib::Bytes, keyringdir: R, extra_keyring: T, cancellable: U) -> Result { + let remote_name = remote_name.into(); + let remote_name = remote_name.to_glib_none(); + let keyringdir = keyringdir.into(); + let keyringdir = keyringdir.to_glib_none(); + let extra_keyring = extra_keyring.into(); + let extra_keyring = extra_keyring.to_glib_none(); + let cancellable = cancellable.into(); + let cancellable = cancellable.to_glib_none(); + unsafe { + let mut error = ptr::null_mut(); + let ret = ffi::ostree_repo_gpg_verify_data(self.to_glib_none().0, remote_name.0, data.to_glib_none().0, signatures.to_glib_none().0, keyringdir.0, extra_keyring.0, cancellable.0, &mut error); + if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) } + } + } fn has_object<'a, P: Into>>(&self, objtype: ObjectType, checksum: &str, cancellable: P) -> Result { let cancellable = cancellable.into(); @@ -513,7 +571,7 @@ impl + IsA> RepoExt for O { } } - //fn import_archive_to_mtree<'a, 'b, P: Into>, Q: Into>, R: Into>>(&self, opts: /*Ignored*/&mut RepoImportArchiveOptions, archive: P, mtree: /*Ignored*/&MutableTree, modifier: Q, cancellable: R) -> Result<(), Error> { + //fn import_archive_to_mtree<'a, 'b, P: Into>, Q: Into>, R: Into>>(&self, opts: /*Ignored*/&mut RepoImportArchiveOptions, archive: P, mtree: &MutableTree, modifier: Q, cancellable: R) -> Result<(), Error> { // unsafe { TODO: call ffi::ostree_repo_import_archive_to_mtree() } //} @@ -576,18 +634,41 @@ impl + IsA> RepoExt for O { // unsafe { TODO: call ffi::ostree_repo_list_static_delta_names() } //} - //#[cfg(any(feature = "v2015_7", feature = "dox"))] - //fn load_commit(&self, checksum: &str) -> Result<(glib::Variant, /*Ignored*/RepoCommitState), Error> { - // unsafe { TODO: call ffi::ostree_repo_load_commit() } - //} + #[cfg(any(feature = "v2015_7", feature = "dox"))] + fn load_commit(&self, checksum: &str) -> Result<(glib::Variant, RepoCommitState), Error> { + unsafe { + let mut out_commit = ptr::null_mut(); + let mut out_state = mem::uninitialized(); + let mut error = ptr::null_mut(); + let _ = ffi::ostree_repo_load_commit(self.to_glib_none().0, checksum.to_glib_none().0, &mut out_commit, &mut out_state, &mut error); + if error.is_null() { Ok((from_glib_full(out_commit), from_glib(out_state))) } else { Err(from_glib_full(error)) } + } + } - //fn load_file<'a, P: Into>>(&self, checksum: &str, out_input: /*Ignored*/Option, out_file_info: /*Ignored*/Option, cancellable: P) -> Result, Error> { - // unsafe { TODO: call ffi::ostree_repo_load_file() } - //} + fn load_file<'a, P: Into>>(&self, checksum: &str, cancellable: P) -> Result<(Option, Option, Option), Error> { + let cancellable = cancellable.into(); + let cancellable = cancellable.to_glib_none(); + unsafe { + let mut out_input = ptr::null_mut(); + let mut out_file_info = ptr::null_mut(); + let mut out_xattrs = ptr::null_mut(); + let mut error = ptr::null_mut(); + let _ = ffi::ostree_repo_load_file(self.to_glib_none().0, checksum.to_glib_none().0, &mut out_input, &mut out_file_info, &mut out_xattrs, cancellable.0, &mut error); + if error.is_null() { Ok((from_glib_full(out_input), from_glib_full(out_file_info), from_glib_full(out_xattrs))) } else { Err(from_glib_full(error)) } + } + } - //fn load_object_stream<'a, P: Into>>(&self, objtype: ObjectType, checksum: &str, out_input: /*Ignored*/gio::InputStream, cancellable: P) -> Result { - // unsafe { TODO: call ffi::ostree_repo_load_object_stream() } - //} + fn load_object_stream<'a, P: Into>>(&self, objtype: ObjectType, checksum: &str, cancellable: P) -> Result<(gio::InputStream, u64), Error> { + let cancellable = cancellable.into(); + let cancellable = cancellable.to_glib_none(); + unsafe { + let mut out_input = ptr::null_mut(); + let mut out_size = mem::uninitialized(); + let mut error = ptr::null_mut(); + let _ = ffi::ostree_repo_load_object_stream(self.to_glib_none().0, objtype.to_glib(), checksum.to_glib_none().0, &mut out_input, &mut out_size, cancellable.0, &mut error); + if error.is_null() { Ok((from_glib_full(out_input), out_size)) } else { Err(from_glib_full(error)) } + } + } fn load_variant(&self, objtype: ObjectType, sha256: &str) -> Result { unsafe { @@ -637,9 +718,18 @@ impl + IsA> RepoExt for O { } } - //fn prune<'a, P: Into>>(&self, flags: /*Ignored*/RepoPruneFlags, depth: i32, cancellable: P) -> Result<(i32, i32, u64), Error> { - // unsafe { TODO: call ffi::ostree_repo_prune() } - //} + fn prune<'a, P: Into>>(&self, flags: RepoPruneFlags, depth: i32, cancellable: P) -> Result<(i32, i32, u64), Error> { + let cancellable = cancellable.into(); + let cancellable = cancellable.to_glib_none(); + unsafe { + let mut out_objects_total = mem::uninitialized(); + let mut out_objects_pruned = mem::uninitialized(); + let mut out_pruned_object_size_total = mem::uninitialized(); + let mut error = ptr::null_mut(); + let _ = ffi::ostree_repo_prune(self.to_glib_none().0, flags.to_glib(), depth, &mut out_objects_total, &mut out_objects_pruned, &mut out_pruned_object_size_total, cancellable.0, &mut error); + if error.is_null() { Ok((out_objects_total, out_objects_pruned, out_pruned_object_size_total)) } else { Err(from_glib_full(error)) } + } + } //fn prune_from_reachable<'a, P: Into>>(&self, options: /*Ignored*/&mut RepoPruneOptions, cancellable: P) -> Result<(i32, i32, u64), Error> { // unsafe { TODO: call ffi::ostree_repo_prune_from_reachable() } @@ -657,17 +747,41 @@ impl + IsA> RepoExt for O { } } - //fn pull<'a, 'b, P: Into>, Q: Into>>(&self, remote_name: &str, refs_to_fetch: &[&str], flags: /*Ignored*/RepoPullFlags, progress: P, cancellable: Q) -> Result<(), Error> { - // unsafe { TODO: call ffi::ostree_repo_pull() } - //} + fn pull<'a, 'b, P: Into>, Q: Into>>(&self, remote_name: &str, refs_to_fetch: &[&str], flags: RepoPullFlags, progress: P, cancellable: Q) -> Result<(), Error> { + let progress = progress.into(); + let progress = progress.to_glib_none(); + let cancellable = cancellable.into(); + let cancellable = cancellable.to_glib_none(); + unsafe { + let mut error = ptr::null_mut(); + let _ = ffi::ostree_repo_pull(self.to_glib_none().0, remote_name.to_glib_none().0, refs_to_fetch.to_glib_none().0, flags.to_glib(), progress.0, cancellable.0, &mut error); + if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } + } + } - //fn pull_one_dir<'a, 'b, P: Into>, Q: Into>>(&self, remote_name: &str, dir_to_pull: &str, refs_to_fetch: &[&str], flags: /*Ignored*/RepoPullFlags, progress: P, cancellable: Q) -> Result<(), Error> { - // unsafe { TODO: call ffi::ostree_repo_pull_one_dir() } - //} + fn pull_one_dir<'a, 'b, P: Into>, Q: Into>>(&self, remote_name: &str, dir_to_pull: &str, refs_to_fetch: &[&str], flags: RepoPullFlags, progress: P, cancellable: Q) -> Result<(), Error> { + let progress = progress.into(); + let progress = progress.to_glib_none(); + let cancellable = cancellable.into(); + let cancellable = cancellable.to_glib_none(); + unsafe { + let mut error = ptr::null_mut(); + let _ = ffi::ostree_repo_pull_one_dir(self.to_glib_none().0, remote_name.to_glib_none().0, dir_to_pull.to_glib_none().0, refs_to_fetch.to_glib_none().0, flags.to_glib(), progress.0, cancellable.0, &mut error); + if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } + } + } - //fn pull_with_options<'a, 'b, P: Into>, Q: Into>>(&self, remote_name_or_baseurl: &str, options: &glib::Variant, progress: P, cancellable: Q) -> Result<(), Error> { - // unsafe { TODO: call ffi::ostree_repo_pull_with_options() } - //} + fn pull_with_options<'a, 'b, P: Into>, Q: Into>>(&self, remote_name_or_baseurl: &str, options: &glib::Variant, progress: P, cancellable: Q) -> Result<(), Error> { + let progress = progress.into(); + let progress = progress.to_glib_none(); + let cancellable = cancellable.into(); + let cancellable = cancellable.to_glib_none(); + unsafe { + let mut error = ptr::null_mut(); + let _ = ffi::ostree_repo_pull_with_options(self.to_glib_none().0, remote_name_or_baseurl.to_glib_none().0, options.to_glib_none().0, progress.0, cancellable.0, &mut error); + if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } + } + } fn query_object_storage_size<'a, P: Into>>(&self, objtype: ObjectType, sha256: &str, cancellable: P) -> Result { let cancellable = cancellable.into(); @@ -737,9 +851,19 @@ impl + IsA> RepoExt for O { } } - //fn remote_change<'a, 'b, 'c, P: IsA + 'a, Q: Into>, R: Into>, S: Into>>(&self, sysroot: Q, changeop: /*Ignored*/RepoRemoteChange, name: &str, url: &str, options: R, cancellable: S) -> Result<(), Error> { - // unsafe { TODO: call ffi::ostree_repo_remote_change() } - //} + fn remote_change<'a, 'b, 'c, P: IsA + 'a, Q: Into>, R: Into>, S: Into>>(&self, sysroot: Q, changeop: RepoRemoteChange, name: &str, url: &str, options: R, cancellable: S) -> Result<(), Error> { + let sysroot = sysroot.into(); + let sysroot = sysroot.to_glib_none(); + let options = options.into(); + let options = options.to_glib_none(); + let cancellable = cancellable.into(); + let cancellable = cancellable.to_glib_none(); + unsafe { + let mut error = ptr::null_mut(); + let _ = ffi::ostree_repo_remote_change(self.to_glib_none().0, sysroot.0, changeop.to_glib(), name.to_glib_none().0, url.to_glib_none().0, options.0, cancellable.0, &mut error); + if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } + } + } fn remote_delete<'a, P: Into>>(&self, name: &str, cancellable: P) -> Result<(), Error> { let cancellable = cancellable.into(); @@ -751,13 +875,31 @@ impl + IsA> RepoExt for O { } } - //fn remote_fetch_summary<'a, P: Into>>(&self, name: &str, out_summary: /*Ignored*/glib::Bytes, out_signatures: /*Ignored*/glib::Bytes, cancellable: P) -> Result<(), Error> { - // unsafe { TODO: call ffi::ostree_repo_remote_fetch_summary() } - //} + fn remote_fetch_summary<'a, P: Into>>(&self, name: &str, cancellable: P) -> Result<(glib::Bytes, glib::Bytes), Error> { + let cancellable = cancellable.into(); + let cancellable = cancellable.to_glib_none(); + unsafe { + let mut out_summary = ptr::null_mut(); + let mut out_signatures = ptr::null_mut(); + let mut error = ptr::null_mut(); + let _ = ffi::ostree_repo_remote_fetch_summary(self.to_glib_none().0, name.to_glib_none().0, &mut out_summary, &mut out_signatures, cancellable.0, &mut error); + if error.is_null() { Ok((from_glib_full(out_summary), from_glib_full(out_signatures))) } else { Err(from_glib_full(error)) } + } + } - //fn remote_fetch_summary_with_options<'a, 'b, P: Into>, Q: Into>>(&self, name: &str, options: P, out_summary: /*Ignored*/glib::Bytes, out_signatures: /*Ignored*/glib::Bytes, cancellable: Q) -> Result<(), Error> { - // unsafe { TODO: call ffi::ostree_repo_remote_fetch_summary_with_options() } - //} + fn remote_fetch_summary_with_options<'a, 'b, P: Into>, Q: Into>>(&self, name: &str, options: P, cancellable: Q) -> Result<(glib::Bytes, glib::Bytes), Error> { + let options = options.into(); + let options = options.to_glib_none(); + let cancellable = cancellable.into(); + let cancellable = cancellable.to_glib_none(); + unsafe { + let mut out_summary = ptr::null_mut(); + let mut out_signatures = ptr::null_mut(); + let mut error = ptr::null_mut(); + let _ = ffi::ostree_repo_remote_fetch_summary_with_options(self.to_glib_none().0, name.to_glib_none().0, options.0, &mut out_summary, &mut out_signatures, cancellable.0, &mut error); + if error.is_null() { Ok((from_glib_full(out_summary), from_glib_full(out_signatures))) } else { Err(from_glib_full(error)) } + } + } fn remote_get_gpg_verify(&self, name: &str) -> Result { unsafe { @@ -786,10 +928,6 @@ impl + IsA> RepoExt for O { } } - //fn remote_gpg_import<'a, 'b, P: IsA + 'a, Q: Into>, R: Into>, S: Into>>(&self, name: &str, source_stream: Q, key_ids: &[&str], out_imported: R, cancellable: S) -> Result<(), Error> { - // unsafe { TODO: call ffi::ostree_repo_remote_gpg_import() } - //} - fn remote_list(&self) -> Vec { unsafe { let mut out_n_remotes = mem::uninitialized(); @@ -807,15 +945,28 @@ impl + IsA> RepoExt for O { // unsafe { TODO: call ffi::ostree_repo_remote_list_refs() } //} - //#[cfg(any(feature = "v2018_6", feature = "dox"))] - //fn resolve_collection_ref<'a, P: Into>>(&self, ref_: /*Ignored*/&CollectionRef, allow_noent: bool, flags: /*Ignored*/RepoResolveRevExtFlags, cancellable: P) -> Result, Error> { - // unsafe { TODO: call ffi::ostree_repo_resolve_collection_ref() } - //} + #[cfg(any(feature = "v2018_6", feature = "dox"))] + fn resolve_collection_ref<'a, P: Into>>(&self, ref_: &CollectionRef, allow_noent: bool, flags: RepoResolveRevExtFlags, cancellable: P) -> Result, Error> { + let cancellable = cancellable.into(); + let cancellable = cancellable.to_glib_none(); + unsafe { + let mut out_rev = ptr::null_mut(); + let mut error = ptr::null_mut(); + let _ = ffi::ostree_repo_resolve_collection_ref(self.to_glib_none().0, ref_.to_glib_none().0, allow_noent.to_glib(), flags.to_glib(), &mut out_rev, cancellable.0, &mut error); + if error.is_null() { Ok(from_glib_full(out_rev)) } else { Err(from_glib_full(error)) } + } + } - //#[cfg(any(feature = "v2018_6", feature = "dox"))] - //fn resolve_keyring_for_collection<'a, P: Into>>(&self, collection_id: &str, cancellable: P) -> Result { - // unsafe { TODO: call ffi::ostree_repo_resolve_keyring_for_collection() } - //} + #[cfg(any(feature = "v2018_6", feature = "dox"))] + fn resolve_keyring_for_collection<'a, P: Into>>(&self, collection_id: &str, cancellable: P) -> Result { + let cancellable = cancellable.into(); + let cancellable = cancellable.to_glib_none(); + unsafe { + let mut error = ptr::null_mut(); + let ret = ffi::ostree_repo_resolve_keyring_for_collection(self.to_glib_none().0, collection_id.to_glib_none().0, cancellable.0, &mut error); + if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) } + } + } fn resolve_rev(&self, refspec: &str, allow_noent: bool) -> Result { unsafe { @@ -826,9 +977,14 @@ impl + IsA> RepoExt for O { } } - //fn resolve_rev_ext(&self, refspec: &str, allow_noent: bool, flags: /*Ignored*/RepoResolveRevExtFlags) -> Result { - // unsafe { TODO: call ffi::ostree_repo_resolve_rev_ext() } - //} + fn resolve_rev_ext(&self, refspec: &str, allow_noent: bool, flags: RepoResolveRevExtFlags) -> Result { + unsafe { + let mut out_rev = ptr::null_mut(); + let mut error = ptr::null_mut(); + let _ = ffi::ostree_repo_resolve_rev_ext(self.to_glib_none().0, refspec.to_glib_none().0, allow_noent.to_glib(), flags.to_glib(), &mut out_rev, &mut error); + if error.is_null() { Ok(from_glib_full(out_rev)) } else { Err(from_glib_full(error)) } + } + } fn scan_hardlinks<'a, P: Into>>(&self, cancellable: P) -> Result<(), Error> { let cancellable = cancellable.into(); @@ -875,10 +1031,18 @@ impl + IsA> RepoExt for O { } } - //#[cfg(any(feature = "v2018_6", feature = "dox"))] - //fn set_collection_ref_immediate<'a, 'b, P: Into>, Q: Into>>(&self, ref_: /*Ignored*/&CollectionRef, checksum: P, cancellable: Q) -> Result<(), Error> { - // unsafe { TODO: call ffi::ostree_repo_set_collection_ref_immediate() } - //} + #[cfg(any(feature = "v2018_6", feature = "dox"))] + fn set_collection_ref_immediate<'a, 'b, P: Into>, Q: Into>>(&self, ref_: &CollectionRef, checksum: P, cancellable: Q) -> Result<(), Error> { + let checksum = checksum.into(); + let checksum = checksum.to_glib_none(); + let cancellable = cancellable.into(); + let cancellable = cancellable.to_glib_none(); + unsafe { + let mut error = ptr::null_mut(); + let _ = ffi::ostree_repo_set_collection_ref_immediate(self.to_glib_none().0, ref_.to_glib_none().0, checksum.0, cancellable.0, &mut error); + if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } + } + } fn set_disable_fsync(&self, disable_fsync: bool) { unsafe { @@ -932,14 +1096,28 @@ impl + IsA> RepoExt for O { } } - //fn static_delta_generate<'a, 'b, 'c, P: Into>, Q: Into>, R: Into>>(&self, opt: /*Ignored*/StaticDeltaGenerateOpt, from: &str, to: &str, metadata: P, params: Q, cancellable: R) -> Result<(), Error> { - // unsafe { TODO: call ffi::ostree_repo_static_delta_generate() } - //} + fn static_delta_generate<'a, 'b, 'c, P: Into>, Q: Into>, R: Into>>(&self, opt: StaticDeltaGenerateOpt, from: &str, to: &str, metadata: P, params: Q, cancellable: R) -> Result<(), Error> { + let metadata = metadata.into(); + let metadata = metadata.to_glib_none(); + let params = params.into(); + let params = params.to_glib_none(); + let cancellable = cancellable.into(); + let cancellable = cancellable.to_glib_none(); + unsafe { + let mut error = ptr::null_mut(); + let _ = ffi::ostree_repo_static_delta_generate(self.to_glib_none().0, opt.to_glib(), from.to_glib_none().0, to.to_glib_none().0, metadata.0, params.0, cancellable.0, &mut error); + if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } + } + } - //#[cfg(any(feature = "v2018_6", feature = "dox"))] - //fn transaction_set_collection_ref<'a, P: Into>>(&self, ref_: /*Ignored*/&CollectionRef, checksum: P) { - // unsafe { TODO: call ffi::ostree_repo_transaction_set_collection_ref() } - //} + #[cfg(any(feature = "v2018_6", feature = "dox"))] + fn transaction_set_collection_ref<'a, P: Into>>(&self, ref_: &CollectionRef, checksum: P) { + let checksum = checksum.into(); + let checksum = checksum.to_glib_none(); + unsafe { + ffi::ostree_repo_transaction_set_collection_ref(self.to_glib_none().0, ref_.to_glib_none().0, checksum.0); + } + } fn transaction_set_ref<'a, 'b, P: Into>, Q: Into>>(&self, remote: P, ref_: &str, checksum: Q) { let remote = remote.into(); @@ -991,25 +1169,70 @@ impl + IsA> RepoExt for O { } } - //fn verify_commit_ext<'a, 'b, 'c, P: IsA + 'a, Q: Into>, R: IsA + 'b, S: Into>, T: Into>>(&self, commit_checksum: &str, keyringdir: Q, extra_keyring: S, cancellable: T) -> Result { - // unsafe { TODO: call ffi::ostree_repo_verify_commit_ext() } - //} + fn verify_commit_ext<'a, 'b, 'c, P: IsA + 'a, Q: Into>, R: IsA + 'b, S: Into>, T: Into>>(&self, commit_checksum: &str, keyringdir: Q, extra_keyring: S, cancellable: T) -> Result { + let keyringdir = keyringdir.into(); + let keyringdir = keyringdir.to_glib_none(); + let extra_keyring = extra_keyring.into(); + let extra_keyring = extra_keyring.to_glib_none(); + let cancellable = cancellable.into(); + let cancellable = cancellable.to_glib_none(); + unsafe { + let mut error = ptr::null_mut(); + let ret = ffi::ostree_repo_verify_commit_ext(self.to_glib_none().0, commit_checksum.to_glib_none().0, keyringdir.0, extra_keyring.0, cancellable.0, &mut error); + if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) } + } + } - //fn verify_commit_for_remote<'a, P: Into>>(&self, commit_checksum: &str, remote_name: &str, cancellable: P) -> Result { - // unsafe { TODO: call ffi::ostree_repo_verify_commit_for_remote() } - //} + fn verify_commit_for_remote<'a, P: Into>>(&self, commit_checksum: &str, remote_name: &str, cancellable: P) -> Result { + let cancellable = cancellable.into(); + let cancellable = cancellable.to_glib_none(); + unsafe { + let mut error = ptr::null_mut(); + let ret = ffi::ostree_repo_verify_commit_for_remote(self.to_glib_none().0, commit_checksum.to_glib_none().0, remote_name.to_glib_none().0, cancellable.0, &mut error); + if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) } + } + } - //fn verify_summary<'a, P: Into>>(&self, remote_name: &str, summary: /*Ignored*/&glib::Bytes, signatures: /*Ignored*/&glib::Bytes, cancellable: P) -> Result { - // unsafe { TODO: call ffi::ostree_repo_verify_summary() } - //} + fn verify_summary<'a, P: Into>>(&self, remote_name: &str, summary: &glib::Bytes, signatures: &glib::Bytes, cancellable: P) -> Result { + let cancellable = cancellable.into(); + let cancellable = cancellable.to_glib_none(); + unsafe { + let mut error = ptr::null_mut(); + let ret = ffi::ostree_repo_verify_summary(self.to_glib_none().0, remote_name.to_glib_none().0, summary.to_glib_none().0, signatures.to_glib_none().0, cancellable.0, &mut error); + if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) } + } + } - //fn write_archive_to_mtree<'a, 'b, P: IsA, Q: Into>, R: Into>>(&self, archive: &P, mtree: /*Ignored*/&MutableTree, modifier: Q, autocreate_parents: bool, cancellable: R) -> Result<(), Error> { - // unsafe { TODO: call ffi::ostree_repo_write_archive_to_mtree() } - //} + fn write_archive_to_mtree<'a, 'b, P: IsA, Q: Into>, R: Into>>(&self, archive: &P, mtree: &MutableTree, modifier: Q, autocreate_parents: bool, cancellable: R) -> Result<(), Error> { + let modifier = modifier.into(); + let modifier = modifier.to_glib_none(); + let cancellable = cancellable.into(); + let cancellable = cancellable.to_glib_none(); + unsafe { + let mut error = ptr::null_mut(); + let _ = ffi::ostree_repo_write_archive_to_mtree(self.to_glib_none().0, archive.to_glib_none().0, mtree.to_glib_none().0, modifier.0, autocreate_parents.to_glib(), cancellable.0, &mut error); + if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } + } + } - //fn write_commit<'a, 'b, 'c, 'd, 'e, P: Into>, Q: Into>, R: Into>, S: Into>, T: Into>>(&self, parent: P, subject: Q, body: R, metadata: S, root: /*Ignored*/&RepoFile, cancellable: T) -> Result { - // unsafe { TODO: call ffi::ostree_repo_write_commit() } - //} + fn write_commit<'a, 'b, 'c, 'd, 'e, P: Into>, Q: Into>, R: Into>, S: Into>, T: Into>>(&self, parent: P, subject: Q, body: R, metadata: S, root: &RepoFile, cancellable: T) -> Result { + let parent = parent.into(); + let parent = parent.to_glib_none(); + let subject = subject.into(); + let subject = subject.to_glib_none(); + let body = body.into(); + let body = body.to_glib_none(); + let metadata = metadata.into(); + let metadata = metadata.to_glib_none(); + let cancellable = cancellable.into(); + let cancellable = cancellable.to_glib_none(); + unsafe { + let mut out_commit = ptr::null_mut(); + let mut error = ptr::null_mut(); + let _ = ffi::ostree_repo_write_commit(self.to_glib_none().0, parent.0, subject.0, body.0, metadata.0, root.to_glib_none().0, &mut out_commit, cancellable.0, &mut error); + if error.is_null() { Ok(from_glib_full(out_commit)) } else { Err(from_glib_full(error)) } + } + } fn write_commit_detached_metadata<'a, 'b, P: Into>, Q: Into>>(&self, checksum: &str, metadata: P, cancellable: Q) -> Result<(), Error> { let metadata = metadata.into(); @@ -1023,37 +1246,84 @@ impl + IsA> RepoExt for O { } } - //fn write_commit_with_time<'a, 'b, 'c, 'd, 'e, P: Into>, Q: Into>, R: Into>, S: Into>, T: Into>>(&self, parent: P, subject: Q, body: R, metadata: S, root: /*Ignored*/&RepoFile, time: u64, cancellable: T) -> Result { - // unsafe { TODO: call ffi::ostree_repo_write_commit_with_time() } - //} + fn write_commit_with_time<'a, 'b, 'c, 'd, 'e, P: Into>, Q: Into>, R: Into>, S: Into>, T: Into>>(&self, parent: P, subject: Q, body: R, metadata: S, root: &RepoFile, time: u64, cancellable: T) -> Result { + let parent = parent.into(); + let parent = parent.to_glib_none(); + let subject = subject.into(); + let subject = subject.to_glib_none(); + let body = body.into(); + let body = body.to_glib_none(); + let metadata = metadata.into(); + let metadata = metadata.to_glib_none(); + let cancellable = cancellable.into(); + let cancellable = cancellable.to_glib_none(); + unsafe { + let mut out_commit = ptr::null_mut(); + let mut error = ptr::null_mut(); + let _ = ffi::ostree_repo_write_commit_with_time(self.to_glib_none().0, parent.0, subject.0, body.0, metadata.0, root.to_glib_none().0, time, &mut out_commit, cancellable.0, &mut error); + if error.is_null() { Ok(from_glib_full(out_commit)) } else { Err(from_glib_full(error)) } + } + } - //fn write_config(&self, new_config: /*Ignored*/&glib::KeyFile) -> Result<(), Error> { - // unsafe { TODO: call ffi::ostree_repo_write_config() } - //} + fn write_config(&self, new_config: &glib::KeyFile) -> Result<(), Error> { + unsafe { + let mut error = ptr::null_mut(); + let _ = ffi::ostree_repo_write_config(self.to_glib_none().0, new_config.to_glib_none().0, &mut error); + if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } + } + } - //fn write_content<'a, 'b, P: Into>, Q: IsA, R: Into>>(&self, expected_checksum: P, object_input: &Q, length: u64, out_csum: /*Unknown conversion*//*Unimplemented*/FixedArray TypeId { ns_id: 0, id: 3 }; 32, cancellable: R) -> Result<(), Error> { + //fn write_content<'a, 'b, P: Into>, Q: IsA, R: Into>>(&self, expected_checksum: P, object_input: &Q, length: u64, out_csum: /*Unknown conversion*//*Unimplemented*/FixedArray TypeId { ns_id: 0, id: 3 }; 32, cancellable: R) -> Result<(), Error> { // unsafe { TODO: call ffi::ostree_repo_write_content() } //} - //fn write_content_trusted<'a, P: IsA, Q: Into>>(&self, checksum: &str, object_input: &P, length: u64, cancellable: Q) -> Result<(), Error> { - // unsafe { TODO: call ffi::ostree_repo_write_content_trusted() } - //} + fn write_content_trusted<'a, P: IsA, Q: Into>>(&self, checksum: &str, object_input: &P, length: u64, cancellable: Q) -> Result<(), Error> { + let cancellable = cancellable.into(); + let cancellable = cancellable.to_glib_none(); + unsafe { + let mut error = ptr::null_mut(); + let _ = ffi::ostree_repo_write_content_trusted(self.to_glib_none().0, checksum.to_glib_none().0, object_input.to_glib_none().0, length, cancellable.0, &mut error); + if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } + } + } - //fn write_dfd_to_mtree<'a, 'b, P: Into>, Q: Into>>(&self, dfd: i32, path: &str, mtree: /*Ignored*/&MutableTree, modifier: P, cancellable: Q) -> Result<(), Error> { - // unsafe { TODO: call ffi::ostree_repo_write_dfd_to_mtree() } - //} + fn write_dfd_to_mtree<'a, 'b, P: Into>, Q: Into>>(&self, dfd: i32, path: &str, mtree: &MutableTree, modifier: P, cancellable: Q) -> Result<(), Error> { + let modifier = modifier.into(); + let modifier = modifier.to_glib_none(); + let cancellable = cancellable.into(); + let cancellable = cancellable.to_glib_none(); + unsafe { + let mut error = ptr::null_mut(); + let _ = ffi::ostree_repo_write_dfd_to_mtree(self.to_glib_none().0, dfd, path.to_glib_none().0, mtree.to_glib_none().0, modifier.0, cancellable.0, &mut error); + if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } + } + } - //fn write_directory_to_mtree<'a, 'b, P: IsA, Q: Into>, R: Into>>(&self, dir: &P, mtree: /*Ignored*/&MutableTree, modifier: Q, cancellable: R) -> Result<(), Error> { - // unsafe { TODO: call ffi::ostree_repo_write_directory_to_mtree() } - //} + fn write_directory_to_mtree<'a, 'b, P: IsA, Q: Into>, R: Into>>(&self, dir: &P, mtree: &MutableTree, modifier: Q, cancellable: R) -> Result<(), Error> { + let modifier = modifier.into(); + let modifier = modifier.to_glib_none(); + let cancellable = cancellable.into(); + let cancellable = cancellable.to_glib_none(); + unsafe { + let mut error = ptr::null_mut(); + let _ = ffi::ostree_repo_write_directory_to_mtree(self.to_glib_none().0, dir.to_glib_none().0, mtree.to_glib_none().0, modifier.0, cancellable.0, &mut error); + if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } + } + } //fn write_metadata<'a, 'b, P: Into>, Q: Into>>(&self, objtype: ObjectType, expected_checksum: P, object: &glib::Variant, out_csum: /*Unknown conversion*//*Unimplemented*/FixedArray TypeId { ns_id: 0, id: 3 }; 32, cancellable: Q) -> Result<(), Error> { // unsafe { TODO: call ffi::ostree_repo_write_metadata() } //} - //fn write_metadata_stream_trusted<'a, P: IsA, Q: Into>>(&self, objtype: ObjectType, checksum: &str, object_input: &P, length: u64, cancellable: Q) -> Result<(), Error> { - // unsafe { TODO: call ffi::ostree_repo_write_metadata_stream_trusted() } - //} + fn write_metadata_stream_trusted<'a, P: IsA, Q: Into>>(&self, objtype: ObjectType, checksum: &str, object_input: &P, length: u64, cancellable: Q) -> Result<(), Error> { + let cancellable = cancellable.into(); + let cancellable = cancellable.to_glib_none(); + unsafe { + let mut error = ptr::null_mut(); + let _ = ffi::ostree_repo_write_metadata_stream_trusted(self.to_glib_none().0, objtype.to_glib(), checksum.to_glib_none().0, object_input.to_glib_none().0, length, cancellable.0, &mut error); + if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } + } + } fn write_metadata_trusted<'a, P: Into>>(&self, objtype: ObjectType, checksum: &str, variant: &glib::Variant, cancellable: P) -> Result<(), Error> { let cancellable = cancellable.into(); @@ -1065,9 +1335,16 @@ impl + IsA> RepoExt for O { } } - //fn write_mtree<'a, P: Into>>(&self, mtree: /*Ignored*/&MutableTree, cancellable: P) -> Result { - // unsafe { TODO: call ffi::ostree_repo_write_mtree() } - //} + fn write_mtree<'a, P: Into>>(&self, mtree: &MutableTree, cancellable: P) -> Result { + let cancellable = cancellable.into(); + let cancellable = cancellable.to_glib_none(); + unsafe { + let mut out_file = ptr::null_mut(); + let mut error = ptr::null_mut(); + let _ = ffi::ostree_repo_write_mtree(self.to_glib_none().0, mtree.to_glib_none().0, &mut out_file, cancellable.0, &mut error); + if error.is_null() { Ok(from_glib_full(out_file)) } else { Err(from_glib_full(error)) } + } + } fn get_property_remotes_config_dir(&self) -> Option { unsafe { @@ -1085,7 +1362,17 @@ impl + IsA> RepoExt for O { } } - //fn connect_gpg_verify_result(&self, f: F) -> SignalHandlerId { - // Ignored result: OSTree.GpgVerifyResult - //} + fn connect_gpg_verify_result(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "gpg-verify-result", + transmute(gpg_verify_result_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } +} + +unsafe extern "C" fn gpg_verify_result_trampoline

(this: *mut ffi::OstreeRepo, checksum: *mut libc::c_char, result: *mut ffi::OstreeGpgVerifyResult, f: glib_ffi::gpointer) +where P: IsA { + let f: &&(Fn(&P, &str, &GpgVerifyResult) + 'static) = transmute(f); + f(&Repo::from_glib_borrow(this).downcast_unchecked(), &String::from_glib_none(checksum), &from_glib_borrow(result)) } diff --git a/rust-bindings/rust/libostree/src/auto/repo_commit_modifier.rs b/rust-bindings/rust/libostree/src/auto/repo_commit_modifier.rs new file mode 100644 index 00000000..5e492fac --- /dev/null +++ b/rust-bindings/rust/libostree/src/auto/repo_commit_modifier.rs @@ -0,0 +1,49 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir @ c385982) +// from gir-files (https://github.com/gtk-rs/gir-files @ ???) +// DO NOT EDIT + +#[cfg(any(feature = "v2017_13", feature = "dox"))] +use RepoDevInoCache; +use SePolicy; +use ffi; +use glib::translate::*; +use glib_ffi; +use gobject_ffi; +use std::mem; +use std::ptr; + +glib_wrapper! { + #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] + pub struct RepoCommitModifier(Shared); + + match fn { + ref => |ptr| ffi::ostree_repo_commit_modifier_ref(ptr), + unref => |ptr| ffi::ostree_repo_commit_modifier_unref(ptr), + get_type => || ffi::ostree_repo_commit_modifier_get_type(), + } +} + +impl RepoCommitModifier { + //pub fn new<'a, P: Into>>(flags: /*Ignored*/RepoCommitModifierFlags, commit_filter: P, destroy_notify: /*Unknown conversion*//*Unimplemented*/DestroyNotify) -> RepoCommitModifier { + // unsafe { TODO: call ffi::ostree_repo_commit_modifier_new() } + //} + + #[cfg(any(feature = "v2017_13", feature = "dox"))] + pub fn set_devino_cache(&self, cache: &RepoDevInoCache) { + unsafe { + ffi::ostree_repo_commit_modifier_set_devino_cache(self.to_glib_none().0, cache.to_glib_none().0); + } + } + + pub fn set_sepolicy<'a, P: Into>>(&self, sepolicy: P) { + let sepolicy = sepolicy.into(); + let sepolicy = sepolicy.to_glib_none(); + unsafe { + ffi::ostree_repo_commit_modifier_set_sepolicy(self.to_glib_none().0, sepolicy.0); + } + } + + //pub fn set_xattr_callback(&self, callback: /*Unknown conversion*//*Unimplemented*/RepoCommitModifierXattrCallback, destroy: /*Unknown conversion*//*Unimplemented*/DestroyNotify) { + // unsafe { TODO: call ffi::ostree_repo_commit_modifier_set_xattr_callback() } + //} +} diff --git a/rust-bindings/rust/libostree/src/auto/repo_dev_ino_cache.rs b/rust-bindings/rust/libostree/src/auto/repo_dev_ino_cache.rs new file mode 100644 index 00000000..7ffd9f0c --- /dev/null +++ b/rust-bindings/rust/libostree/src/auto/repo_dev_ino_cache.rs @@ -0,0 +1,35 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir @ c385982) +// from gir-files (https://github.com/gtk-rs/gir-files @ ???) +// DO NOT EDIT + +use ffi; +use glib::translate::*; +use glib_ffi; +use gobject_ffi; +use std::mem; +use std::ptr; + +glib_wrapper! { + #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] + pub struct RepoDevInoCache(Shared); + + match fn { + ref => |ptr| ffi::ostree_repo_devino_cache_ref(ptr), + unref => |ptr| ffi::ostree_repo_devino_cache_unref(ptr), + get_type => || ffi::ostree_repo_devino_cache_get_type(), + } +} + +impl RepoDevInoCache { + pub fn new() -> RepoDevInoCache { + unsafe { + from_glib_full(ffi::ostree_repo_devino_cache_new()) + } + } +} + +impl Default for RepoDevInoCache { + fn default() -> Self { + Self::new() + } +} diff --git a/rust-bindings/rust/libostree/src/auto/repo_file.rs b/rust-bindings/rust/libostree/src/auto/repo_file.rs new file mode 100644 index 00000000..17b06596 --- /dev/null +++ b/rust-bindings/rust/libostree/src/auto/repo_file.rs @@ -0,0 +1,104 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir @ c385982) +// from gir-files (https://github.com/gtk-rs/gir-files @ ???) +// DO NOT EDIT + +use Error; +use Repo; +use ffi; +use gio; +use gio_ffi; +use glib; +use glib::object::IsA; +use glib::translate::*; +use glib_ffi; +use gobject_ffi; +use std::mem; +use std::ptr; + +glib_wrapper! { + pub struct RepoFile(Object): [ + gio::File => gio_ffi::GFile, + ]; + + match fn { + get_type => || ffi::ostree_repo_file_get_type(), + } +} + +pub trait RepoFileExt { + fn ensure_resolved(&self) -> Result<(), Error>; + + fn get_checksum(&self) -> Option; + + fn get_repo(&self) -> Option; + + fn get_root(&self) -> Option; + + fn tree_get_contents(&self) -> Option; + + fn tree_get_contents_checksum(&self) -> Option; + + fn tree_get_metadata(&self) -> Option; + + fn tree_get_metadata_checksum(&self) -> Option; + + fn tree_set_metadata(&self, checksum: &str, metadata: &glib::Variant); +} + +impl> RepoFileExt for O { + fn ensure_resolved(&self) -> Result<(), Error> { + unsafe { + let mut error = ptr::null_mut(); + let _ = ffi::ostree_repo_file_ensure_resolved(self.to_glib_none().0, &mut error); + if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } + } + } + + fn get_checksum(&self) -> Option { + unsafe { + from_glib_none(ffi::ostree_repo_file_get_checksum(self.to_glib_none().0)) + } + } + + fn get_repo(&self) -> Option { + unsafe { + from_glib_none(ffi::ostree_repo_file_get_repo(self.to_glib_none().0)) + } + } + + fn get_root(&self) -> Option { + unsafe { + from_glib_none(ffi::ostree_repo_file_get_root(self.to_glib_none().0)) + } + } + + fn tree_get_contents(&self) -> Option { + unsafe { + from_glib_full(ffi::ostree_repo_file_tree_get_contents(self.to_glib_none().0)) + } + } + + fn tree_get_contents_checksum(&self) -> Option { + unsafe { + from_glib_none(ffi::ostree_repo_file_tree_get_contents_checksum(self.to_glib_none().0)) + } + } + + fn tree_get_metadata(&self) -> Option { + unsafe { + from_glib_full(ffi::ostree_repo_file_tree_get_metadata(self.to_glib_none().0)) + } + } + + fn tree_get_metadata_checksum(&self) -> Option { + unsafe { + from_glib_none(ffi::ostree_repo_file_tree_get_metadata_checksum(self.to_glib_none().0)) + } + } + + fn tree_set_metadata(&self, checksum: &str, metadata: &glib::Variant) { + unsafe { + ffi::ostree_repo_file_tree_set_metadata(self.to_glib_none().0, checksum.to_glib_none().0, metadata.to_glib_none().0); + } + } +} diff --git a/rust-bindings/rust/libostree/src/auto/repo_transaction_stats.rs b/rust-bindings/rust/libostree/src/auto/repo_transaction_stats.rs new file mode 100644 index 00000000..ecab909d --- /dev/null +++ b/rust-bindings/rust/libostree/src/auto/repo_transaction_stats.rs @@ -0,0 +1,21 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir @ c385982) +// from gir-files (https://github.com/gtk-rs/gir-files @ ???) +// DO NOT EDIT + +use ffi; +use glib::translate::*; +use glib_ffi; +use gobject_ffi; +use std::mem; +use std::ptr; + +glib_wrapper! { + #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] + pub struct RepoTransactionStats(Boxed); + + match fn { + copy => |ptr| gobject_ffi::g_boxed_copy(ffi::ostree_repo_transaction_stats_get_type(), ptr as *mut _) as *mut ffi::OstreeRepoTransactionStats, + free => |ptr| gobject_ffi::g_boxed_free(ffi::ostree_repo_transaction_stats_get_type(), ptr as *mut _), + get_type => || ffi::ostree_repo_transaction_stats_get_type(), + } +} diff --git a/rust-bindings/rust/libostree/src/auto/se_policy.rs b/rust-bindings/rust/libostree/src/auto/se_policy.rs new file mode 100644 index 00000000..fe17535f --- /dev/null +++ b/rust-bindings/rust/libostree/src/auto/se_policy.rs @@ -0,0 +1,127 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir @ c385982) +// from gir-files (https://github.com/gtk-rs/gir-files @ ???) +// DO NOT EDIT + +use Error; +use SePolicyRestoreconFlags; +use ffi; +use gio; +use glib; +use glib::StaticType; +use glib::Value; +use glib::object::IsA; +use glib::translate::*; +use glib_ffi; +use gobject_ffi; +use std::mem; +use std::ptr; + +glib_wrapper! { + pub struct SePolicy(Object); + + match fn { + get_type => || ffi::ostree_sepolicy_get_type(), + } +} + +impl SePolicy { + pub fn new<'a, P: IsA, Q: Into>>(path: &P, cancellable: Q) -> Result { + let cancellable = cancellable.into(); + let cancellable = cancellable.to_glib_none(); + unsafe { + let mut error = ptr::null_mut(); + let ret = ffi::ostree_sepolicy_new(path.to_glib_none().0, cancellable.0, &mut error); + if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) } + } + } + + pub fn new_at<'a, P: Into>>(rootfs_dfd: i32, cancellable: P) -> Result { + let cancellable = cancellable.into(); + let cancellable = cancellable.to_glib_none(); + unsafe { + let mut error = ptr::null_mut(); + let ret = ffi::ostree_sepolicy_new_at(rootfs_dfd, cancellable.0, &mut error); + if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) } + } + } + + //pub fn fscreatecon_cleanup>>(unused: P) { + // unsafe { TODO: call ffi::ostree_sepolicy_fscreatecon_cleanup() } + //} +} + +pub trait SePolicyExt { + fn get_csum(&self) -> Option; + + fn get_label<'a, P: Into>>(&self, relpath: &str, unix_mode: u32, cancellable: P) -> Result; + + fn get_name(&self) -> Option; + + fn get_path(&self) -> Option; + + fn restorecon<'a, 'b, P: Into>, Q: IsA, R: Into>>(&self, path: &str, info: P, target: &Q, flags: SePolicyRestoreconFlags, cancellable: R) -> Result; + + fn setfscreatecon(&self, path: &str, mode: u32) -> Result<(), Error>; + + fn get_property_rootfs_dfd(&self) -> i32; +} + +impl + IsA> SePolicyExt for O { + fn get_csum(&self) -> Option { + unsafe { + from_glib_none(ffi::ostree_sepolicy_get_csum(self.to_glib_none().0)) + } + } + + fn get_label<'a, P: Into>>(&self, relpath: &str, unix_mode: u32, cancellable: P) -> Result { + let cancellable = cancellable.into(); + let cancellable = cancellable.to_glib_none(); + unsafe { + let mut out_label = ptr::null_mut(); + let mut error = ptr::null_mut(); + let _ = ffi::ostree_sepolicy_get_label(self.to_glib_none().0, relpath.to_glib_none().0, unix_mode, &mut out_label, cancellable.0, &mut error); + if error.is_null() { Ok(from_glib_full(out_label)) } else { Err(from_glib_full(error)) } + } + } + + fn get_name(&self) -> Option { + unsafe { + from_glib_none(ffi::ostree_sepolicy_get_name(self.to_glib_none().0)) + } + } + + fn get_path(&self) -> Option { + unsafe { + from_glib_none(ffi::ostree_sepolicy_get_path(self.to_glib_none().0)) + } + } + + fn restorecon<'a, 'b, P: Into>, Q: IsA, R: Into>>(&self, path: &str, info: P, target: &Q, flags: SePolicyRestoreconFlags, cancellable: R) -> Result { + let info = info.into(); + let info = info.to_glib_none(); + let cancellable = cancellable.into(); + let cancellable = cancellable.to_glib_none(); + unsafe { + let mut out_new_label = ptr::null_mut(); + let mut error = ptr::null_mut(); + let _ = ffi::ostree_sepolicy_restorecon(self.to_glib_none().0, path.to_glib_none().0, info.0, target.to_glib_none().0, flags.to_glib(), &mut out_new_label, cancellable.0, &mut error); + if error.is_null() { Ok(from_glib_full(out_new_label)) } else { Err(from_glib_full(error)) } + } + } + + fn setfscreatecon(&self, path: &str, mode: u32) -> Result<(), Error> { + unsafe { + let mut error = ptr::null_mut(); + let _ = ffi::ostree_sepolicy_setfscreatecon(self.to_glib_none().0, path.to_glib_none().0, mode, &mut error); + if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } + } + } + + fn get_property_rootfs_dfd(&self) -> i32 { + unsafe { + let mut value = Value::from_type(::static_type()); + gobject_ffi::g_object_get_property(self.to_glib_none().0, "rootfs-dfd".to_glib_none().0, value.to_glib_none_mut().0); + value.get().unwrap() + } + } +} diff --git a/rust-bindings/rust/libostree/src/auto/versions.txt b/rust-bindings/rust/libostree/src/auto/versions.txt deleted file mode 100644 index 253bea93..00000000 --- a/rust-bindings/rust/libostree/src/auto/versions.txt +++ /dev/null @@ -1,2 +0,0 @@ -Generated by gir (https://github.com/gtk-rs/gir @ c385982) -from gir-files (https://github.com/gtk-rs/gir-files @ ???) diff --git a/rust-bindings/rust/libostree/src/lib.rs b/rust-bindings/rust/libostree/src/lib.rs index f473ca80..9294d947 100644 --- a/rust-bindings/rust/libostree/src/lib.rs +++ b/rust-bindings/rust/libostree/src/lib.rs @@ -1,11 +1,13 @@ extern crate libostree_sys as ffi; - extern crate glib_sys as glib_ffi; extern crate gobject_sys as gobject_ffi; - +extern crate gio_sys as gio_ffi; #[macro_use] extern crate glib; extern crate gio; +extern crate libc; +#[macro_use] +extern crate bitflags; use glib::Error; diff --git a/rust-bindings/rust/sample/Cargo.lock b/rust-bindings/rust/sample/Cargo.lock index a4ddfa2c..c43f4cf6 100644 --- a/rust-bindings/rust/sample/Cargo.lock +++ b/rust-bindings/rust/sample/Cargo.lock @@ -82,10 +82,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" name = "libostree" version = "0.2.0" dependencies = [ + "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", "gio 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "gio-sys 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "glib 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "glib-sys 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "gobject-sys 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", "libostree-sys 0.2.0", ]