Compare commits

...

9 Commits

Author SHA1 Message Date
Colin Walters
718d93ab63
Merge 68542b880c into 8aaea0c65d 2024-12-20 14:43:30 -05:00
Colin Walters
8aaea0c65d
Merge pull request #3361 from cgwalters/release
Release 2024.10
2024-12-19 17:10:40 -05:00
Colin Walters
45ddf3b798
Merge pull request #3351 from cgwalters/fix-transient-root-doc
man: Note semantics combining `root.transient` with `composefs.enabled`
2024-12-19 16:23:48 -05:00
Colin Walters
aca6f17ff8 Post-release version bump
Signed-off-by: Colin Walters <walters@verbum.org>
2024-12-19 15:11:42 -05:00
Colin Walters
66f5a77ae6 Release 2024.10
Signed-off-by: Colin Walters <walters@verbum.org>
2024-12-19 15:10:12 -05:00
Colin Walters
786b38c2cf man: Note semantics combining root.transient with composefs.enabled
It's all quite confusing having to reason about both the pre-composefs
ostree and the composefs version. But hopefully soon we more firmly
leave behind that first legacy.

Signed-off-by: Colin Walters <walters@verbum.org>
2024-12-17 16:04:38 -05:00
Colin Walters
68542b880c rust: Update to glib 0.19
This updates us to the latest glib; only lightly tested.

The rationale here is just keeping up with the train.

Signed-off-by: Colin Walters <walters@verbum.org>
2024-06-04 20:04:32 -04:00
Colin Walters
cae315c499 rust-bindings: Update to latest git
This includes a change to the ostree_sepolicy_get_name()
API so we'll need a semver bump.
2024-06-04 19:45:01 -04:00
Colin Walters
f84b8ab6ff rust-bindings: Ensure gir-files are fixed to glib major
We need to use the version corresponding to the glib
version we have.
2024-06-04 19:43:51 -04:00
43 changed files with 1934 additions and 2317 deletions

View File

@ -36,9 +36,9 @@ members = [".", "rust-bindings/sys"]
[dependencies]
base64 = "0.20.0"
bitflags = "1.2.1"
ffi = { package = "ostree-sys", path = "rust-bindings/sys", version = "0.14.0" }
gio = "0.18"
glib = "0.18"
ffi = { package = "ostree-sys", path = "rust-bindings/sys", version = "0.15.0" }
gio = "0.19"
glib = "0.19"
hex = "0.4.2"
libc = "0.2"
once_cell = "1.4.0"

View File

@ -1,7 +1,7 @@
AC_PREREQ([2.63])
dnl To perform a release, follow the instructions in `docs/CONTRIBUTING.md`.
m4_define([year_version], [2024])
m4_define([release_version], [10])
m4_define([release_version], [11])
m4_define([package_version], [year_version.release_version])
AC_INIT([libostree], [package_version], [walters@verbum.org])
is_release_build=no

View File

@ -120,20 +120,25 @@ License along with this library. If not, see <https://www.gnu.org/licenses/>.
<varlistentry>
<term><varname>root.transient</varname></term>
<listitem><para>A boolean value; the default is <literal>false</literal>.
If this is set to <literal>true</literal>, then the <literal>/</literal> filesystem will be a writable <literal>overlayfs</literal>,
with the upper directory being a hidden directory (in the underlying system root filesystem) that will persist across reboots by default.
However, changes will <emphasis>be discarded</emphasis> on OS updates!
Setting this flag to <literal>true</literal> requires composefs (See <literal>composefs.enabled</literal>).
When enabled, the root mount point <literal>/</literal> will be an overlayfs whose contents will be stored
in a tmpfs, and hence discarded on OS upgrade or reboot.
</para>
<para>
Enabling this option can be very useful for cases such as packages (dpkg/rpm/etc) that write content into <literal>/opt</literal>,
particularly where they expect the target to be writable at runtime. To make that work, ensure that your <literal>/opt</literal>
directory is *not* a symlink to <literal>/var/opt</literal>, but is just an empty directory.
</para>
<para>
Note the <literal>/usr</literal> mount point remains read-only by default. This option is independent of <literal>etc.transient</literal> and <literal>sysroot.readonly</literal>;
This option is independent of <literal>etc.transient</literal> and <literal>sysroot.readonly</literal>;
it is supported for example to have <literal>root.transient=true</literal> but <literal>etc.transient=false</literal> in which case changes to <literal>/etc</literal> continue
to persist across updates, with the default OSTree 3-way merge applied.
</para></listitem>
Also related to persistence it is important to emphasize that <literal>/sysroot</literal> (the physical root filesystem) is still persistent
by default; in-place OS upgrades can be applied.
</para>
<para>
Enabling this option can make it significantly easier to adopt an image-based model in some circumstances.
For example, if you have a configuration management system that is inspecting machine-specific state and
e.g. dynamically installing packages or applying configuration, it can more easily be adapted to
run on each boot, while still shifting a portion (or ideally most) image configuration to build time
as part of the base image/commit.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><varname>composefs.enabled</varname></term>

View File

@ -1,5 +1,5 @@
GIR_REPO := https://github.com/gtk-rs/gir.git
GIR_VERSION := 0eeebbdf9d4d5a0b0148c7fa055bf961e16e54a0
d .GIR_REPO := https://github.com/gtk-rs/gir.git
GIR_VERSION := 0.19
OSTREE_REPO := ../ostree
OSTREE_VERSION := patch-v2022.2
RUSTDOC_STRIPPER_VERSION := 0.1.17
@ -11,7 +11,7 @@ all: gir
# -- gir generation --
target/tools/bin/gir:
cargo install --root target/tools --git $(GIR_REPO) --rev $(GIR_VERSION) -- gir
cargo install --root target/tools --git $(GIR_REPO) --branch $(GIR_VERSION) -- gir
gir: target/tools/bin/gir
target/tools/bin/gir -c conf/ostree-sys.toml
@ -35,6 +35,7 @@ update-gir-files: \
remove-gir-files \
gir-files \
gir-files/GLib-2.0.gir \
gir-files/GModule-2.0.gir \
gir-files/Gio-2.0.gir \
gir-files/GObject-2.0.gir \
gir-files/OSTree-1.0.gir
@ -46,7 +47,7 @@ gir-files:
mkdir -p gir-files
%.gir:
curl -o $@ -L https://github.com/gtk-rs/gir-files/raw/master/${@F}
curl -o $@ -L https://github.com/gtk-rs/gir-files/raw/0.19/${@F}
gir-files/OSTree-1.0.gir:
ln -sfr ../OSTree-1.0.gir $@

View File

@ -2,13 +2,8 @@
// from gir-files
// DO NOT EDIT
use glib::object::ObjectType as ObjectType_;
use glib::signal::connect_raw;
use glib::signal::SignalHandlerId;
use glib::translate::*;
use std::boxed::Box as Box_;
use std::fmt;
use std::mem::transmute;
use glib::{prelude::*,signal::{connect_raw, SignalHandlerId},translate::*};
use std::{boxed::Box as Box_};
glib::wrapper! {
#[doc(alias = "OstreeAsyncProgress")]
@ -32,8 +27,8 @@ impl AsyncProgress {
// unsafe { TODO: call ffi:ostree_async_progress_new_and_connect() }
//}
#[cfg(any(feature = "v2019_6", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2019_6")))]
#[cfg(feature = "v2019_6")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2019_6")))]
#[doc(alias = "ostree_async_progress_copy_state")]
pub fn copy_state(&self, dest: &AsyncProgress) {
unsafe {
@ -48,15 +43,15 @@ impl AsyncProgress {
}
}
//#[cfg(any(feature = "v2017_6", feature = "dox"))]
//#[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_6")))]
//#[cfg(feature = "v2017_6")]
//#[cfg_attr(docsrs, doc(cfg(feature = "v2017_6")))]
//#[doc(alias = "ostree_async_progress_get")]
//pub fn get(&self, : /*Unknown conversion*//*Unimplemented*/Basic: VarArgs) {
// unsafe { TODO: call ffi:ostree_async_progress_get() }
//}
#[cfg(any(feature = "v2017_6", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_6")))]
#[cfg(feature = "v2017_6")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2017_6")))]
#[doc(alias = "ostree_async_progress_get_status")]
#[doc(alias = "get_status")]
pub fn status(&self) -> Option<glib::GString> {
@ -81,8 +76,8 @@ impl AsyncProgress {
}
}
#[cfg(any(feature = "v2017_6", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_6")))]
#[cfg(feature = "v2017_6")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2017_6")))]
#[doc(alias = "ostree_async_progress_get_variant")]
#[doc(alias = "get_variant")]
pub fn variant(&self, key: &str) -> Option<glib::Variant> {
@ -91,15 +86,15 @@ impl AsyncProgress {
}
}
//#[cfg(any(feature = "v2017_6", feature = "dox"))]
//#[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_6")))]
//#[cfg(feature = "v2017_6")]
//#[cfg_attr(docsrs, doc(cfg(feature = "v2017_6")))]
//#[doc(alias = "ostree_async_progress_set")]
//pub fn set(&self, : /*Unknown conversion*//*Unimplemented*/Basic: VarArgs) {
// unsafe { TODO: call ffi:ostree_async_progress_set() }
//}
#[cfg(any(feature = "v2017_6", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_6")))]
#[cfg(feature = "v2017_6")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2017_6")))]
#[doc(alias = "ostree_async_progress_set_status")]
pub fn set_status(&self, status: Option<&str>) {
unsafe {
@ -121,8 +116,8 @@ impl AsyncProgress {
}
}
#[cfg(any(feature = "v2017_6", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_6")))]
#[cfg(feature = "v2017_6")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2017_6")))]
#[doc(alias = "ostree_async_progress_set_variant")]
pub fn set_variant(&self, key: &str, value: &glib::Variant) {
unsafe {
@ -139,7 +134,7 @@ impl AsyncProgress {
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"changed\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(changed_trampoline::<F> as *const ())), Box_::into_raw(f))
Some(std::mem::transmute::<_, unsafe extern "C" fn()>(changed_trampoline::<F> as *const ())), Box_::into_raw(f))
}
}
}
@ -149,9 +144,3 @@ impl Default for AsyncProgress {
Self::new()
}
}
impl fmt::Display for AsyncProgress {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.write_str("AsyncProgress")
}
}

View File

@ -2,10 +2,7 @@
// from gir-files
// DO NOT EDIT
use glib::object::IsA;
use glib::translate::*;
use std::fmt;
use std::ptr;
use glib::{prelude::*,translate::*};
glib::wrapper! {
#[doc(alias = "OstreeBootconfigParser")]
@ -39,8 +36,8 @@ impl BootconfigParser {
}
}
#[cfg(any(feature = "v2020_7", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_7")))]
#[cfg(feature = "v2020_7")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2020_7")))]
#[doc(alias = "ostree_bootconfig_parser_get_overlay_initrds")]
#[doc(alias = "get_overlay_initrds")]
pub fn overlay_initrds(&self) -> Vec<glib::GString> {
@ -52,9 +49,9 @@ impl BootconfigParser {
#[doc(alias = "ostree_bootconfig_parser_parse")]
pub fn parse(&self, path: &impl IsA<gio::File>, cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let mut error = std::ptr::null_mut();
let is_ok = ffi::ostree_bootconfig_parser_parse(self.to_glib_none().0, path.as_ref().to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
}
}
@ -62,9 +59,9 @@ impl BootconfigParser {
#[doc(alias = "ostree_bootconfig_parser_parse_at")]
pub fn parse_at(&self, dfd: i32, path: &str, cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let mut error = std::ptr::null_mut();
let is_ok = ffi::ostree_bootconfig_parser_parse_at(self.to_glib_none().0, dfd, path.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
}
}
@ -76,8 +73,8 @@ impl BootconfigParser {
}
}
#[cfg(any(feature = "v2020_7", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_7")))]
#[cfg(feature = "v2020_7")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2020_7")))]
#[doc(alias = "ostree_bootconfig_parser_set_overlay_initrds")]
pub fn set_overlay_initrds(&self, initrds: &[&str]) {
unsafe {
@ -88,9 +85,9 @@ impl BootconfigParser {
#[doc(alias = "ostree_bootconfig_parser_write")]
pub fn write(&self, output: &impl IsA<gio::File>, cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let mut error = std::ptr::null_mut();
let is_ok = ffi::ostree_bootconfig_parser_write(self.to_glib_none().0, output.as_ref().to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
}
}
@ -98,9 +95,9 @@ impl BootconfigParser {
#[doc(alias = "ostree_bootconfig_parser_write_at")]
pub fn write_at(&self, dfd: i32, path: &str, cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let mut error = std::ptr::null_mut();
let is_ok = ffi::ostree_bootconfig_parser_write_at(self.to_glib_none().0, dfd, path.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
}
}
@ -111,9 +108,3 @@ impl Default for BootconfigParser {
Self::new()
}
}
impl fmt::Display for BootconfigParser {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.write_str("BootconfigParser")
}
}

View File

@ -2,8 +2,7 @@
// from gir-files
// DO NOT EDIT
use glib::translate::*;
use std::hash;
use glib::{translate::*};
glib::wrapper! {
#[derive(Debug, PartialOrd, Ord)]
@ -48,9 +47,9 @@ impl PartialEq for CollectionRef {
impl Eq for CollectionRef {}
impl hash::Hash for CollectionRef {
impl std::hash::Hash for CollectionRef {
#[inline]
fn hash<H>(&self, state: &mut H) where H: hash::Hasher {
hash::Hash::hash(&self.hash(), state)
fn hash<H>(&self, state: &mut H) where H: std::hash::Hasher {
std::hash::Hash::hash(&self.hash(), state)
}
}

View File

@ -2,8 +2,8 @@
// from gir-files
// DO NOT EDIT
use crate::ObjectType;
use glib::translate::*;
use crate::{ObjectType};
use glib::{translate::*};
glib::wrapper! {
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]

View File

@ -2,75 +2,75 @@
// from gir-files
// DO NOT EDIT
use std::ffi::CStr;
use glib::{GStr};
#[doc(alias = "OSTREE_COMMIT_GVARIANT_STRING")]
pub static COMMIT_GVARIANT_STRING: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ffi::OSTREE_COMMIT_GVARIANT_STRING).to_str().unwrap()});
#[cfg(any(feature = "v2020_4", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_4")))]
pub static COMMIT_GVARIANT_STRING: &GStr = unsafe{GStr::from_utf8_with_nul_unchecked(ffi::OSTREE_COMMIT_GVARIANT_STRING)};
#[cfg(feature = "v2020_4")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2020_4")))]
#[doc(alias = "OSTREE_COMMIT_META_KEY_ARCHITECTURE")]
pub static COMMIT_META_KEY_ARCHITECTURE: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ffi::OSTREE_COMMIT_META_KEY_ARCHITECTURE).to_str().unwrap()});
#[cfg(any(feature = "v2018_6", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))]
pub static COMMIT_META_KEY_ARCHITECTURE: &GStr = unsafe{GStr::from_utf8_with_nul_unchecked(ffi::OSTREE_COMMIT_META_KEY_ARCHITECTURE)};
#[cfg(feature = "v2018_6")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))]
#[doc(alias = "OSTREE_COMMIT_META_KEY_COLLECTION_BINDING")]
pub static COMMIT_META_KEY_COLLECTION_BINDING: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ffi::OSTREE_COMMIT_META_KEY_COLLECTION_BINDING).to_str().unwrap()});
#[cfg(any(feature = "v2017_7", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_7")))]
pub static COMMIT_META_KEY_COLLECTION_BINDING: &GStr = unsafe{GStr::from_utf8_with_nul_unchecked(ffi::OSTREE_COMMIT_META_KEY_COLLECTION_BINDING)};
#[cfg(feature = "v2017_7")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2017_7")))]
#[doc(alias = "OSTREE_COMMIT_META_KEY_ENDOFLIFE")]
pub static COMMIT_META_KEY_ENDOFLIFE: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ffi::OSTREE_COMMIT_META_KEY_ENDOFLIFE).to_str().unwrap()});
#[cfg(any(feature = "v2017_7", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_7")))]
pub static COMMIT_META_KEY_ENDOFLIFE: &GStr = unsafe{GStr::from_utf8_with_nul_unchecked(ffi::OSTREE_COMMIT_META_KEY_ENDOFLIFE)};
#[cfg(feature = "v2017_7")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2017_7")))]
#[doc(alias = "OSTREE_COMMIT_META_KEY_ENDOFLIFE_REBASE")]
pub static COMMIT_META_KEY_ENDOFLIFE_REBASE: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ffi::OSTREE_COMMIT_META_KEY_ENDOFLIFE_REBASE).to_str().unwrap()});
#[cfg(any(feature = "v2017_9", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_9")))]
pub static COMMIT_META_KEY_ENDOFLIFE_REBASE: &GStr = unsafe{GStr::from_utf8_with_nul_unchecked(ffi::OSTREE_COMMIT_META_KEY_ENDOFLIFE_REBASE)};
#[cfg(feature = "v2017_9")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2017_9")))]
#[doc(alias = "OSTREE_COMMIT_META_KEY_REF_BINDING")]
pub static COMMIT_META_KEY_REF_BINDING: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ffi::OSTREE_COMMIT_META_KEY_REF_BINDING).to_str().unwrap()});
#[cfg(any(feature = "v2017_13", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_13")))]
pub static COMMIT_META_KEY_REF_BINDING: &GStr = unsafe{GStr::from_utf8_with_nul_unchecked(ffi::OSTREE_COMMIT_META_KEY_REF_BINDING)};
#[cfg(feature = "v2017_13")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2017_13")))]
#[doc(alias = "OSTREE_COMMIT_META_KEY_SOURCE_TITLE")]
pub static COMMIT_META_KEY_SOURCE_TITLE: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ffi::OSTREE_COMMIT_META_KEY_SOURCE_TITLE).to_str().unwrap()});
#[cfg(any(feature = "v2014_9", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2014_9")))]
pub static COMMIT_META_KEY_SOURCE_TITLE: &GStr = unsafe{GStr::from_utf8_with_nul_unchecked(ffi::OSTREE_COMMIT_META_KEY_SOURCE_TITLE)};
#[cfg(feature = "v2014_9")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2014_9")))]
#[doc(alias = "OSTREE_COMMIT_META_KEY_VERSION")]
pub static COMMIT_META_KEY_VERSION: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ffi::OSTREE_COMMIT_META_KEY_VERSION).to_str().unwrap()});
pub static COMMIT_META_KEY_VERSION: &GStr = unsafe{GStr::from_utf8_with_nul_unchecked(ffi::OSTREE_COMMIT_META_KEY_VERSION)};
#[doc(alias = "OSTREE_DIRMETA_GVARIANT_STRING")]
pub static DIRMETA_GVARIANT_STRING: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ffi::OSTREE_DIRMETA_GVARIANT_STRING).to_str().unwrap()});
pub static DIRMETA_GVARIANT_STRING: &GStr = unsafe{GStr::from_utf8_with_nul_unchecked(ffi::OSTREE_DIRMETA_GVARIANT_STRING)};
#[doc(alias = "OSTREE_FILEMETA_GVARIANT_STRING")]
pub static FILEMETA_GVARIANT_STRING: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ffi::OSTREE_FILEMETA_GVARIANT_STRING).to_str().unwrap()});
pub static FILEMETA_GVARIANT_STRING: &GStr = unsafe{GStr::from_utf8_with_nul_unchecked(ffi::OSTREE_FILEMETA_GVARIANT_STRING)};
#[doc(alias = "OSTREE_GPG_KEY_GVARIANT_STRING")]
pub static GPG_KEY_GVARIANT_STRING: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ffi::OSTREE_GPG_KEY_GVARIANT_STRING).to_str().unwrap()});
#[cfg(any(feature = "v2021_1", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2021_1")))]
pub static GPG_KEY_GVARIANT_STRING: &GStr = unsafe{GStr::from_utf8_with_nul_unchecked(ffi::OSTREE_GPG_KEY_GVARIANT_STRING)};
#[cfg(feature = "v2021_1")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2021_1")))]
#[doc(alias = "OSTREE_METADATA_KEY_BOOTABLE")]
pub static METADATA_KEY_BOOTABLE: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ffi::OSTREE_METADATA_KEY_BOOTABLE).to_str().unwrap()});
#[cfg(any(feature = "v2021_1", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2021_1")))]
pub static METADATA_KEY_BOOTABLE: &GStr = unsafe{GStr::from_utf8_with_nul_unchecked(ffi::OSTREE_METADATA_KEY_BOOTABLE)};
#[cfg(feature = "v2021_1")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2021_1")))]
#[doc(alias = "OSTREE_METADATA_KEY_LINUX")]
pub static METADATA_KEY_LINUX: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ffi::OSTREE_METADATA_KEY_LINUX).to_str().unwrap()});
#[cfg(any(feature = "v2018_9", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_9")))]
pub static METADATA_KEY_LINUX: &GStr = unsafe{GStr::from_utf8_with_nul_unchecked(ffi::OSTREE_METADATA_KEY_LINUX)};
#[cfg(feature = "v2018_9")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2018_9")))]
#[doc(alias = "OSTREE_META_KEY_DEPLOY_COLLECTION_ID")]
pub static META_KEY_DEPLOY_COLLECTION_ID: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ffi::OSTREE_META_KEY_DEPLOY_COLLECTION_ID).to_str().unwrap()});
#[cfg(any(feature = "v2018_3", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_3")))]
pub static META_KEY_DEPLOY_COLLECTION_ID: &GStr = unsafe{GStr::from_utf8_with_nul_unchecked(ffi::OSTREE_META_KEY_DEPLOY_COLLECTION_ID)};
#[cfg(feature = "v2018_3")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2018_3")))]
#[doc(alias = "OSTREE_ORIGIN_TRANSIENT_GROUP")]
pub static ORIGIN_TRANSIENT_GROUP: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ffi::OSTREE_ORIGIN_TRANSIENT_GROUP).to_str().unwrap()});
#[cfg(any(feature = "v2022_2", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2022_2")))]
pub static ORIGIN_TRANSIENT_GROUP: &GStr = unsafe{GStr::from_utf8_with_nul_unchecked(ffi::OSTREE_ORIGIN_TRANSIENT_GROUP)};
#[cfg(feature = "v2022_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2022_2")))]
#[doc(alias = "OSTREE_PATH_BOOTED")]
pub static PATH_BOOTED: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ffi::OSTREE_PATH_BOOTED).to_str().unwrap()});
#[cfg(any(feature = "v2018_6", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))]
pub static PATH_BOOTED: &GStr = unsafe{GStr::from_utf8_with_nul_unchecked(ffi::OSTREE_PATH_BOOTED)};
#[cfg(feature = "v2018_6")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))]
#[doc(alias = "OSTREE_REPO_METADATA_REF")]
pub static REPO_METADATA_REF: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ffi::OSTREE_REPO_METADATA_REF).to_str().unwrap()});
#[cfg(any(feature = "v2020_4", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_4")))]
pub static REPO_METADATA_REF: &GStr = unsafe{GStr::from_utf8_with_nul_unchecked(ffi::OSTREE_REPO_METADATA_REF)};
#[cfg(feature = "v2020_4")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2020_4")))]
#[doc(alias = "OSTREE_SIGN_NAME_ED25519")]
pub static SIGN_NAME_ED25519: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ffi::OSTREE_SIGN_NAME_ED25519).to_str().unwrap()});
pub static SIGN_NAME_ED25519: &GStr = unsafe{GStr::from_utf8_with_nul_unchecked(ffi::OSTREE_SIGN_NAME_ED25519)};
#[doc(alias = "OSTREE_SUMMARY_GVARIANT_STRING")]
pub static SUMMARY_GVARIANT_STRING: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ffi::OSTREE_SUMMARY_GVARIANT_STRING).to_str().unwrap()});
pub static SUMMARY_GVARIANT_STRING: &GStr = unsafe{GStr::from_utf8_with_nul_unchecked(ffi::OSTREE_SUMMARY_GVARIANT_STRING)};
#[doc(alias = "OSTREE_SUMMARY_SIG_GVARIANT_STRING")]
pub static SUMMARY_SIG_GVARIANT_STRING: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ffi::OSTREE_SUMMARY_SIG_GVARIANT_STRING).to_str().unwrap()});
pub static SUMMARY_SIG_GVARIANT_STRING: &GStr = unsafe{GStr::from_utf8_with_nul_unchecked(ffi::OSTREE_SUMMARY_SIG_GVARIANT_STRING)};
#[doc(alias = "OSTREE_TREE_GVARIANT_STRING")]
pub static TREE_GVARIANT_STRING: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ffi::OSTREE_TREE_GVARIANT_STRING).to_str().unwrap()});
pub static TREE_GVARIANT_STRING: &GStr = unsafe{GStr::from_utf8_with_nul_unchecked(ffi::OSTREE_TREE_GVARIANT_STRING)};

View File

@ -2,10 +2,7 @@
// from gir-files
// DO NOT EDIT
use glib::object::IsA;
use glib::translate::*;
use std::fmt;
use std::ptr;
use glib::{prelude::*,translate::*};
glib::wrapper! {
#[doc(alias = "OstreeContentWriter")]
@ -20,15 +17,9 @@ impl ContentWriter {
#[doc(alias = "ostree_content_writer_finish")]
pub fn finish(&self, cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<glib::GString, glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let mut error = std::ptr::null_mut();
let ret = ffi::ostree_content_writer_finish(self.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) }
}
}
}
impl fmt::Display for ContentWriter {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.write_str("ContentWriter")
}
}

View File

@ -2,12 +2,11 @@
// from gir-files
// DO NOT EDIT
use crate::BootconfigParser;
#[cfg(any(feature = "v2016_4", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2016_4")))]
use crate::DeploymentUnlockedState;
use glib::translate::*;
use std::fmt;
use crate::{BootconfigParser};
#[cfg(feature = "v2016_4")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2016_4")))]
use crate::{DeploymentUnlockedState};
use glib::{translate::*};
glib::wrapper! {
#[doc(alias = "OstreeDeployment")]
@ -113,8 +112,8 @@ impl Deployment {
}
}
#[cfg(any(feature = "v2016_4", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2016_4")))]
#[cfg(feature = "v2016_4")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2016_4")))]
#[doc(alias = "ostree_deployment_get_unlocked")]
#[doc(alias = "get_unlocked")]
pub fn unlocked(&self) -> DeploymentUnlockedState {
@ -130,8 +129,17 @@ impl Deployment {
}
}
#[cfg(any(feature = "v2018_3", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_3")))]
#[cfg(feature = "v2023_8")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2023_8")))]
#[doc(alias = "ostree_deployment_is_finalization_locked")]
pub fn is_finalization_locked(&self) -> bool {
unsafe {
from_glib(ffi::ostree_deployment_is_finalization_locked(self.to_glib_none().0))
}
}
#[cfg(feature = "v2018_3")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2018_3")))]
#[doc(alias = "ostree_deployment_is_pinned")]
pub fn is_pinned(&self) -> bool {
unsafe {
@ -139,8 +147,8 @@ impl Deployment {
}
}
#[cfg(any(feature = "v2018_3", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_3")))]
#[cfg(feature = "v2018_3")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2018_3")))]
#[doc(alias = "ostree_deployment_is_staged")]
pub fn is_staged(&self) -> bool {
unsafe {
@ -176,8 +184,8 @@ impl Deployment {
}
}
#[cfg(any(feature = "v2018_3", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_3")))]
#[cfg(feature = "v2018_3")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2018_3")))]
#[doc(alias = "ostree_deployment_origin_remove_transient_state")]
pub fn origin_remove_transient_state(origin: &glib::KeyFile) {
unsafe {
@ -185,8 +193,8 @@ impl Deployment {
}
}
#[cfg(any(feature = "v2016_4", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2016_4")))]
#[cfg(feature = "v2016_4")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2016_4")))]
#[doc(alias = "ostree_deployment_unlocked_state_to_string")]
pub fn unlocked_state_to_string(state: DeploymentUnlockedState) -> glib::GString {
unsafe {
@ -194,9 +202,3 @@ impl Deployment {
}
}
}
impl fmt::Display for Deployment {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.write_str("Deployment")
}
}

View File

@ -2,8 +2,7 @@
// from gir-files
// DO NOT EDIT
use glib::translate::*;
use std::fmt;
use glib::{translate::*};
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[derive(Clone, Copy)]
@ -22,44 +21,35 @@ pub enum DeploymentUnlockedState {
__Unknown(i32),
}
impl fmt::Display for DeploymentUnlockedState {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "DeploymentUnlockedState::{}", match *self {
Self::None => "None",
Self::Development => "Development",
Self::Hotfix => "Hotfix",
Self::Transient => "Transient",
_ => "Unknown",
})
}
}
#[doc(hidden)]
impl IntoGlib for DeploymentUnlockedState {
type GlibType = ffi::OstreeDeploymentUnlockedState;
fn into_glib(self) -> ffi::OstreeDeploymentUnlockedState {
match self {
#[inline]
fn into_glib(self) -> ffi::OstreeDeploymentUnlockedState {
match self {
Self::None => ffi::OSTREE_DEPLOYMENT_UNLOCKED_NONE,
Self::Development => ffi::OSTREE_DEPLOYMENT_UNLOCKED_DEVELOPMENT,
Self::Hotfix => ffi::OSTREE_DEPLOYMENT_UNLOCKED_HOTFIX,
Self::Transient => ffi::OSTREE_DEPLOYMENT_UNLOCKED_TRANSIENT,
Self::__Unknown(value) => value,
}
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::OstreeDeploymentUnlockedState> for DeploymentUnlockedState {
unsafe fn from_glib(value: ffi::OstreeDeploymentUnlockedState) -> Self {
match value {
#[inline]
unsafe fn from_glib(value: ffi::OstreeDeploymentUnlockedState) -> Self {
match value {
ffi::OSTREE_DEPLOYMENT_UNLOCKED_NONE => Self::None,
ffi::OSTREE_DEPLOYMENT_UNLOCKED_DEVELOPMENT => Self::Development,
ffi::OSTREE_DEPLOYMENT_UNLOCKED_HOTFIX => Self::Hotfix,
ffi::OSTREE_DEPLOYMENT_UNLOCKED_TRANSIENT => Self::Transient,
value => Self::__Unknown(value),
}
}
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
@ -101,35 +91,12 @@ pub enum GpgSignatureAttr {
__Unknown(i32),
}
impl fmt::Display for GpgSignatureAttr {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "GpgSignatureAttr::{}", match *self {
Self::Valid => "Valid",
Self::SigExpired => "SigExpired",
Self::KeyExpired => "KeyExpired",
Self::KeyRevoked => "KeyRevoked",
Self::KeyMissing => "KeyMissing",
Self::Fingerprint => "Fingerprint",
Self::Timestamp => "Timestamp",
Self::ExpTimestamp => "ExpTimestamp",
Self::PubkeyAlgoName => "PubkeyAlgoName",
Self::HashAlgoName => "HashAlgoName",
Self::UserName => "UserName",
Self::UserEmail => "UserEmail",
Self::FingerprintPrimary => "FingerprintPrimary",
Self::KeyExpTimestamp => "KeyExpTimestamp",
Self::KeyExpTimestampPrimary => "KeyExpTimestampPrimary",
_ => "Unknown",
})
}
}
#[doc(hidden)]
impl IntoGlib for GpgSignatureAttr {
type GlibType = ffi::OstreeGpgSignatureAttr;
fn into_glib(self) -> ffi::OstreeGpgSignatureAttr {
match self {
match self {
Self::Valid => ffi::OSTREE_GPG_SIGNATURE_ATTR_VALID,
Self::SigExpired => ffi::OSTREE_GPG_SIGNATURE_ATTR_SIG_EXPIRED,
Self::KeyExpired => ffi::OSTREE_GPG_SIGNATURE_ATTR_KEY_EXPIRED,
@ -147,13 +114,14 @@ impl IntoGlib for GpgSignatureAttr {
Self::KeyExpTimestampPrimary => ffi::OSTREE_GPG_SIGNATURE_ATTR_KEY_EXP_TIMESTAMP_PRIMARY,
Self::__Unknown(value) => value,
}
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::OstreeGpgSignatureAttr> for GpgSignatureAttr {
unsafe fn from_glib(value: ffi::OstreeGpgSignatureAttr) -> Self {
match value {
match value {
ffi::OSTREE_GPG_SIGNATURE_ATTR_VALID => Self::Valid,
ffi::OSTREE_GPG_SIGNATURE_ATTR_SIG_EXPIRED => Self::SigExpired,
ffi::OSTREE_GPG_SIGNATURE_ATTR_KEY_EXPIRED => Self::KeyExpired,
@ -171,7 +139,7 @@ impl FromGlib<ffi::OstreeGpgSignatureAttr> for GpgSignatureAttr {
ffi::OSTREE_GPG_SIGNATURE_ATTR_KEY_EXP_TIMESTAMP_PRIMARY => Self::KeyExpTimestampPrimary,
value => Self::__Unknown(value),
}
}
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
@ -201,29 +169,13 @@ pub enum ObjectType {
__Unknown(i32),
}
impl fmt::Display for ObjectType {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "ObjectType::{}", match *self {
Self::File => "File",
Self::DirTree => "DirTree",
Self::DirMeta => "DirMeta",
Self::Commit => "Commit",
Self::TombstoneCommit => "TombstoneCommit",
Self::CommitMeta => "CommitMeta",
Self::PayloadLink => "PayloadLink",
Self::FileXattrs => "FileXattrs",
Self::FileXattrsLink => "FileXattrsLink",
_ => "Unknown",
})
}
}
#[doc(hidden)]
impl IntoGlib for ObjectType {
type GlibType = ffi::OstreeObjectType;
fn into_glib(self) -> ffi::OstreeObjectType {
match self {
#[inline]
fn into_glib(self) -> ffi::OstreeObjectType {
match self {
Self::File => ffi::OSTREE_OBJECT_TYPE_FILE,
Self::DirTree => ffi::OSTREE_OBJECT_TYPE_DIR_TREE,
Self::DirMeta => ffi::OSTREE_OBJECT_TYPE_DIR_META,
@ -235,13 +187,15 @@ impl IntoGlib for ObjectType {
Self::FileXattrsLink => ffi::OSTREE_OBJECT_TYPE_FILE_XATTRS_LINK,
Self::__Unknown(value) => value,
}
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::OstreeObjectType> for ObjectType {
unsafe fn from_glib(value: ffi::OstreeObjectType) -> Self {
match value {
#[inline]
unsafe fn from_glib(value: ffi::OstreeObjectType) -> Self {
match value {
ffi::OSTREE_OBJECT_TYPE_FILE => Self::File,
ffi::OSTREE_OBJECT_TYPE_DIR_TREE => Self::DirTree,
ffi::OSTREE_OBJECT_TYPE_DIR_META => Self::DirMeta,
@ -253,11 +207,11 @@ impl FromGlib<ffi::OstreeObjectType> for ObjectType {
ffi::OSTREE_OBJECT_TYPE_FILE_XATTRS_LINK => Self::FileXattrsLink,
value => Self::__Unknown(value),
}
}
}
}
#[cfg(any(feature = "v2018_2", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_2")))]
#[cfg(feature = "v2018_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2018_2")))]
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[derive(Clone, Copy)]
#[non_exhaustive]
@ -271,44 +225,35 @@ pub enum RepoCheckoutFilterResult {
__Unknown(i32),
}
#[cfg(any(feature = "v2018_2", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_2")))]
impl fmt::Display for RepoCheckoutFilterResult {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "RepoCheckoutFilterResult::{}", match *self {
Self::Allow => "Allow",
Self::Skip => "Skip",
_ => "Unknown",
})
}
}
#[cfg(any(feature = "v2018_2", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_2")))]
#[cfg(feature = "v2018_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2018_2")))]
#[doc(hidden)]
impl IntoGlib for RepoCheckoutFilterResult {
type GlibType = ffi::OstreeRepoCheckoutFilterResult;
fn into_glib(self) -> ffi::OstreeRepoCheckoutFilterResult {
match self {
#[inline]
fn into_glib(self) -> ffi::OstreeRepoCheckoutFilterResult {
match self {
Self::Allow => ffi::OSTREE_REPO_CHECKOUT_FILTER_ALLOW,
Self::Skip => ffi::OSTREE_REPO_CHECKOUT_FILTER_SKIP,
Self::__Unknown(value) => value,
}
}
}
}
#[cfg(any(feature = "v2018_2", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_2")))]
#[cfg(feature = "v2018_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2018_2")))]
#[doc(hidden)]
impl FromGlib<ffi::OstreeRepoCheckoutFilterResult> for RepoCheckoutFilterResult {
unsafe fn from_glib(value: ffi::OstreeRepoCheckoutFilterResult) -> Self {
match value {
#[inline]
unsafe fn from_glib(value: ffi::OstreeRepoCheckoutFilterResult) -> Self {
match value {
ffi::OSTREE_REPO_CHECKOUT_FILTER_ALLOW => Self::Allow,
ffi::OSTREE_REPO_CHECKOUT_FILTER_SKIP => Self::Skip,
value => Self::__Unknown(value),
}
}
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
@ -324,38 +269,31 @@ pub enum RepoCheckoutMode {
__Unknown(i32),
}
impl fmt::Display for RepoCheckoutMode {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "RepoCheckoutMode::{}", match *self {
Self::None => "None",
Self::User => "User",
_ => "Unknown",
})
}
}
#[doc(hidden)]
impl IntoGlib for RepoCheckoutMode {
type GlibType = ffi::OstreeRepoCheckoutMode;
fn into_glib(self) -> ffi::OstreeRepoCheckoutMode {
match self {
#[inline]
fn into_glib(self) -> ffi::OstreeRepoCheckoutMode {
match self {
Self::None => ffi::OSTREE_REPO_CHECKOUT_MODE_NONE,
Self::User => ffi::OSTREE_REPO_CHECKOUT_MODE_USER,
Self::__Unknown(value) => value,
}
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::OstreeRepoCheckoutMode> for RepoCheckoutMode {
unsafe fn from_glib(value: ffi::OstreeRepoCheckoutMode) -> Self {
match value {
#[inline]
unsafe fn from_glib(value: ffi::OstreeRepoCheckoutMode) -> Self {
match value {
ffi::OSTREE_REPO_CHECKOUT_MODE_NONE => Self::None,
ffi::OSTREE_REPO_CHECKOUT_MODE_USER => Self::User,
value => Self::__Unknown(value),
}
}
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
@ -375,44 +313,35 @@ pub enum RepoCheckoutOverwriteMode {
__Unknown(i32),
}
impl fmt::Display for RepoCheckoutOverwriteMode {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "RepoCheckoutOverwriteMode::{}", match *self {
Self::None => "None",
Self::UnionFiles => "UnionFiles",
Self::AddFiles => "AddFiles",
Self::UnionIdentical => "UnionIdentical",
_ => "Unknown",
})
}
}
#[doc(hidden)]
impl IntoGlib for RepoCheckoutOverwriteMode {
type GlibType = ffi::OstreeRepoCheckoutOverwriteMode;
fn into_glib(self) -> ffi::OstreeRepoCheckoutOverwriteMode {
match self {
#[inline]
fn into_glib(self) -> ffi::OstreeRepoCheckoutOverwriteMode {
match self {
Self::None => ffi::OSTREE_REPO_CHECKOUT_OVERWRITE_NONE,
Self::UnionFiles => ffi::OSTREE_REPO_CHECKOUT_OVERWRITE_UNION_FILES,
Self::AddFiles => ffi::OSTREE_REPO_CHECKOUT_OVERWRITE_ADD_FILES,
Self::UnionIdentical => ffi::OSTREE_REPO_CHECKOUT_OVERWRITE_UNION_IDENTICAL,
Self::__Unknown(value) => value,
}
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::OstreeRepoCheckoutOverwriteMode> for RepoCheckoutOverwriteMode {
unsafe fn from_glib(value: ffi::OstreeRepoCheckoutOverwriteMode) -> Self {
match value {
#[inline]
unsafe fn from_glib(value: ffi::OstreeRepoCheckoutOverwriteMode) -> Self {
match value {
ffi::OSTREE_REPO_CHECKOUT_OVERWRITE_NONE => Self::None,
ffi::OSTREE_REPO_CHECKOUT_OVERWRITE_UNION_FILES => Self::UnionFiles,
ffi::OSTREE_REPO_CHECKOUT_OVERWRITE_ADD_FILES => Self::AddFiles,
ffi::OSTREE_REPO_CHECKOUT_OVERWRITE_UNION_IDENTICAL => Self::UnionIdentical,
value => Self::__Unknown(value),
}
}
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
@ -428,38 +357,31 @@ pub enum RepoCommitFilterResult {
__Unknown(i32),
}
impl fmt::Display for RepoCommitFilterResult {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "RepoCommitFilterResult::{}", match *self {
Self::Allow => "Allow",
Self::Skip => "Skip",
_ => "Unknown",
})
}
}
#[doc(hidden)]
impl IntoGlib for RepoCommitFilterResult {
type GlibType = ffi::OstreeRepoCommitFilterResult;
fn into_glib(self) -> ffi::OstreeRepoCommitFilterResult {
match self {
#[inline]
fn into_glib(self) -> ffi::OstreeRepoCommitFilterResult {
match self {
Self::Allow => ffi::OSTREE_REPO_COMMIT_FILTER_ALLOW,
Self::Skip => ffi::OSTREE_REPO_COMMIT_FILTER_SKIP,
Self::__Unknown(value) => value,
}
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::OstreeRepoCommitFilterResult> for RepoCommitFilterResult {
unsafe fn from_glib(value: ffi::OstreeRepoCommitFilterResult) -> Self {
match value {
#[inline]
unsafe fn from_glib(value: ffi::OstreeRepoCommitFilterResult) -> Self {
match value {
ffi::OSTREE_REPO_COMMIT_FILTER_ALLOW => Self::Allow,
ffi::OSTREE_REPO_COMMIT_FILTER_SKIP => Self::Skip,
value => Self::__Unknown(value),
}
}
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
@ -479,44 +401,35 @@ pub enum RepoCommitIterResult {
__Unknown(i32),
}
impl fmt::Display for RepoCommitIterResult {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "RepoCommitIterResult::{}", match *self {
Self::Error => "Error",
Self::End => "End",
Self::File => "File",
Self::Dir => "Dir",
_ => "Unknown",
})
}
}
#[doc(hidden)]
impl IntoGlib for RepoCommitIterResult {
type GlibType = ffi::OstreeRepoCommitIterResult;
fn into_glib(self) -> ffi::OstreeRepoCommitIterResult {
match self {
#[inline]
fn into_glib(self) -> ffi::OstreeRepoCommitIterResult {
match self {
Self::Error => ffi::OSTREE_REPO_COMMIT_ITER_RESULT_ERROR,
Self::End => ffi::OSTREE_REPO_COMMIT_ITER_RESULT_END,
Self::File => ffi::OSTREE_REPO_COMMIT_ITER_RESULT_FILE,
Self::Dir => ffi::OSTREE_REPO_COMMIT_ITER_RESULT_DIR,
Self::__Unknown(value) => value,
}
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::OstreeRepoCommitIterResult> for RepoCommitIterResult {
unsafe fn from_glib(value: ffi::OstreeRepoCommitIterResult) -> Self {
match value {
#[inline]
unsafe fn from_glib(value: ffi::OstreeRepoCommitIterResult) -> Self {
match value {
ffi::OSTREE_REPO_COMMIT_ITER_RESULT_ERROR => Self::Error,
ffi::OSTREE_REPO_COMMIT_ITER_RESULT_END => Self::End,
ffi::OSTREE_REPO_COMMIT_ITER_RESULT_FILE => Self::File,
ffi::OSTREE_REPO_COMMIT_ITER_RESULT_DIR => Self::Dir,
value => Self::__Unknown(value),
}
}
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
@ -538,25 +451,13 @@ pub enum RepoMode {
__Unknown(i32),
}
impl fmt::Display for RepoMode {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "RepoMode::{}", match *self {
Self::Bare => "Bare",
Self::Archive => "Archive",
Self::BareUser => "BareUser",
Self::BareUserOnly => "BareUserOnly",
Self::BareSplitXattrs => "BareSplitXattrs",
_ => "Unknown",
})
}
}
#[doc(hidden)]
impl IntoGlib for RepoMode {
type GlibType = ffi::OstreeRepoMode;
fn into_glib(self) -> ffi::OstreeRepoMode {
match self {
#[inline]
fn into_glib(self) -> ffi::OstreeRepoMode {
match self {
Self::Bare => ffi::OSTREE_REPO_MODE_BARE,
Self::Archive => ffi::OSTREE_REPO_MODE_ARCHIVE,
Self::BareUser => ffi::OSTREE_REPO_MODE_BARE_USER,
@ -564,13 +465,15 @@ impl IntoGlib for RepoMode {
Self::BareSplitXattrs => ffi::OSTREE_REPO_MODE_BARE_SPLIT_XATTRS,
Self::__Unknown(value) => value,
}
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::OstreeRepoMode> for RepoMode {
unsafe fn from_glib(value: ffi::OstreeRepoMode) -> Self {
match value {
#[inline]
unsafe fn from_glib(value: ffi::OstreeRepoMode) -> Self {
match value {
ffi::OSTREE_REPO_MODE_BARE => Self::Bare,
ffi::OSTREE_REPO_MODE_ARCHIVE => Self::Archive,
ffi::OSTREE_REPO_MODE_BARE_USER => Self::BareUser,
@ -578,7 +481,7 @@ impl FromGlib<ffi::OstreeRepoMode> for RepoMode {
ffi::OSTREE_REPO_MODE_BARE_SPLIT_XATTRS => Self::BareSplitXattrs,
value => Self::__Unknown(value),
}
}
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
@ -600,25 +503,13 @@ pub enum RepoRemoteChange {
__Unknown(i32),
}
impl fmt::Display for RepoRemoteChange {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "RepoRemoteChange::{}", match *self {
Self::Add => "Add",
Self::AddIfNotExists => "AddIfNotExists",
Self::Delete => "Delete",
Self::DeleteIfExists => "DeleteIfExists",
Self::Replace => "Replace",
_ => "Unknown",
})
}
}
#[doc(hidden)]
impl IntoGlib for RepoRemoteChange {
type GlibType = ffi::OstreeRepoRemoteChange;
fn into_glib(self) -> ffi::OstreeRepoRemoteChange {
match self {
#[inline]
fn into_glib(self) -> ffi::OstreeRepoRemoteChange {
match self {
Self::Add => ffi::OSTREE_REPO_REMOTE_CHANGE_ADD,
Self::AddIfNotExists => ffi::OSTREE_REPO_REMOTE_CHANGE_ADD_IF_NOT_EXISTS,
Self::Delete => ffi::OSTREE_REPO_REMOTE_CHANGE_DELETE,
@ -626,13 +517,15 @@ impl IntoGlib for RepoRemoteChange {
Self::Replace => ffi::OSTREE_REPO_REMOTE_CHANGE_REPLACE,
Self::__Unknown(value) => value,
}
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::OstreeRepoRemoteChange> for RepoRemoteChange {
unsafe fn from_glib(value: ffi::OstreeRepoRemoteChange) -> Self {
match value {
#[inline]
unsafe fn from_glib(value: ffi::OstreeRepoRemoteChange) -> Self {
match value {
ffi::OSTREE_REPO_REMOTE_CHANGE_ADD => Self::Add,
ffi::OSTREE_REPO_REMOTE_CHANGE_ADD_IF_NOT_EXISTS => Self::AddIfNotExists,
ffi::OSTREE_REPO_REMOTE_CHANGE_DELETE => Self::Delete,
@ -640,7 +533,7 @@ impl FromGlib<ffi::OstreeRepoRemoteChange> for RepoRemoteChange {
ffi::OSTREE_REPO_REMOTE_CHANGE_REPLACE => Self::Replace,
value => Self::__Unknown(value),
}
}
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
@ -656,37 +549,30 @@ pub enum StaticDeltaGenerateOpt {
__Unknown(i32),
}
impl fmt::Display for StaticDeltaGenerateOpt {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "StaticDeltaGenerateOpt::{}", match *self {
Self::Lowlatency => "Lowlatency",
Self::Major => "Major",
_ => "Unknown",
})
}
}
#[doc(hidden)]
impl IntoGlib for StaticDeltaGenerateOpt {
type GlibType = ffi::OstreeStaticDeltaGenerateOpt;
fn into_glib(self) -> ffi::OstreeStaticDeltaGenerateOpt {
match self {
#[inline]
fn into_glib(self) -> ffi::OstreeStaticDeltaGenerateOpt {
match self {
Self::Lowlatency => ffi::OSTREE_STATIC_DELTA_GENERATE_OPT_LOWLATENCY,
Self::Major => ffi::OSTREE_STATIC_DELTA_GENERATE_OPT_MAJOR,
Self::__Unknown(value) => value,
}
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::OstreeStaticDeltaGenerateOpt> for StaticDeltaGenerateOpt {
unsafe fn from_glib(value: ffi::OstreeStaticDeltaGenerateOpt) -> Self {
match value {
#[inline]
unsafe fn from_glib(value: ffi::OstreeStaticDeltaGenerateOpt) -> Self {
match value {
ffi::OSTREE_STATIC_DELTA_GENERATE_OPT_LOWLATENCY => Self::Lowlatency,
ffi::OSTREE_STATIC_DELTA_GENERATE_OPT_MAJOR => Self::Major,
value => Self::__Unknown(value),
}
}
}
}

View File

@ -2,17 +2,12 @@
// from gir-files
// DO NOT EDIT
use bitflags::bitflags;
use glib::translate::*;
use glib::value::FromValue;
use glib::value::ToValue;
use glib::StaticType;
use glib::Type;
use std::fmt;
use glib::{bitflags::bitflags,prelude::*,translate::*};
#[cfg(any(feature = "v2017_13", feature = "dox"))]
#[cfg(feature = "v2017_13")]
bitflags! {
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_13")))]
#[cfg_attr(docsrs, doc(cfg(feature = "v2017_13")))]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
#[doc(alias = "OstreeChecksumFlags")]
pub struct ChecksumFlags: u32 {
#[doc(alias = "OSTREE_CHECKSUM_FLAGS_NONE")]
@ -24,35 +19,30 @@ bitflags! {
}
}
#[cfg(any(feature = "v2017_13", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_13")))]
impl fmt::Display for ChecksumFlags {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
<Self as fmt::Debug>::fmt(self, f)
}
}
#[cfg(any(feature = "v2017_13", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_13")))]
#[cfg(feature = "v2017_13")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2017_13")))]
#[doc(hidden)]
impl IntoGlib for ChecksumFlags {
type GlibType = ffi::OstreeChecksumFlags;
#[inline]
fn into_glib(self) -> ffi::OstreeChecksumFlags {
self.bits()
}
}
#[cfg(any(feature = "v2017_13", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_13")))]
#[cfg(feature = "v2017_13")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2017_13")))]
#[doc(hidden)]
impl FromGlib<ffi::OstreeChecksumFlags> for ChecksumFlags {
#[inline]
unsafe fn from_glib(value: ffi::OstreeChecksumFlags) -> Self {
Self::from_bits_truncate(value)
}
}
bitflags! {
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
#[doc(alias = "OstreeDiffFlags")]
pub struct DiffFlags: u32 {
#[doc(alias = "OSTREE_DIFF_FLAGS_NONE")]
@ -62,16 +52,11 @@ bitflags! {
}
}
impl fmt::Display for DiffFlags {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
<Self as fmt::Debug>::fmt(self, f)
}
}
#[doc(hidden)]
impl IntoGlib for DiffFlags {
type GlibType = ffi::OstreeDiffFlags;
#[inline]
fn into_glib(self) -> ffi::OstreeDiffFlags {
self.bits()
}
@ -79,12 +64,14 @@ impl IntoGlib for DiffFlags {
#[doc(hidden)]
impl FromGlib<ffi::OstreeDiffFlags> for DiffFlags {
#[inline]
unsafe fn from_glib(value: ffi::OstreeDiffFlags) -> Self {
Self::from_bits_truncate(value)
}
}
bitflags! {
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
#[doc(alias = "OstreeGpgSignatureFormatFlags")]
pub struct GpgSignatureFormatFlags: u32 {
#[doc(alias = "OSTREE_GPG_SIGNATURE_FORMAT_DEFAULT")]
@ -92,16 +79,11 @@ bitflags! {
}
}
impl fmt::Display for GpgSignatureFormatFlags {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
<Self as fmt::Debug>::fmt(self, f)
}
}
#[doc(hidden)]
impl IntoGlib for GpgSignatureFormatFlags {
type GlibType = ffi::OstreeGpgSignatureFormatFlags;
#[inline]
fn into_glib(self) -> ffi::OstreeGpgSignatureFormatFlags {
self.bits()
}
@ -109,12 +91,14 @@ impl IntoGlib for GpgSignatureFormatFlags {
#[doc(hidden)]
impl FromGlib<ffi::OstreeGpgSignatureFormatFlags> for GpgSignatureFormatFlags {
#[inline]
unsafe fn from_glib(value: ffi::OstreeGpgSignatureFormatFlags) -> Self {
Self::from_bits_truncate(value)
}
}
bitflags! {
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
#[doc(alias = "OstreeRepoCommitModifierFlags")]
pub struct RepoCommitModifierFlags: u32 {
#[doc(alias = "OSTREE_REPO_COMMIT_MODIFIER_FLAGS_NONE")]
@ -131,12 +115,8 @@ bitflags! {
const CONSUME = ffi::OSTREE_REPO_COMMIT_MODIFIER_FLAGS_CONSUME as _;
#[doc(alias = "OSTREE_REPO_COMMIT_MODIFIER_FLAGS_DEVINO_CANONICAL")]
const DEVINO_CANONICAL = ffi::OSTREE_REPO_COMMIT_MODIFIER_FLAGS_DEVINO_CANONICAL as _;
}
}
impl fmt::Display for RepoCommitModifierFlags {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
<Self as fmt::Debug>::fmt(self, f)
#[doc(alias = "OSTREE_REPO_COMMIT_MODIFIER_FLAGS_SELINUX_LABEL_V1")]
const SELINUX_LABEL_V1 = ffi::OSTREE_REPO_COMMIT_MODIFIER_FLAGS_SELINUX_LABEL_V1 as _;
}
}
@ -144,6 +124,7 @@ impl fmt::Display for RepoCommitModifierFlags {
impl IntoGlib for RepoCommitModifierFlags {
type GlibType = ffi::OstreeRepoCommitModifierFlags;
#[inline]
fn into_glib(self) -> ffi::OstreeRepoCommitModifierFlags {
self.bits()
}
@ -151,14 +132,16 @@ impl IntoGlib for RepoCommitModifierFlags {
#[doc(hidden)]
impl FromGlib<ffi::OstreeRepoCommitModifierFlags> for RepoCommitModifierFlags {
#[inline]
unsafe fn from_glib(value: ffi::OstreeRepoCommitModifierFlags) -> Self {
Self::from_bits_truncate(value)
}
}
#[cfg(any(feature = "v2015_7", feature = "dox"))]
#[cfg(feature = "v2015_7")]
bitflags! {
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2015_7")))]
#[cfg_attr(docsrs, doc(cfg(feature = "v2015_7")))]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
#[doc(alias = "OstreeRepoCommitState")]
pub struct RepoCommitState: u32 {
#[doc(alias = "OSTREE_REPO_COMMIT_STATE_NORMAL")]
@ -170,35 +153,30 @@ bitflags! {
}
}
#[cfg(any(feature = "v2015_7", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2015_7")))]
impl fmt::Display for RepoCommitState {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
<Self as fmt::Debug>::fmt(self, f)
}
}
#[cfg(any(feature = "v2015_7", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2015_7")))]
#[cfg(feature = "v2015_7")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2015_7")))]
#[doc(hidden)]
impl IntoGlib for RepoCommitState {
type GlibType = ffi::OstreeRepoCommitState;
#[inline]
fn into_glib(self) -> ffi::OstreeRepoCommitState {
self.bits()
}
}
#[cfg(any(feature = "v2015_7", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2015_7")))]
#[cfg(feature = "v2015_7")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2015_7")))]
#[doc(hidden)]
impl FromGlib<ffi::OstreeRepoCommitState> for RepoCommitState {
#[inline]
unsafe fn from_glib(value: ffi::OstreeRepoCommitState) -> Self {
Self::from_bits_truncate(value)
}
}
bitflags! {
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
#[doc(alias = "OstreeRepoCommitTraverseFlags")]
pub struct RepoCommitTraverseFlags: u32 {
#[doc(alias = "OSTREE_REPO_COMMIT_TRAVERSE_FLAG_NONE")]
@ -208,16 +186,11 @@ bitflags! {
}
}
impl fmt::Display for RepoCommitTraverseFlags {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
<Self as fmt::Debug>::fmt(self, f)
}
}
#[doc(hidden)]
impl IntoGlib for RepoCommitTraverseFlags {
type GlibType = ffi::OstreeRepoCommitTraverseFlags;
#[inline]
fn into_glib(self) -> ffi::OstreeRepoCommitTraverseFlags {
self.bits()
}
@ -225,12 +198,14 @@ impl IntoGlib for RepoCommitTraverseFlags {
#[doc(hidden)]
impl FromGlib<ffi::OstreeRepoCommitTraverseFlags> for RepoCommitTraverseFlags {
#[inline]
unsafe fn from_glib(value: ffi::OstreeRepoCommitTraverseFlags) -> Self {
Self::from_bits_truncate(value)
}
}
bitflags! {
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
#[doc(alias = "OstreeRepoListObjectsFlags")]
pub struct RepoListObjectsFlags: u32 {
#[doc(alias = "OSTREE_REPO_LIST_OBJECTS_LOOSE")]
@ -244,16 +219,11 @@ bitflags! {
}
}
impl fmt::Display for RepoListObjectsFlags {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
<Self as fmt::Debug>::fmt(self, f)
}
}
#[doc(hidden)]
impl IntoGlib for RepoListObjectsFlags {
type GlibType = ffi::OstreeRepoListObjectsFlags;
#[inline]
fn into_glib(self) -> ffi::OstreeRepoListObjectsFlags {
self.bits()
}
@ -261,12 +231,14 @@ impl IntoGlib for RepoListObjectsFlags {
#[doc(hidden)]
impl FromGlib<ffi::OstreeRepoListObjectsFlags> for RepoListObjectsFlags {
#[inline]
unsafe fn from_glib(value: ffi::OstreeRepoListObjectsFlags) -> Self {
Self::from_bits_truncate(value)
}
}
bitflags! {
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
#[doc(alias = "OstreeRepoListRefsExtFlags")]
pub struct RepoListRefsExtFlags: u32 {
#[doc(alias = "OSTREE_REPO_LIST_REFS_EXT_NONE")]
@ -280,16 +252,11 @@ bitflags! {
}
}
impl fmt::Display for RepoListRefsExtFlags {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
<Self as fmt::Debug>::fmt(self, f)
}
}
#[doc(hidden)]
impl IntoGlib for RepoListRefsExtFlags {
type GlibType = ffi::OstreeRepoListRefsExtFlags;
#[inline]
fn into_glib(self) -> ffi::OstreeRepoListRefsExtFlags {
self.bits()
}
@ -297,12 +264,14 @@ impl IntoGlib for RepoListRefsExtFlags {
#[doc(hidden)]
impl FromGlib<ffi::OstreeRepoListRefsExtFlags> for RepoListRefsExtFlags {
#[inline]
unsafe fn from_glib(value: ffi::OstreeRepoListRefsExtFlags) -> Self {
Self::from_bits_truncate(value)
}
}
bitflags! {
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
#[doc(alias = "OstreeRepoPruneFlags")]
pub struct RepoPruneFlags: u32 {
#[doc(alias = "OSTREE_REPO_PRUNE_FLAGS_NONE")]
@ -316,16 +285,11 @@ bitflags! {
}
}
impl fmt::Display for RepoPruneFlags {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
<Self as fmt::Debug>::fmt(self, f)
}
}
#[doc(hidden)]
impl IntoGlib for RepoPruneFlags {
type GlibType = ffi::OstreeRepoPruneFlags;
#[inline]
fn into_glib(self) -> ffi::OstreeRepoPruneFlags {
self.bits()
}
@ -333,12 +297,14 @@ impl IntoGlib for RepoPruneFlags {
#[doc(hidden)]
impl FromGlib<ffi::OstreeRepoPruneFlags> for RepoPruneFlags {
#[inline]
unsafe fn from_glib(value: ffi::OstreeRepoPruneFlags) -> Self {
Self::from_bits_truncate(value)
}
}
bitflags! {
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
#[doc(alias = "OstreeRepoPullFlags")]
pub struct RepoPullFlags: u32 {
#[doc(alias = "OSTREE_REPO_PULL_FLAGS_NONE")]
@ -356,16 +322,11 @@ bitflags! {
}
}
impl fmt::Display for RepoPullFlags {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
<Self as fmt::Debug>::fmt(self, f)
}
}
#[doc(hidden)]
impl IntoGlib for RepoPullFlags {
type GlibType = ffi::OstreeRepoPullFlags;
#[inline]
fn into_glib(self) -> ffi::OstreeRepoPullFlags {
self.bits()
}
@ -373,12 +334,14 @@ impl IntoGlib for RepoPullFlags {
#[doc(hidden)]
impl FromGlib<ffi::OstreeRepoPullFlags> for RepoPullFlags {
#[inline]
unsafe fn from_glib(value: ffi::OstreeRepoPullFlags) -> Self {
Self::from_bits_truncate(value)
}
}
bitflags! {
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
#[doc(alias = "OstreeRepoResolveRevExtFlags")]
pub struct RepoResolveRevExtFlags: u32 {
#[doc(alias = "OSTREE_REPO_RESOLVE_REV_EXT_NONE")]
@ -388,16 +351,11 @@ bitflags! {
}
}
impl fmt::Display for RepoResolveRevExtFlags {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
<Self as fmt::Debug>::fmt(self, f)
}
}
#[doc(hidden)]
impl IntoGlib for RepoResolveRevExtFlags {
type GlibType = ffi::OstreeRepoResolveRevExtFlags;
#[inline]
fn into_glib(self) -> ffi::OstreeRepoResolveRevExtFlags {
self.bits()
}
@ -405,14 +363,16 @@ impl IntoGlib for RepoResolveRevExtFlags {
#[doc(hidden)]
impl FromGlib<ffi::OstreeRepoResolveRevExtFlags> for RepoResolveRevExtFlags {
#[inline]
unsafe fn from_glib(value: ffi::OstreeRepoResolveRevExtFlags) -> Self {
Self::from_bits_truncate(value)
}
}
#[cfg(any(feature = "v2021_4", feature = "dox"))]
#[cfg(feature = "v2021_4")]
bitflags! {
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2021_4")))]
#[cfg_attr(docsrs, doc(cfg(feature = "v2021_4")))]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
#[doc(alias = "OstreeRepoVerifyFlags")]
pub struct RepoVerifyFlags: u32 {
#[doc(alias = "OSTREE_REPO_VERIFY_FLAGS_NONE")]
@ -424,35 +384,30 @@ bitflags! {
}
}
#[cfg(any(feature = "v2021_4", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2021_4")))]
impl fmt::Display for RepoVerifyFlags {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
<Self as fmt::Debug>::fmt(self, f)
}
}
#[cfg(any(feature = "v2021_4", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2021_4")))]
#[cfg(feature = "v2021_4")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2021_4")))]
#[doc(hidden)]
impl IntoGlib for RepoVerifyFlags {
type GlibType = ffi::OstreeRepoVerifyFlags;
#[inline]
fn into_glib(self) -> ffi::OstreeRepoVerifyFlags {
self.bits()
}
}
#[cfg(any(feature = "v2021_4", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2021_4")))]
#[cfg(feature = "v2021_4")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2021_4")))]
#[doc(hidden)]
impl FromGlib<ffi::OstreeRepoVerifyFlags> for RepoVerifyFlags {
#[inline]
unsafe fn from_glib(value: ffi::OstreeRepoVerifyFlags) -> Self {
Self::from_bits_truncate(value)
}
}
bitflags! {
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
#[doc(alias = "OstreeSePolicyRestoreconFlags")]
pub struct SePolicyRestoreconFlags: u32 {
#[doc(alias = "OSTREE_SEPOLICY_RESTORECON_FLAGS_NONE")]
@ -464,16 +419,11 @@ bitflags! {
}
}
impl fmt::Display for SePolicyRestoreconFlags {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
<Self as fmt::Debug>::fmt(self, f)
}
}
#[doc(hidden)]
impl IntoGlib for SePolicyRestoreconFlags {
type GlibType = ffi::OstreeSePolicyRestoreconFlags;
#[inline]
fn into_glib(self) -> ffi::OstreeSePolicyRestoreconFlags {
self.bits()
}
@ -481,12 +431,14 @@ impl IntoGlib for SePolicyRestoreconFlags {
#[doc(hidden)]
impl FromGlib<ffi::OstreeSePolicyRestoreconFlags> for SePolicyRestoreconFlags {
#[inline]
unsafe fn from_glib(value: ffi::OstreeSePolicyRestoreconFlags) -> Self {
Self::from_bits_truncate(value)
}
}
bitflags! {
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
#[doc(alias = "OstreeSysrootSimpleWriteDeploymentFlags")]
pub struct SysrootSimpleWriteDeploymentFlags: u32 {
#[doc(alias = "OSTREE_SYSROOT_SIMPLE_WRITE_DEPLOYMENT_FLAGS_NONE")]
@ -504,16 +456,11 @@ bitflags! {
}
}
impl fmt::Display for SysrootSimpleWriteDeploymentFlags {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
<Self as fmt::Debug>::fmt(self, f)
}
}
#[doc(hidden)]
impl IntoGlib for SysrootSimpleWriteDeploymentFlags {
type GlibType = ffi::OstreeSysrootSimpleWriteDeploymentFlags;
#[inline]
fn into_glib(self) -> ffi::OstreeSysrootSimpleWriteDeploymentFlags {
self.bits()
}
@ -521,12 +468,14 @@ impl IntoGlib for SysrootSimpleWriteDeploymentFlags {
#[doc(hidden)]
impl FromGlib<ffi::OstreeSysrootSimpleWriteDeploymentFlags> for SysrootSimpleWriteDeploymentFlags {
#[inline]
unsafe fn from_glib(value: ffi::OstreeSysrootSimpleWriteDeploymentFlags) -> Self {
Self::from_bits_truncate(value)
}
}
bitflags! {
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
#[doc(alias = "OstreeSysrootUpgraderFlags")]
pub struct SysrootUpgraderFlags: u32 {
#[doc(alias = "OSTREE_SYSROOT_UPGRADER_FLAGS_IGNORE_UNCONFIGURED")]
@ -536,16 +485,11 @@ bitflags! {
}
}
impl fmt::Display for SysrootUpgraderFlags {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
<Self as fmt::Debug>::fmt(self, f)
}
}
#[doc(hidden)]
impl IntoGlib for SysrootUpgraderFlags {
type GlibType = ffi::OstreeSysrootUpgraderFlags;
#[inline]
fn into_glib(self) -> ffi::OstreeSysrootUpgraderFlags {
self.bits()
}
@ -553,30 +497,45 @@ impl IntoGlib for SysrootUpgraderFlags {
#[doc(hidden)]
impl FromGlib<ffi::OstreeSysrootUpgraderFlags> for SysrootUpgraderFlags {
#[inline]
unsafe fn from_glib(value: ffi::OstreeSysrootUpgraderFlags) -> Self {
Self::from_bits_truncate(value)
}
}
impl StaticType for SysrootUpgraderFlags {
fn static_type() -> Type {
unsafe { from_glib(ffi::ostree_sysroot_upgrader_flags_get_type()) }
}
#[inline]
#[doc(alias = "ostree_sysroot_upgrader_flags_get_type")]
fn static_type() -> glib::Type {
unsafe { from_glib(ffi::ostree_sysroot_upgrader_flags_get_type()) }
}
}
impl glib::HasParamSpec for SysrootUpgraderFlags {
type ParamSpec = glib::ParamSpecFlags;
type SetValue = Self;
type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
Self::ParamSpec::builder
}
}
impl glib::value::ValueType for SysrootUpgraderFlags {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for SysrootUpgraderFlags {
unsafe impl<'a> glib::value::FromValue<'a> for SysrootUpgraderFlags {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
unsafe fn from_value(value: &'a glib::Value) -> Self {
from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
}
}
impl ToValue for SysrootUpgraderFlags {
#[inline]
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
@ -585,6 +544,7 @@ impl ToValue for SysrootUpgraderFlags {
value
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
@ -598,6 +558,7 @@ impl From<SysrootUpgraderFlags> for glib::Value {
}
bitflags! {
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
#[doc(alias = "OstreeSysrootUpgraderPullFlags")]
pub struct SysrootUpgraderPullFlags: u32 {
#[doc(alias = "OSTREE_SYSROOT_UPGRADER_PULL_FLAGS_NONE")]
@ -609,16 +570,11 @@ bitflags! {
}
}
impl fmt::Display for SysrootUpgraderPullFlags {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
<Self as fmt::Debug>::fmt(self, f)
}
}
#[doc(hidden)]
impl IntoGlib for SysrootUpgraderPullFlags {
type GlibType = ffi::OstreeSysrootUpgraderPullFlags;
#[inline]
fn into_glib(self) -> ffi::OstreeSysrootUpgraderPullFlags {
self.bits()
}
@ -626,6 +582,7 @@ impl IntoGlib for SysrootUpgraderPullFlags {
#[doc(hidden)]
impl FromGlib<ffi::OstreeSysrootUpgraderPullFlags> for SysrootUpgraderPullFlags {
#[inline]
unsafe fn from_glib(value: ffi::OstreeSysrootUpgraderPullFlags) -> Self {
Self::from_bits_truncate(value)
}

View File

@ -2,32 +2,27 @@
// from gir-files
// DO NOT EDIT
#[cfg(any(feature = "v2020_1", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_1")))]
use crate::CommitSizesEntry;
use crate::DiffFlags;
use crate::DiffItem;
use crate::ObjectType;
use glib::object::IsA;
use glib::translate::*;
use std::mem;
use std::ptr;
use crate::{DiffFlags,DiffItem,ObjectType};
#[cfg(feature = "v2020_1")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2020_1")))]
use crate::{CommitSizesEntry};
use glib::{prelude::*,translate::*};
#[cfg(any(feature = "v2017_15", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_15")))]
#[cfg(feature = "v2017_15")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2017_15")))]
#[doc(alias = "ostree_break_hardlink")]
pub fn break_hardlink(dfd: i32, path: &str, skip_xattrs: bool, cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let mut error = std::ptr::null_mut();
let is_ok = ffi::ostree_break_hardlink(dfd, path.to_glib_none().0, skip_xattrs.into_glib(), cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
}
}
#[cfg(any(feature = "v2017_4", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_4")))]
#[cfg(feature = "v2017_4")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2017_4")))]
#[doc(alias = "ostree_check_version")]
pub fn check_version(required_year: u32, required_release: u32) -> bool {
unsafe {
@ -59,8 +54,8 @@ pub fn checksum_to_bytes_v(checksum: &str) -> glib::Variant {
}
}
#[cfg(any(feature = "v2018_2", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_2")))]
#[cfg(feature = "v2018_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2018_2")))]
#[doc(alias = "ostree_commit_get_content_checksum")]
pub fn commit_get_content_checksum(commit_variant: &glib::Variant) -> Option<glib::GString> {
unsafe {
@ -68,15 +63,15 @@ pub fn commit_get_content_checksum(commit_variant: &glib::Variant) -> Option<gli
}
}
#[cfg(any(feature = "v2020_1", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_1")))]
#[cfg(feature = "v2020_1")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2020_1")))]
#[doc(alias = "ostree_commit_get_object_sizes")]
pub fn commit_get_object_sizes(commit_variant: &glib::Variant) -> Result<Vec<CommitSizesEntry>, glib::Error> {
unsafe {
let mut out_sizes_entries = ptr::null_mut();
let mut error = ptr::null_mut();
let mut out_sizes_entries = std::ptr::null_mut();
let mut error = std::ptr::null_mut();
let is_ok = ffi::ostree_commit_get_object_sizes(commit_variant.to_glib_none().0, &mut out_sizes_entries, &mut error);
assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
if error.is_null() { Ok(FromGlibPtrContainer::from_glib_container(out_sizes_entries)) } else { Err(from_glib_full(error)) }
}
}
@ -88,8 +83,8 @@ pub fn commit_get_parent(commit_variant: &glib::Variant) -> Option<glib::GString
}
}
#[cfg(any(feature = "v2016_3", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2016_3")))]
#[cfg(feature = "v2016_3")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2016_3")))]
#[doc(alias = "ostree_commit_get_timestamp")]
pub fn commit_get_timestamp(commit_variant: &glib::Variant) -> u64 {
unsafe {
@ -97,8 +92,8 @@ pub fn commit_get_timestamp(commit_variant: &glib::Variant) -> u64 {
}
}
//#[cfg(any(feature = "v2021_1", feature = "dox"))]
//#[cfg_attr(feature = "dox", doc(cfg(feature = "v2021_1")))]
//#[cfg(feature = "v2021_1")]
//#[cfg_attr(docsrs, doc(cfg(feature = "v2021_1")))]
//#[doc(alias = "ostree_commit_metadata_for_bootable")]
//pub fn commit_metadata_for_bootable(root: &impl IsA<gio::File>, dict: /*Ignored*/&glib::VariantDict, cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<(), glib::Error> {
// unsafe { TODO: call ffi:ostree_commit_metadata_for_bootable() }
@ -107,12 +102,12 @@ pub fn commit_get_timestamp(commit_variant: &glib::Variant) -> u64 {
#[doc(alias = "ostree_content_file_parse")]
pub fn content_file_parse(compressed: bool, content_path: &impl IsA<gio::File>, trusted: bool, cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<(gio::InputStream, gio::FileInfo, glib::Variant), glib::Error> {
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 mut out_input = std::ptr::null_mut();
let mut out_file_info = std::ptr::null_mut();
let mut out_xattrs = std::ptr::null_mut();
let mut error = std::ptr::null_mut();
let is_ok = ffi::ostree_content_file_parse(compressed.into_glib(), content_path.as_ref().to_glib_none().0, trusted.into_glib(), &mut out_input, &mut out_file_info, &mut out_xattrs, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
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)) }
}
}
@ -120,12 +115,12 @@ pub fn content_file_parse(compressed: bool, content_path: &impl IsA<gio::File>,
#[doc(alias = "ostree_content_file_parse_at")]
pub fn content_file_parse_at(compressed: bool, parent_dfd: i32, path: &str, trusted: bool, cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<(gio::InputStream, gio::FileInfo, glib::Variant), glib::Error> {
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 mut out_input = std::ptr::null_mut();
let mut out_file_info = std::ptr::null_mut();
let mut out_xattrs = std::ptr::null_mut();
let mut error = std::ptr::null_mut();
let is_ok = ffi::ostree_content_file_parse_at(compressed.into_glib(), parent_dfd, path.to_glib_none().0, trusted.into_glib(), &mut out_input, &mut out_file_info, &mut out_xattrs, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
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)) }
}
}
@ -133,12 +128,12 @@ pub fn content_file_parse_at(compressed: bool, parent_dfd: i32, path: &str, trus
#[doc(alias = "ostree_content_stream_parse")]
pub fn content_stream_parse(compressed: bool, input: &impl IsA<gio::InputStream>, input_length: u64, trusted: bool, cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<(gio::InputStream, gio::FileInfo, glib::Variant), glib::Error> {
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 mut out_input = std::ptr::null_mut();
let mut out_file_info = std::ptr::null_mut();
let mut out_xattrs = std::ptr::null_mut();
let mut error = std::ptr::null_mut();
let is_ok = ffi::ostree_content_stream_parse(compressed.into_glib(), input.as_ref().to_glib_none().0, input_length, trusted.into_glib(), &mut out_input, &mut out_file_info, &mut out_xattrs, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
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)) }
}
}
@ -153,15 +148,15 @@ pub fn create_directory_metadata(dir_info: &gio::FileInfo, xattrs: Option<&glib:
#[doc(alias = "ostree_diff_dirs")]
pub fn diff_dirs(flags: DiffFlags, a: &impl IsA<gio::File>, b: &impl IsA<gio::File>, modified: &[&DiffItem], removed: &[gio::File], added: &[gio::File], cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let mut error = std::ptr::null_mut();
let is_ok = ffi::ostree_diff_dirs(flags.into_glib(), a.as_ref().to_glib_none().0, b.as_ref().to_glib_none().0, modified.to_glib_none().0, removed.to_glib_none().0, added.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
}
}
//#[cfg(any(feature = "v2017_4", feature = "dox"))]
//#[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_4")))]
//#[cfg(feature = "v2017_4")]
//#[cfg_attr(docsrs, doc(cfg(feature = "v2017_4")))]
//#[doc(alias = "ostree_diff_dirs_with_options")]
//pub fn diff_dirs_with_options(flags: DiffFlags, a: &impl IsA<gio::File>, b: &impl IsA<gio::File>, modified: &[&DiffItem], removed: &[gio::File], added: &[gio::File], options: /*Ignored*/Option<&mut DiffDirsOptions>, cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<(), glib::Error> {
// unsafe { TODO: call ffi:ostree_diff_dirs_with_options() }
@ -177,7 +172,7 @@ pub fn diff_print(a: &impl IsA<gio::File>, b: &impl IsA<gio::File>, modified: &[
#[doc(alias = "ostree_fs_get_all_xattrs")]
pub fn fs_get_all_xattrs(fd: i32, cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<glib::Variant, glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let mut error = std::ptr::null_mut();
let ret = ffi::ostree_fs_get_all_xattrs(fd, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) }
}
@ -186,14 +181,14 @@ pub fn fs_get_all_xattrs(fd: i32, cancellable: Option<&impl IsA<gio::Cancellable
#[doc(alias = "ostree_fs_get_all_xattrs_at")]
pub fn fs_get_all_xattrs_at(dfd: i32, path: &str, cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<glib::Variant, glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let mut error = std::ptr::null_mut();
let ret = ffi::ostree_fs_get_all_xattrs_at(dfd, path.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) }
}
}
#[cfg(any(feature = "v2017_10", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_10")))]
#[cfg(feature = "v2017_10")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2017_10")))]
#[doc(alias = "ostree_gpg_error_quark")]
pub fn gpg_error_quark() -> glib::Quark {
unsafe {
@ -211,8 +206,8 @@ pub fn metadata_variant_type(objtype: ObjectType) -> glib::VariantType {
#[doc(alias = "ostree_object_from_string")]
pub fn object_from_string(str: &str) -> (glib::GString, ObjectType) {
unsafe {
let mut out_checksum = ptr::null_mut();
let mut out_objtype = mem::MaybeUninit::uninit();
let mut out_checksum = std::ptr::null_mut();
let mut out_objtype = std::mem::MaybeUninit::uninit();
ffi::ostree_object_from_string(str.to_glib_none().0, &mut out_checksum, out_objtype.as_mut_ptr());
(from_glib_full(out_checksum), from_glib(out_objtype.assume_init()))
}
@ -221,8 +216,8 @@ pub fn object_from_string(str: &str) -> (glib::GString, ObjectType) {
#[doc(alias = "ostree_object_name_deserialize")]
pub fn object_name_deserialize(variant: &glib::Variant) -> (glib::GString, ObjectType) {
unsafe {
let mut out_checksum = ptr::null();
let mut out_objtype = mem::MaybeUninit::uninit();
let mut out_checksum = std::ptr::null();
let mut out_objtype = std::mem::MaybeUninit::uninit();
ffi::ostree_object_name_deserialize(variant.to_glib_none().0, &mut out_checksum, out_objtype.as_mut_ptr());
(from_glib_none(out_checksum), from_glib(out_objtype.assume_init()))
}
@ -259,37 +254,37 @@ pub fn object_type_to_string(objtype: ObjectType) -> glib::GString {
#[doc(alias = "ostree_parse_refspec")]
pub fn parse_refspec(refspec: &str) -> Result<(Option<glib::GString>, glib::GString), glib::Error> {
unsafe {
let mut out_remote = ptr::null_mut();
let mut out_ref = ptr::null_mut();
let mut error = ptr::null_mut();
let mut out_remote = std::ptr::null_mut();
let mut out_ref = std::ptr::null_mut();
let mut error = std::ptr::null_mut();
let is_ok = ffi::ostree_parse_refspec(refspec.to_glib_none().0, &mut out_remote, &mut out_ref, &mut error);
assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
if error.is_null() { Ok((from_glib_full(out_remote), from_glib_full(out_ref))) } else { Err(from_glib_full(error)) }
}
}
#[cfg(any(feature = "v2016_6", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2016_6")))]
#[cfg(feature = "v2016_6")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2016_6")))]
#[doc(alias = "ostree_raw_file_to_archive_z2_stream")]
pub fn raw_file_to_archive_z2_stream(input: &impl IsA<gio::InputStream>, file_info: &gio::FileInfo, xattrs: Option<&glib::Variant>, cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<gio::InputStream, glib::Error> {
unsafe {
let mut out_input = ptr::null_mut();
let mut error = ptr::null_mut();
let mut out_input = std::ptr::null_mut();
let mut error = std::ptr::null_mut();
let is_ok = ffi::ostree_raw_file_to_archive_z2_stream(input.as_ref().to_glib_none().0, file_info.to_glib_none().0, xattrs.to_glib_none().0, &mut out_input, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
if error.is_null() { Ok(from_glib_full(out_input)) } else { Err(from_glib_full(error)) }
}
}
#[cfg(any(feature = "v2017_3", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_3")))]
#[cfg(feature = "v2017_3")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2017_3")))]
#[doc(alias = "ostree_raw_file_to_archive_z2_stream_with_options")]
pub fn raw_file_to_archive_z2_stream_with_options(input: &impl IsA<gio::InputStream>, file_info: &gio::FileInfo, xattrs: Option<&glib::Variant>, options: Option<&glib::Variant>, cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<gio::InputStream, glib::Error> {
unsafe {
let mut out_input = ptr::null_mut();
let mut error = ptr::null_mut();
let mut out_input = std::ptr::null_mut();
let mut error = std::ptr::null_mut();
let is_ok = ffi::ostree_raw_file_to_archive_z2_stream_with_options(input.as_ref().to_glib_none().0, file_info.to_glib_none().0, xattrs.to_glib_none().0, options.to_glib_none().0, &mut out_input, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
if error.is_null() { Ok(from_glib_full(out_input)) } else { Err(from_glib_full(error)) }
}
}
@ -297,11 +292,11 @@ pub fn raw_file_to_archive_z2_stream_with_options(input: &impl IsA<gio::InputStr
#[doc(alias = "ostree_raw_file_to_content_stream")]
pub fn raw_file_to_content_stream(input: &impl IsA<gio::InputStream>, file_info: &gio::FileInfo, xattrs: Option<&glib::Variant>, cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<(gio::InputStream, u64), glib::Error> {
unsafe {
let mut out_input = ptr::null_mut();
let mut out_length = mem::MaybeUninit::uninit();
let mut error = ptr::null_mut();
let mut out_input = std::ptr::null_mut();
let mut out_length = std::mem::MaybeUninit::uninit();
let mut error = std::ptr::null_mut();
let is_ok = ffi::ostree_raw_file_to_content_stream(input.as_ref().to_glib_none().0, file_info.to_glib_none().0, xattrs.to_glib_none().0, &mut out_input, out_length.as_mut_ptr(), cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
if error.is_null() { Ok((from_glib_full(out_input), out_length.assume_init())) } else { Err(from_glib_full(error)) }
}
}
@ -309,33 +304,33 @@ pub fn raw_file_to_content_stream(input: &impl IsA<gio::InputStream>, file_info:
#[doc(alias = "ostree_validate_checksum_string")]
pub fn validate_checksum_string(sha256: &str) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let mut error = std::ptr::null_mut();
let is_ok = ffi::ostree_validate_checksum_string(sha256.to_glib_none().0, &mut error);
assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
}
}
#[cfg(any(feature = "v2018_6", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))]
#[cfg(feature = "v2018_6")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))]
#[doc(alias = "ostree_validate_collection_id")]
pub fn validate_collection_id(collection_id: Option<&str>) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let mut error = std::ptr::null_mut();
let is_ok = ffi::ostree_validate_collection_id(collection_id.to_glib_none().0, &mut error);
assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
}
}
#[cfg(any(feature = "v2017_8", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_8")))]
#[cfg(feature = "v2017_8")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2017_8")))]
#[doc(alias = "ostree_validate_remote_name")]
pub fn validate_remote_name(remote_name: &str) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let mut error = std::ptr::null_mut();
let is_ok = ffi::ostree_validate_remote_name(remote_name.to_glib_none().0, &mut error);
assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
}
}
@ -343,9 +338,9 @@ pub fn validate_remote_name(remote_name: &str) -> Result<(), glib::Error> {
#[doc(alias = "ostree_validate_rev")]
pub fn validate_rev(rev: &str) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let mut error = std::ptr::null_mut();
let is_ok = ffi::ostree_validate_rev(rev.to_glib_none().0, &mut error);
assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
}
}
@ -353,9 +348,9 @@ pub fn validate_rev(rev: &str) -> Result<(), glib::Error> {
#[doc(alias = "ostree_validate_structureof_checksum_string")]
pub fn validate_structureof_checksum_string(checksum: &str) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let mut error = std::ptr::null_mut();
let is_ok = ffi::ostree_validate_structureof_checksum_string(checksum.to_glib_none().0, &mut error);
assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
}
}
@ -363,9 +358,9 @@ pub fn validate_structureof_checksum_string(checksum: &str) -> Result<(), glib::
#[doc(alias = "ostree_validate_structureof_commit")]
pub fn validate_structureof_commit(commit: &glib::Variant) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let mut error = std::ptr::null_mut();
let is_ok = ffi::ostree_validate_structureof_commit(commit.to_glib_none().0, &mut error);
assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
}
}
@ -373,9 +368,9 @@ pub fn validate_structureof_commit(commit: &glib::Variant) -> Result<(), glib::E
#[doc(alias = "ostree_validate_structureof_csum_v")]
pub fn validate_structureof_csum_v(checksum: &glib::Variant) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let mut error = std::ptr::null_mut();
let is_ok = ffi::ostree_validate_structureof_csum_v(checksum.to_glib_none().0, &mut error);
assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
}
}
@ -383,9 +378,9 @@ pub fn validate_structureof_csum_v(checksum: &glib::Variant) -> Result<(), glib:
#[doc(alias = "ostree_validate_structureof_dirmeta")]
pub fn validate_structureof_dirmeta(dirmeta: &glib::Variant) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let mut error = std::ptr::null_mut();
let is_ok = ffi::ostree_validate_structureof_dirmeta(dirmeta.to_glib_none().0, &mut error);
assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
}
}
@ -393,9 +388,9 @@ pub fn validate_structureof_dirmeta(dirmeta: &glib::Variant) -> Result<(), glib:
#[doc(alias = "ostree_validate_structureof_dirtree")]
pub fn validate_structureof_dirtree(dirtree: &glib::Variant) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let mut error = std::ptr::null_mut();
let is_ok = ffi::ostree_validate_structureof_dirtree(dirtree.to_glib_none().0, &mut error);
assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
}
}
@ -403,9 +398,9 @@ pub fn validate_structureof_dirtree(dirtree: &glib::Variant) -> Result<(), glib:
#[doc(alias = "ostree_validate_structureof_file_mode")]
pub fn validate_structureof_file_mode(mode: u32) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let mut error = std::ptr::null_mut();
let is_ok = ffi::ostree_validate_structureof_file_mode(mode, &mut error);
assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
}
}
@ -413,9 +408,9 @@ pub fn validate_structureof_file_mode(mode: u32) -> Result<(), glib::Error> {
#[doc(alias = "ostree_validate_structureof_objtype")]
pub fn validate_structureof_objtype(objtype: u8) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let mut error = std::ptr::null_mut();
let is_ok = ffi::ostree_validate_structureof_objtype(objtype, &mut error);
assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
}
}

View File

@ -2,12 +2,7 @@
// from gir-files
// DO NOT EDIT
use glib::translate::*;
use std::fmt;
use std::mem;
#[cfg(any(feature = "v2016_6", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2016_6")))]
use std::ptr;
use glib::{translate::*};
glib::wrapper! {
#[doc(alias = "OstreeGpgVerifyResult")]
@ -49,27 +44,21 @@ impl GpgVerifyResult {
#[doc(alias = "ostree_gpg_verify_result_lookup")]
pub fn lookup(&self, key_id: &str) -> Option<u32> {
unsafe {
let mut out_signature_index = mem::MaybeUninit::uninit();
let mut out_signature_index = std::mem::MaybeUninit::uninit();
let ret = from_glib(ffi::ostree_gpg_verify_result_lookup(self.to_glib_none().0, key_id.to_glib_none().0, out_signature_index.as_mut_ptr()));
if ret { Some(out_signature_index.assume_init()) } else { None }
}
}
#[cfg(any(feature = "v2016_6", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2016_6")))]
#[cfg(feature = "v2016_6")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2016_6")))]
#[doc(alias = "ostree_gpg_verify_result_require_valid_signature")]
pub fn require_valid_signature(&self) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let mut error = std::ptr::null_mut();
let is_ok = ffi::ostree_gpg_verify_result_require_valid_signature(self.to_glib_none().0, &mut error);
assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
}
}
}
impl fmt::Display for GpgVerifyResult {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.write_str("GpgVerifyResult")
}
}

View File

@ -53,28 +53,28 @@ pub use self::sysroot::Sysroot;
mod sysroot_upgrader;
pub use self::sysroot_upgrader::SysrootUpgrader;
#[cfg(any(feature = "v2018_6", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))]
#[cfg(feature = "v2018_6")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))]
mod collection_ref;
#[cfg(any(feature = "v2018_6", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))]
#[cfg(feature = "v2018_6")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))]
pub use self::collection_ref::CollectionRef;
#[cfg(any(feature = "v2020_1", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_1")))]
#[cfg(feature = "v2020_1")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2020_1")))]
mod commit_sizes_entry;
#[cfg(any(feature = "v2020_1", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_1")))]
#[cfg(feature = "v2020_1")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2020_1")))]
pub use self::commit_sizes_entry::CommitSizesEntry;
mod diff_item;
pub use self::diff_item::DiffItem;
#[cfg(any(feature = "v2018_6", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))]
#[cfg(feature = "v2018_6")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))]
mod remote;
#[cfg(any(feature = "v2018_6", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))]
#[cfg(feature = "v2018_6")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))]
pub use self::remote::Remote;
mod repo_commit_modifier;
@ -83,19 +83,19 @@ pub use self::repo_commit_modifier::RepoCommitModifier;
mod repo_dev_ino_cache;
pub use self::repo_dev_ino_cache::RepoDevInoCache;
#[cfg(any(feature = "v2018_6", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))]
#[cfg(feature = "v2018_6")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))]
mod repo_finder_result;
#[cfg(any(feature = "v2018_6", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))]
#[cfg(feature = "v2018_6")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))]
pub use self::repo_finder_result::RepoFinderResult;
mod enums;
pub use self::enums::DeploymentUnlockedState;
pub use self::enums::GpgSignatureAttr;
pub use self::enums::ObjectType;
#[cfg(any(feature = "v2018_2", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_2")))]
#[cfg(feature = "v2018_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2018_2")))]
pub use self::enums::RepoCheckoutFilterResult;
pub use self::enums::RepoCheckoutMode;
pub use self::enums::RepoCheckoutOverwriteMode;
@ -106,14 +106,14 @@ pub use self::enums::RepoRemoteChange;
pub use self::enums::StaticDeltaGenerateOpt;
mod flags;
#[cfg(any(feature = "v2017_13", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_13")))]
#[cfg(feature = "v2017_13")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2017_13")))]
pub use self::flags::ChecksumFlags;
pub use self::flags::DiffFlags;
pub use self::flags::GpgSignatureFormatFlags;
pub use self::flags::RepoCommitModifierFlags;
#[cfg(any(feature = "v2015_7", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2015_7")))]
#[cfg(feature = "v2015_7")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2015_7")))]
pub use self::flags::RepoCommitState;
pub use self::flags::RepoCommitTraverseFlags;
pub use self::flags::RepoListObjectsFlags;
@ -121,69 +121,68 @@ pub use self::flags::RepoListRefsExtFlags;
pub use self::flags::RepoPruneFlags;
pub use self::flags::RepoPullFlags;
pub use self::flags::RepoResolveRevExtFlags;
#[cfg(any(feature = "v2021_4", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2021_4")))]
#[cfg(feature = "v2021_4")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2021_4")))]
pub use self::flags::RepoVerifyFlags;
pub use self::flags::SePolicyRestoreconFlags;
pub use self::flags::SysrootSimpleWriteDeploymentFlags;
pub use self::flags::SysrootUpgraderFlags;
pub use self::flags::SysrootUpgraderPullFlags;
pub mod functions;
pub(crate) mod functions;
mod constants;
pub use self::constants::COMMIT_GVARIANT_STRING;
#[cfg(any(feature = "v2020_4", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_4")))]
#[cfg(feature = "v2020_4")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2020_4")))]
pub use self::constants::COMMIT_META_KEY_ARCHITECTURE;
#[cfg(any(feature = "v2018_6", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))]
#[cfg(feature = "v2018_6")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))]
pub use self::constants::COMMIT_META_KEY_COLLECTION_BINDING;
#[cfg(any(feature = "v2017_7", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_7")))]
#[cfg(feature = "v2017_7")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2017_7")))]
pub use self::constants::COMMIT_META_KEY_ENDOFLIFE;
#[cfg(any(feature = "v2017_7", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_7")))]
#[cfg(feature = "v2017_7")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2017_7")))]
pub use self::constants::COMMIT_META_KEY_ENDOFLIFE_REBASE;
#[cfg(any(feature = "v2017_9", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_9")))]
#[cfg(feature = "v2017_9")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2017_9")))]
pub use self::constants::COMMIT_META_KEY_REF_BINDING;
#[cfg(any(feature = "v2017_13", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_13")))]
#[cfg(feature = "v2017_13")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2017_13")))]
pub use self::constants::COMMIT_META_KEY_SOURCE_TITLE;
#[cfg(any(feature = "v2014_9", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2014_9")))]
#[cfg(feature = "v2014_9")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2014_9")))]
pub use self::constants::COMMIT_META_KEY_VERSION;
pub use self::constants::DIRMETA_GVARIANT_STRING;
pub use self::constants::FILEMETA_GVARIANT_STRING;
pub use self::constants::GPG_KEY_GVARIANT_STRING;
#[cfg(any(feature = "v2021_1", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2021_1")))]
#[cfg(feature = "v2021_1")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2021_1")))]
pub use self::constants::METADATA_KEY_BOOTABLE;
#[cfg(any(feature = "v2021_1", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2021_1")))]
#[cfg(feature = "v2021_1")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2021_1")))]
pub use self::constants::METADATA_KEY_LINUX;
#[cfg(any(feature = "v2018_9", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_9")))]
#[cfg(feature = "v2018_9")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2018_9")))]
pub use self::constants::META_KEY_DEPLOY_COLLECTION_ID;
#[cfg(any(feature = "v2018_3", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_3")))]
#[cfg(feature = "v2018_3")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2018_3")))]
pub use self::constants::ORIGIN_TRANSIENT_GROUP;
#[cfg(any(feature = "v2022_2", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2022_2")))]
#[cfg(feature = "v2022_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2022_2")))]
pub use self::constants::PATH_BOOTED;
#[cfg(any(feature = "v2018_6", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))]
#[cfg(feature = "v2018_6")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))]
pub use self::constants::REPO_METADATA_REF;
#[cfg(any(feature = "v2020_4", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_4")))]
#[cfg(feature = "v2020_4")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2020_4")))]
pub use self::constants::SIGN_NAME_ED25519;
pub use self::constants::SUMMARY_GVARIANT_STRING;
pub use self::constants::SUMMARY_SIG_GVARIANT_STRING;
pub use self::constants::TREE_GVARIANT_STRING;
#[doc(hidden)]
pub mod traits {
pub(crate) mod traits {
pub use super::repo_finder::RepoFinderExt;
pub use super::sign::SignExt;
}

View File

@ -2,12 +2,10 @@
// from gir-files
// DO NOT EDIT
#[cfg(any(feature = "v2018_7", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_7")))]
use crate::Repo;
use glib::translate::*;
use std::fmt;
use std::ptr;
#[cfg(feature = "v2018_7")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2018_7")))]
use crate::{Repo};
use glib::{translate::*};
glib::wrapper! {
#[doc(alias = "OstreeMutableTree")]
@ -26,8 +24,8 @@ impl MutableTree {
}
}
#[cfg(any(feature = "v2018_7", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_7")))]
#[cfg(feature = "v2018_7")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2018_7")))]
#[doc(alias = "ostree_mutable_tree_new_from_checksum")]
#[doc(alias = "new_from_checksum")]
pub fn from_checksum(repo: &Repo, contents_checksum: &str, metadata_checksum: &str) -> MutableTree {
@ -36,26 +34,26 @@ impl MutableTree {
}
}
#[cfg(any(feature = "v2021_5", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2021_5")))]
#[cfg(feature = "v2021_5")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2021_5")))]
#[doc(alias = "ostree_mutable_tree_new_from_commit")]
#[doc(alias = "new_from_commit")]
pub fn from_commit(repo: &Repo, rev: &str) -> Result<MutableTree, glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let mut error = std::ptr::null_mut();
let ret = ffi::ostree_mutable_tree_new_from_commit(repo.to_glib_none().0, rev.to_glib_none().0, &mut error);
if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) }
}
}
#[cfg(any(feature = "v2018_7", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_7")))]
#[cfg(feature = "v2018_7")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2018_7")))]
#[doc(alias = "ostree_mutable_tree_check_error")]
pub fn check_error(&self) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let mut error = std::ptr::null_mut();
let is_ok = ffi::ostree_mutable_tree_check_error(self.to_glib_none().0, &mut error);
assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
}
}
@ -63,10 +61,10 @@ impl MutableTree {
#[doc(alias = "ostree_mutable_tree_ensure_dir")]
pub fn ensure_dir(&self, name: &str) -> Result<MutableTree, glib::Error> {
unsafe {
let mut out_subdir = ptr::null_mut();
let mut error = ptr::null_mut();
let mut out_subdir = std::ptr::null_mut();
let mut error = std::ptr::null_mut();
let is_ok = ffi::ostree_mutable_tree_ensure_dir(self.to_glib_none().0, name.to_glib_none().0, &mut out_subdir, &mut error);
assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
if error.is_null() { Ok(from_glib_full(out_subdir)) } else { Err(from_glib_full(error)) }
}
}
@ -74,16 +72,16 @@ impl MutableTree {
#[doc(alias = "ostree_mutable_tree_ensure_parent_dirs")]
pub fn ensure_parent_dirs(&self, split_path: &[&str], metadata_checksum: &str) -> Result<MutableTree, glib::Error> {
unsafe {
let mut out_parent = ptr::null_mut();
let mut error = ptr::null_mut();
let mut out_parent = std::ptr::null_mut();
let mut error = std::ptr::null_mut();
let is_ok = ffi::ostree_mutable_tree_ensure_parent_dirs(self.to_glib_none().0, split_path.to_glib_none().0, metadata_checksum.to_glib_none().0, &mut out_parent, &mut error);
assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
if error.is_null() { Ok(from_glib_full(out_parent)) } else { Err(from_glib_full(error)) }
}
}
#[cfg(any(feature = "v2018_7", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_7")))]
#[cfg(feature = "v2018_7")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2018_7")))]
#[doc(alias = "ostree_mutable_tree_fill_empty_from_dirtree")]
pub fn fill_empty_from_dirtree(&self, repo: &Repo, contents_checksum: &str, metadata_checksum: &str) -> bool {
unsafe {
@ -122,23 +120,23 @@ impl MutableTree {
#[doc(alias = "ostree_mutable_tree_lookup")]
pub fn lookup(&self, name: &str) -> Result<(Option<glib::GString>, Option<MutableTree>), glib::Error> {
unsafe {
let mut out_file_checksum = ptr::null_mut();
let mut out_subdir = ptr::null_mut();
let mut error = ptr::null_mut();
let mut out_file_checksum = std::ptr::null_mut();
let mut out_subdir = std::ptr::null_mut();
let mut error = std::ptr::null_mut();
let is_ok = ffi::ostree_mutable_tree_lookup(self.to_glib_none().0, name.to_glib_none().0, &mut out_file_checksum, &mut out_subdir, &mut error);
assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
if error.is_null() { Ok((from_glib_full(out_file_checksum), from_glib_full(out_subdir))) } else { Err(from_glib_full(error)) }
}
}
#[cfg(any(feature = "v2018_9", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_9")))]
#[cfg(feature = "v2018_9")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2018_9")))]
#[doc(alias = "ostree_mutable_tree_remove")]
pub fn remove(&self, name: &str, allow_noent: bool) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let mut error = std::ptr::null_mut();
let is_ok = ffi::ostree_mutable_tree_remove(self.to_glib_none().0, name.to_glib_none().0, allow_noent.into_glib(), &mut error);
assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
}
}
@ -146,9 +144,9 @@ impl MutableTree {
#[doc(alias = "ostree_mutable_tree_replace_file")]
pub fn replace_file(&self, name: &str, checksum: &str) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let mut error = std::ptr::null_mut();
let is_ok = ffi::ostree_mutable_tree_replace_file(self.to_glib_none().0, name.to_glib_none().0, checksum.to_glib_none().0, &mut error);
assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
}
}
@ -170,10 +168,10 @@ impl MutableTree {
#[doc(alias = "ostree_mutable_tree_walk")]
pub fn walk(&self, split_path: &[&str], start: u32) -> Result<MutableTree, glib::Error> {
unsafe {
let mut out_subdir = ptr::null_mut();
let mut error = ptr::null_mut();
let mut out_subdir = std::ptr::null_mut();
let mut error = std::ptr::null_mut();
let is_ok = ffi::ostree_mutable_tree_walk(self.to_glib_none().0, split_path.to_glib_none().0, start, &mut out_subdir, &mut error);
assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
if error.is_null() { Ok(from_glib_full(out_subdir)) } else { Err(from_glib_full(error)) }
}
}
@ -184,9 +182,3 @@ impl Default for MutableTree {
Self::new()
}
}
impl fmt::Display for MutableTree {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.write_str("MutableTree")
}
}

View File

@ -2,8 +2,7 @@
// from gir-files
// DO NOT EDIT
use glib::translate::*;
use std::fmt;
use glib::{translate::*};
glib::wrapper! {
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
@ -34,9 +33,9 @@ impl Remote {
}
}
impl fmt::Display for Remote {
impl std::fmt::Display for Remote {
#[inline]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(&self.name())
}
}

File diff suppressed because it is too large Load Diff

View File

@ -2,21 +2,15 @@
// from gir-files
// DO NOT EDIT
use crate::Repo;
use crate::RepoCommitFilterResult;
use crate::RepoCommitModifierFlags;
#[cfg(any(feature = "v2017_13", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_13")))]
use crate::RepoDevInoCache;
use crate::SePolicy;
#[cfg(any(feature = "v2020_4", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_4")))]
use glib::object::IsA;
use glib::translate::*;
use std::boxed::Box as Box_;
#[cfg(any(feature = "v2020_4", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_4")))]
use std::ptr;
use crate::{Repo,RepoCommitFilterResult,RepoCommitModifierFlags,SePolicy};
#[cfg(feature = "v2017_13")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2017_13")))]
use crate::{RepoDevInoCache};
use glib::{translate::*};
#[cfg(feature = "v2020_4")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2020_4")))]
use glib::{prelude::*};
use std::{boxed::Box as Box_};
glib::wrapper! {
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
@ -37,17 +31,17 @@ impl RepoCommitModifier {
let repo = from_glib_borrow(repo);
let path: Borrowed<glib::GString> = from_glib_borrow(path);
let file_info = from_glib_borrow(file_info);
let callback: &Option<Box_<dyn Fn(&Repo, &str, &gio::FileInfo) -> RepoCommitFilterResult + 'static>> = &*(user_data as *mut _);
let res = if let Some(ref callback) = *callback {
let callback = &*(user_data as *mut Option<Box_<dyn Fn(&Repo, &str, &gio::FileInfo) -> RepoCommitFilterResult + 'static>>);
if let Some(ref callback) = *callback {
callback(&repo, path.as_str(), &file_info)
} else {
panic!("cannot get closure...")
};
res.into_glib()
}
.into_glib()
}
let commit_filter = if commit_filter_data.is_some() { Some(commit_filter_func as _) } else { None };
unsafe extern "C" fn destroy_notify_func(data: glib::ffi::gpointer) {
let _callback: Box_<Option<Box_<dyn Fn(&Repo, &str, &gio::FileInfo) -> RepoCommitFilterResult + 'static>>> = Box_::from_raw(data as *mut _);
let _callback = Box_::from_raw(data as *mut Option<Box_<dyn Fn(&Repo, &str, &gio::FileInfo) -> RepoCommitFilterResult + 'static>>);
}
let destroy_call3 = Some(destroy_notify_func as _);
let super_callback0: Box_<Option<Box_<dyn Fn(&Repo, &str, &gio::FileInfo) -> RepoCommitFilterResult + 'static>>> = commit_filter_data;
@ -56,8 +50,8 @@ impl RepoCommitModifier {
}
}
#[cfg(any(feature = "v2017_13", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_13")))]
#[cfg(feature = "v2017_13")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2017_13")))]
#[doc(alias = "ostree_repo_commit_modifier_set_devino_cache")]
pub fn set_devino_cache(&self, cache: &RepoDevInoCache) {
unsafe {
@ -72,14 +66,14 @@ impl RepoCommitModifier {
}
}
#[cfg(any(feature = "v2020_4", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_4")))]
#[cfg(feature = "v2020_4")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2020_4")))]
#[doc(alias = "ostree_repo_commit_modifier_set_sepolicy_from_commit")]
pub fn set_sepolicy_from_commit(&self, repo: &Repo, rev: &str, cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let mut error = std::ptr::null_mut();
let is_ok = ffi::ostree_repo_commit_modifier_set_sepolicy_from_commit(self.to_glib_none().0, repo.to_glib_none().0, rev.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
}
}
@ -91,13 +85,13 @@ impl RepoCommitModifier {
let repo = from_glib_borrow(repo);
let path: Borrowed<glib::GString> = from_glib_borrow(path);
let file_info = from_glib_borrow(file_info);
let callback: &P = &*(user_data as *mut _);
let res = (*callback)(&repo, path.as_str(), &file_info);
res.to_glib_full()
let callback = &*(user_data as *mut P);
(*callback)(&repo, path.as_str(), &file_info)
.to_glib_full()
}
let callback = Some(callback_func::<P> as _);
unsafe extern "C" fn destroy_func<P: Fn(&Repo, &str, &gio::FileInfo) -> glib::Variant + 'static>(data: glib::ffi::gpointer) {
let _callback: Box_<P> = Box_::from_raw(data as *mut _);
let _callback = Box_::from_raw(data as *mut P);
}
let destroy_call2 = Some(destroy_func::<P> as _);
let super_callback0: Box_<P> = callback_data;

View File

@ -2,7 +2,7 @@
// from gir-files
// DO NOT EDIT
use glib::translate::*;
use glib::{translate::*};
glib::wrapper! {
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]

View File

@ -2,12 +2,8 @@
// from gir-files
// DO NOT EDIT
use crate::Repo;
use glib::object::IsA;
use glib::translate::*;
use std::fmt;
use std::mem;
use std::ptr;
use crate::{Repo};
use glib::{prelude::*,translate::*};
glib::wrapper! {
#[doc(alias = "OstreeRepoFile")]
@ -22,9 +18,9 @@ impl RepoFile {
#[doc(alias = "ostree_repo_file_ensure_resolved")]
pub fn ensure_resolved(&self) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let mut error = std::ptr::null_mut();
let is_ok = ffi::ostree_repo_file_ensure_resolved(self.to_glib_none().0, &mut error);
assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
}
}
@ -58,10 +54,10 @@ impl RepoFile {
#[doc(alias = "get_xattrs")]
pub fn xattrs(&self, cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<glib::Variant, glib::Error> {
unsafe {
let mut out_xattrs = ptr::null_mut();
let mut error = ptr::null_mut();
let mut out_xattrs = std::ptr::null_mut();
let mut error = std::ptr::null_mut();
let is_ok = ffi::ostree_repo_file_get_xattrs(self.to_glib_none().0, &mut out_xattrs, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
if error.is_null() { Ok(from_glib_full(out_xattrs)) } else { Err(from_glib_full(error)) }
}
}
@ -69,8 +65,8 @@ impl RepoFile {
#[doc(alias = "ostree_repo_file_tree_find_child")]
pub fn tree_find_child(&self, name: &str) -> (i32, bool, glib::Variant) {
unsafe {
let mut is_dir = mem::MaybeUninit::uninit();
let mut out_container = ptr::null_mut();
let mut is_dir = std::mem::MaybeUninit::uninit();
let mut out_container = std::ptr::null_mut();
let ret = ffi::ostree_repo_file_tree_find_child(self.to_glib_none().0, name.to_glib_none().0, is_dir.as_mut_ptr(), &mut out_container);
(ret, from_glib(is_dir.assume_init()), from_glib_full(out_container))
}
@ -107,10 +103,10 @@ impl RepoFile {
#[doc(alias = "ostree_repo_file_tree_query_child")]
pub fn tree_query_child(&self, n: i32, attributes: &str, flags: gio::FileQueryInfoFlags, cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<gio::FileInfo, glib::Error> {
unsafe {
let mut out_info = ptr::null_mut();
let mut error = ptr::null_mut();
let mut out_info = std::ptr::null_mut();
let mut error = std::ptr::null_mut();
let is_ok = ffi::ostree_repo_file_tree_query_child(self.to_glib_none().0, n, attributes.to_glib_none().0, flags.into_glib(), &mut out_info, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
if error.is_null() { Ok(from_glib_full(out_info)) } else { Err(from_glib_full(error)) }
}
}
@ -122,9 +118,3 @@ impl RepoFile {
}
}
}
impl fmt::Display for RepoFile {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.write_str("RepoFile")
}
}

View File

@ -2,17 +2,13 @@
// from gir-files
// DO NOT EDIT
#[cfg(any(feature = "v2018_6", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))]
use crate::RepoFinderResult;
use glib::object::IsA;
#[cfg(any(feature = "v2018_6", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))]
use glib::translate::*;
use std::fmt;
#[cfg(any(feature = "v2018_6", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))]
use std::ptr;
#[cfg(feature = "v2018_6")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))]
use crate::{RepoFinderResult};
use glib::{prelude::*};
#[cfg(feature = "v2018_6")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))]
use glib::{translate::*};
glib::wrapper! {
#[doc(alias = "OstreeRepoFinder")]
@ -28,12 +24,11 @@ impl RepoFinder {
}
pub trait RepoFinderExt: 'static {}
mod sealed {
pub trait Sealed {}
impl<T: super::IsA<super::RepoFinder>> Sealed for T {}
}
pub trait RepoFinderExt: IsA<RepoFinder> + sealed::Sealed + 'static {}
impl<O: IsA<RepoFinder>> RepoFinderExt for O {}
impl fmt::Display for RepoFinder {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.write_str("RepoFinder")
}
}

View File

@ -2,11 +2,10 @@
// from gir-files
// DO NOT EDIT
use crate::RepoFinder;
#[cfg(any(feature = "v2018_6", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))]
use glib::translate::*;
use std::fmt;
use crate::{RepoFinder};
#[cfg(feature = "v2018_6")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))]
use glib::{translate::*};
glib::wrapper! {
#[doc(alias = "OstreeRepoFinderAvahi")]
@ -18,8 +17,8 @@ glib::wrapper! {
}
impl RepoFinderAvahi {
#[cfg(any(feature = "v2018_6", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))]
#[cfg(feature = "v2018_6")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))]
#[doc(alias = "ostree_repo_finder_avahi_new")]
pub fn new(context: Option<&glib::MainContext>) -> RepoFinderAvahi {
unsafe {
@ -27,8 +26,8 @@ impl RepoFinderAvahi {
}
}
#[cfg(any(feature = "v2018_6", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))]
#[cfg(feature = "v2018_6")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))]
#[doc(alias = "ostree_repo_finder_avahi_stop")]
pub fn stop(&self) {
unsafe {
@ -36,9 +35,3 @@ impl RepoFinderAvahi {
}
}
}
impl fmt::Display for RepoFinderAvahi {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.write_str("RepoFinderAvahi")
}
}

View File

@ -2,11 +2,10 @@
// from gir-files
// DO NOT EDIT
use crate::RepoFinder;
#[cfg(any(feature = "v2018_6", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))]
use glib::translate::*;
use std::fmt;
use crate::{RepoFinder};
#[cfg(feature = "v2018_6")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))]
use glib::{translate::*};
glib::wrapper! {
#[doc(alias = "OstreeRepoFinderConfig")]
@ -18,8 +17,8 @@ glib::wrapper! {
}
impl RepoFinderConfig {
#[cfg(any(feature = "v2018_6", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))]
#[cfg(feature = "v2018_6")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))]
#[doc(alias = "ostree_repo_finder_config_new")]
pub fn new() -> RepoFinderConfig {
unsafe {
@ -28,16 +27,10 @@ impl RepoFinderConfig {
}
}
#[cfg(any(feature = "v2018_6", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))]
#[cfg(feature = "v2018_6")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))]
impl Default for RepoFinderConfig {
fn default() -> Self {
Self::new()
}
}
impl fmt::Display for RepoFinderConfig {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.write_str("RepoFinderConfig")
}
}

View File

@ -2,20 +2,10 @@
// from gir-files
// DO NOT EDIT
use crate::RepoFinder;
#[cfg(any(feature = "v2018_6", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))]
use glib::object::IsA;
#[cfg(any(feature = "v2018_6", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))]
use glib::object::ObjectType as ObjectType_;
#[cfg(any(feature = "v2018_6", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))]
use glib::translate::*;
#[cfg(any(feature = "v2018_6", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))]
use glib::StaticType;
use std::fmt;
use crate::{RepoFinder};
#[cfg(feature = "v2018_6")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))]
use glib::{prelude::*,translate::*};
glib::wrapper! {
#[doc(alias = "OstreeRepoFinderMount")]
@ -27,8 +17,8 @@ glib::wrapper! {
}
impl RepoFinderMount {
#[cfg(any(feature = "v2018_6", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))]
#[cfg(feature = "v2018_6")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))]
#[doc(alias = "ostree_repo_finder_mount_new")]
pub fn new(monitor: Option<&impl IsA<gio::VolumeMonitor>>) -> RepoFinderMount {
unsafe {
@ -36,15 +26,9 @@ impl RepoFinderMount {
}
}
#[cfg(any(feature = "v2018_6", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))]
#[cfg(feature = "v2018_6")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))]
pub fn monitor(&self) -> Option<gio::VolumeMonitor> {
glib::ObjectExt::property(self, "monitor")
}
}
impl fmt::Display for RepoFinderMount {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.write_str("RepoFinderMount")
ObjectExt::property(self, "monitor")
}
}

View File

@ -2,11 +2,10 @@
// from gir-files
// DO NOT EDIT
use crate::RepoFinder;
#[cfg(any(feature = "v2018_6", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))]
use glib::translate::*;
use std::fmt;
use crate::{RepoFinder};
#[cfg(feature = "v2018_6")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))]
use glib::{translate::*};
glib::wrapper! {
#[doc(alias = "OstreeRepoFinderOverride")]
@ -18,8 +17,8 @@ glib::wrapper! {
}
impl RepoFinderOverride {
#[cfg(any(feature = "v2018_6", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))]
#[cfg(feature = "v2018_6")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))]
#[doc(alias = "ostree_repo_finder_override_new")]
pub fn new() -> RepoFinderOverride {
unsafe {
@ -27,8 +26,8 @@ impl RepoFinderOverride {
}
}
#[cfg(any(feature = "v2018_6", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))]
#[cfg(feature = "v2018_6")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))]
#[doc(alias = "ostree_repo_finder_override_add_uri")]
pub fn add_uri(&self, uri: &str) {
unsafe {
@ -37,16 +36,10 @@ impl RepoFinderOverride {
}
}
#[cfg(any(feature = "v2018_6", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))]
#[cfg(feature = "v2018_6")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))]
impl Default for RepoFinderOverride {
fn default() -> Self {
Self::new()
}
}
impl fmt::Display for RepoFinderOverride {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.write_str("RepoFinderOverride")
}
}

View File

@ -2,8 +2,7 @@
// from gir-files
// DO NOT EDIT
use glib::translate::*;
use std::cmp;
use glib::{translate::*};
glib::wrapper! {
#[derive(Debug, Hash)]
@ -41,14 +40,14 @@ impl Eq for RepoFinderResult {}
impl PartialOrd for RepoFinderResult {
#[inline]
fn partial_cmp(&self, other: &Self) -> Option<cmp::Ordering> {
self.compare(other).partial_cmp(&0)
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
Some(self.cmp(other))
}
}
impl Ord for RepoFinderResult {
#[inline]
fn cmp(&self, other: &Self) -> cmp::Ordering {
fn cmp(&self, other: &Self) -> std::cmp::Ordering {
self.compare(other).cmp(&0)
}
}

View File

@ -2,14 +2,8 @@
// from gir-files
// DO NOT EDIT
use crate::Repo;
use crate::SePolicyRestoreconFlags;
use glib::object::IsA;
use glib::object::ObjectType as ObjectType_;
use glib::translate::*;
use glib::StaticType;
use std::fmt;
use std::ptr;
use crate::{Repo,SePolicyRestoreconFlags};
use glib::{prelude::*,translate::*};
glib::wrapper! {
#[doc(alias = "OstreeSePolicy")]
@ -24,18 +18,18 @@ impl SePolicy {
#[doc(alias = "ostree_sepolicy_new")]
pub fn new(path: &impl IsA<gio::File>, cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<SePolicy, glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let mut error = std::ptr::null_mut();
let ret = ffi::ostree_sepolicy_new(path.as_ref().to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) }
}
}
#[cfg(any(feature = "v2017_4", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_4")))]
#[cfg(feature = "v2017_4")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2017_4")))]
#[doc(alias = "ostree_sepolicy_new_at")]
pub fn new_at(rootfs_dfd: i32, cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<SePolicy, glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let mut error = std::ptr::null_mut();
let ret = ffi::ostree_sepolicy_new_at(rootfs_dfd, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) }
}
@ -45,14 +39,14 @@ impl SePolicy {
#[doc(alias = "new_from_commit")]
pub fn from_commit(repo: &Repo, rev: &str, cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<SePolicy, glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let mut error = std::ptr::null_mut();
let ret = ffi::ostree_sepolicy_new_from_commit(repo.to_glib_none().0, rev.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) }
}
}
#[cfg(any(feature = "v2016_5", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2016_5")))]
#[cfg(feature = "v2016_5")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2016_5")))]
#[doc(alias = "ostree_sepolicy_get_csum")]
#[doc(alias = "get_csum")]
pub fn csum(&self) -> Option<glib::GString> {
@ -65,17 +59,17 @@ impl SePolicy {
#[doc(alias = "get_label")]
pub fn label(&self, relpath: &str, unix_mode: u32, cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<Option<glib::GString>, glib::Error> {
unsafe {
let mut out_label = ptr::null_mut();
let mut error = ptr::null_mut();
let mut out_label = std::ptr::null_mut();
let mut error = std::ptr::null_mut();
let is_ok = ffi::ostree_sepolicy_get_label(self.to_glib_none().0, relpath.to_glib_none().0, unix_mode, &mut out_label, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
if error.is_null() { Ok(from_glib_full(out_label)) } else { Err(from_glib_full(error)) }
}
}
#[doc(alias = "ostree_sepolicy_get_name")]
#[doc(alias = "get_name")]
pub fn name(&self) -> glib::GString {
pub fn name(&self) -> Option<glib::GString> {
unsafe {
from_glib_none(ffi::ostree_sepolicy_get_name(self.to_glib_none().0))
}
@ -92,10 +86,10 @@ impl SePolicy {
#[doc(alias = "ostree_sepolicy_restorecon")]
pub fn restorecon(&self, path: &str, info: Option<&gio::FileInfo>, target: &impl IsA<gio::File>, flags: SePolicyRestoreconFlags, cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<Option<glib::GString>, glib::Error> {
unsafe {
let mut out_new_label = ptr::null_mut();
let mut error = ptr::null_mut();
let mut out_new_label = std::ptr::null_mut();
let mut error = std::ptr::null_mut();
let is_ok = ffi::ostree_sepolicy_restorecon(self.to_glib_none().0, path.to_glib_none().0, info.to_glib_none().0, target.as_ref().to_glib_none().0, flags.into_glib(), &mut out_new_label, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
if error.is_null() { Ok(from_glib_full(out_new_label)) } else { Err(from_glib_full(error)) }
}
}
@ -103,23 +97,16 @@ impl SePolicy {
#[doc(alias = "ostree_sepolicy_setfscreatecon")]
pub fn setfscreatecon(&self, path: &str, mode: u32) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let mut error = std::ptr::null_mut();
let is_ok = ffi::ostree_sepolicy_setfscreatecon(self.to_glib_none().0, path.to_glib_none().0, mode, &mut error);
assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
}
}
#[doc(alias = "rootfs-dfd")]
pub fn rootfs_dfd(&self) -> i32 {
glib::ObjectExt::property(self, "rootfs-dfd")
}
}
impl fmt::Display for SePolicy {
#[inline]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.write_str(&self.name())
ObjectExt::property(self, "rootfs-dfd")
}
}

View File

@ -2,17 +2,13 @@
// from gir-files
// DO NOT EDIT
#[cfg(any(feature = "v2020_2", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))]
use crate::Repo;
use glib::object::IsA;
#[cfg(any(feature = "v2020_2", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))]
use glib::translate::*;
use std::fmt;
#[cfg(any(feature = "v2020_2", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))]
use std::ptr;
#[cfg(feature = "v2020_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2020_2")))]
use crate::{Repo};
use glib::{prelude::*};
#[cfg(feature = "v2020_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2020_2")))]
use glib::{translate::*};
glib::wrapper! {
#[doc(alias = "OstreeSign")]
@ -27,8 +23,8 @@ impl Sign {
pub const NONE: Option<&'static Sign> = None;
#[cfg(any(feature = "v2020_2", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))]
#[cfg(feature = "v2020_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2020_2")))]
#[doc(alias = "ostree_sign_get_all")]
#[doc(alias = "get_all")]
pub fn all() -> Vec<Sign> {
@ -37,228 +33,175 @@ impl Sign {
}
}
#[cfg(any(feature = "v2020_2", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))]
#[cfg(feature = "v2020_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2020_2")))]
#[doc(alias = "ostree_sign_get_by_name")]
#[doc(alias = "get_by_name")]
pub fn by_name(name: &str) -> Result<Sign, glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let mut error = std::ptr::null_mut();
let ret = ffi::ostree_sign_get_by_name(name.to_glib_none().0, &mut error);
if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) }
}
}
}
pub trait SignExt: 'static {
#[cfg(any(feature = "v2020_2", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))]
#[doc(alias = "ostree_sign_add_pk")]
fn add_pk(&self, public_key: &glib::Variant) -> Result<(), glib::Error>;
#[cfg(any(feature = "v2020_2", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))]
#[doc(alias = "ostree_sign_clear_keys")]
fn clear_keys(&self) -> Result<(), glib::Error>;
#[cfg(any(feature = "v2020_2", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))]
#[doc(alias = "ostree_sign_commit")]
fn commit(&self, repo: &Repo, commit_checksum: &str, cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<(), glib::Error>;
#[cfg(any(feature = "v2020_2", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))]
#[doc(alias = "ostree_sign_commit_verify")]
fn commit_verify(&self, repo: &Repo, commit_checksum: &str, cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<Option<glib::GString>, glib::Error>;
#[cfg(any(feature = "v2020_2", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))]
#[doc(alias = "ostree_sign_data")]
fn data(&self, data: &glib::Bytes, cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<glib::Bytes, glib::Error>;
#[cfg(any(feature = "v2020_2", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))]
#[doc(alias = "ostree_sign_data_verify")]
fn data_verify(&self, data: &glib::Bytes, signatures: &glib::Variant) -> Result<Option<glib::GString>, glib::Error>;
#[cfg(any(feature = "v2020_2", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))]
#[doc(alias = "ostree_sign_get_name")]
#[doc(alias = "get_name")]
fn name(&self) -> glib::GString;
#[cfg(any(feature = "v2020_2", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))]
#[doc(alias = "ostree_sign_load_pk")]
fn load_pk(&self, options: &glib::Variant) -> Result<(), glib::Error>;
#[cfg(any(feature = "v2020_2", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))]
#[doc(alias = "ostree_sign_metadata_format")]
fn metadata_format(&self) -> glib::GString;
#[cfg(any(feature = "v2020_2", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))]
#[doc(alias = "ostree_sign_metadata_key")]
fn metadata_key(&self) -> glib::GString;
#[cfg(any(feature = "v2020_2", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))]
#[doc(alias = "ostree_sign_set_pk")]
fn set_pk(&self, public_key: &glib::Variant) -> Result<(), glib::Error>;
#[cfg(any(feature = "v2020_2", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))]
#[doc(alias = "ostree_sign_set_sk")]
fn set_sk(&self, secret_key: &glib::Variant) -> Result<(), glib::Error>;
#[cfg(any(feature = "v2020_2", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))]
#[doc(alias = "ostree_sign_summary")]
fn summary(&self, repo: &Repo, keys: &glib::Variant, cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<(), glib::Error>;
mod sealed {
pub trait Sealed {}
impl<T: super::IsA<super::Sign>> Sealed for T {}
}
impl<O: IsA<Sign>> SignExt for O {
#[cfg(any(feature = "v2020_2", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))]
pub trait SignExt: IsA<Sign> + sealed::Sealed + 'static {
#[cfg(feature = "v2020_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2020_2")))]
#[doc(alias = "ostree_sign_add_pk")]
fn add_pk(&self, public_key: &glib::Variant) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let mut error = std::ptr::null_mut();
let is_ok = ffi::ostree_sign_add_pk(self.as_ref().to_glib_none().0, public_key.to_glib_none().0, &mut error);
assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
}
}
#[cfg(any(feature = "v2020_2", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))]
#[cfg(feature = "v2020_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2020_2")))]
#[doc(alias = "ostree_sign_clear_keys")]
fn clear_keys(&self) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let mut error = std::ptr::null_mut();
let is_ok = ffi::ostree_sign_clear_keys(self.as_ref().to_glib_none().0, &mut error);
assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
}
}
#[cfg(any(feature = "v2020_2", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))]
#[cfg(feature = "v2020_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2020_2")))]
#[doc(alias = "ostree_sign_commit")]
fn commit(&self, repo: &Repo, commit_checksum: &str, cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let mut error = std::ptr::null_mut();
let is_ok = ffi::ostree_sign_commit(self.as_ref().to_glib_none().0, repo.to_glib_none().0, commit_checksum.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
}
}
#[cfg(any(feature = "v2020_2", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))]
#[cfg(feature = "v2020_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2020_2")))]
#[doc(alias = "ostree_sign_commit_verify")]
fn commit_verify(&self, repo: &Repo, commit_checksum: &str, cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<Option<glib::GString>, glib::Error> {
unsafe {
let mut out_success_message = ptr::null_mut();
let mut error = ptr::null_mut();
let mut out_success_message = std::ptr::null_mut();
let mut error = std::ptr::null_mut();
let is_ok = ffi::ostree_sign_commit_verify(self.as_ref().to_glib_none().0, repo.to_glib_none().0, commit_checksum.to_glib_none().0, &mut out_success_message, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
if error.is_null() { Ok(from_glib_full(out_success_message)) } else { Err(from_glib_full(error)) }
}
}
#[cfg(any(feature = "v2020_2", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))]
#[cfg(feature = "v2020_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2020_2")))]
#[doc(alias = "ostree_sign_data")]
fn data(&self, data: &glib::Bytes, cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<glib::Bytes, glib::Error> {
unsafe {
let mut signature = ptr::null_mut();
let mut error = ptr::null_mut();
let mut signature = std::ptr::null_mut();
let mut error = std::ptr::null_mut();
let is_ok = ffi::ostree_sign_data(self.as_ref().to_glib_none().0, data.to_glib_none().0, &mut signature, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
if error.is_null() { Ok(from_glib_full(signature)) } else { Err(from_glib_full(error)) }
}
}
#[cfg(any(feature = "v2020_2", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))]
#[cfg(feature = "v2020_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2020_2")))]
#[doc(alias = "ostree_sign_data_verify")]
fn data_verify(&self, data: &glib::Bytes, signatures: &glib::Variant) -> Result<Option<glib::GString>, glib::Error> {
unsafe {
let mut out_success_message = ptr::null_mut();
let mut error = ptr::null_mut();
let mut out_success_message = std::ptr::null_mut();
let mut error = std::ptr::null_mut();
let is_ok = ffi::ostree_sign_data_verify(self.as_ref().to_glib_none().0, data.to_glib_none().0, signatures.to_glib_none().0, &mut out_success_message, &mut error);
assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
if error.is_null() { Ok(from_glib_full(out_success_message)) } else { Err(from_glib_full(error)) }
}
}
#[cfg(any(feature = "v2020_2", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))]
#[cfg(feature = "v2020_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2020_2")))]
#[doc(alias = "ostree_sign_get_name")]
#[doc(alias = "get_name")]
fn name(&self) -> glib::GString {
unsafe {
from_glib_none(ffi::ostree_sign_get_name(self.as_ref().to_glib_none().0))
}
}
#[cfg(any(feature = "v2020_2", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))]
#[cfg(feature = "v2020_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2020_2")))]
#[doc(alias = "ostree_sign_load_pk")]
fn load_pk(&self, options: &glib::Variant) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let mut error = std::ptr::null_mut();
let is_ok = ffi::ostree_sign_load_pk(self.as_ref().to_glib_none().0, options.to_glib_none().0, &mut error);
assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
}
}
#[cfg(any(feature = "v2020_2", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))]
#[cfg(feature = "v2020_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2020_2")))]
#[doc(alias = "ostree_sign_metadata_format")]
fn metadata_format(&self) -> glib::GString {
unsafe {
from_glib_none(ffi::ostree_sign_metadata_format(self.as_ref().to_glib_none().0))
}
}
#[cfg(any(feature = "v2020_2", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))]
#[cfg(feature = "v2020_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2020_2")))]
#[doc(alias = "ostree_sign_metadata_key")]
fn metadata_key(&self) -> glib::GString {
unsafe {
from_glib_none(ffi::ostree_sign_metadata_key(self.as_ref().to_glib_none().0))
}
}
#[cfg(any(feature = "v2020_2", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))]
#[cfg(feature = "v2020_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2020_2")))]
#[doc(alias = "ostree_sign_set_pk")]
fn set_pk(&self, public_key: &glib::Variant) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let mut error = std::ptr::null_mut();
let is_ok = ffi::ostree_sign_set_pk(self.as_ref().to_glib_none().0, public_key.to_glib_none().0, &mut error);
assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
}
}
#[cfg(any(feature = "v2020_2", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))]
#[cfg(feature = "v2020_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2020_2")))]
#[doc(alias = "ostree_sign_set_sk")]
fn set_sk(&self, secret_key: &glib::Variant) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let mut error = std::ptr::null_mut();
let is_ok = ffi::ostree_sign_set_sk(self.as_ref().to_glib_none().0, secret_key.to_glib_none().0, &mut error);
assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
}
}
#[cfg(any(feature = "v2020_2", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))]
#[cfg(feature = "v2020_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2020_2")))]
#[doc(alias = "ostree_sign_summary")]
fn summary(&self, repo: &Repo, keys: &glib::Variant, cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let mut error = std::ptr::null_mut();
let is_ok = ffi::ostree_sign_summary(self.as_ref().to_glib_none().0, repo.to_glib_none().0, keys.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
}
}
}
impl fmt::Display for Sign {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.write_str("Sign")
}
}
impl<O: IsA<Sign>> SignExt for O {}

View File

@ -2,39 +2,24 @@
// from gir-files
// DO NOT EDIT
use crate::Deployment;
#[cfg(any(feature = "v2016_4", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2016_4")))]
use crate::DeploymentUnlockedState;
#[cfg(any(feature = "v2017_7", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_7")))]
use crate::Repo;
#[cfg(any(feature = "v2020_7", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_7")))]
use crate::SysrootDeployTreeOpts;
use crate::SysrootSimpleWriteDeploymentFlags;
#[cfg(any(feature = "v2017_4", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_4")))]
use crate::SysrootWriteDeploymentsOpts;
use glib::object::IsA;
#[cfg(any(feature = "v2017_10", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_10")))]
use glib::object::ObjectType as ObjectType_;
#[cfg(any(feature = "v2017_10", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_10")))]
use glib::signal::connect_raw;
#[cfg(any(feature = "v2017_10", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_10")))]
use glib::signal::SignalHandlerId;
use glib::translate::*;
use std::boxed::Box as Box_;
use std::fmt;
use std::mem;
#[cfg(any(feature = "v2017_10", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_10")))]
use std::mem::transmute;
use std::pin::Pin;
use std::ptr;
use crate::{Deployment,SysrootSimpleWriteDeploymentFlags};
#[cfg(feature = "v2016_4")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2016_4")))]
use crate::{DeploymentUnlockedState};
#[cfg(feature = "v2017_4")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2017_4")))]
use crate::{SysrootWriteDeploymentsOpts};
#[cfg(feature = "v2017_7")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2017_7")))]
use crate::{Repo};
#[cfg(feature = "v2020_7")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2020_7")))]
use crate::{SysrootDeployTreeOpts};
use glib::{prelude::*,translate::*};
#[cfg(feature = "v2017_10")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2017_10")))]
use glib::{signal::{connect_raw, SignalHandlerId}};
use std::{boxed::Box as Box_,pin::Pin};
glib::wrapper! {
#[doc(alias = "OstreeSysroot")]
@ -60,45 +45,57 @@ impl Sysroot {
}
}
#[doc(alias = "ostree_sysroot_cleanup")]
pub fn cleanup(&self, cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<(), glib::Error> {
#[cfg(feature = "v2023_8")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2023_8")))]
#[doc(alias = "ostree_sysroot_change_finalization")]
pub fn change_finalization(&self, deployment: &Deployment) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let is_ok = ffi::ostree_sysroot_cleanup(self.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
let mut error = std::ptr::null_mut();
let is_ok = ffi::ostree_sysroot_change_finalization(self.to_glib_none().0, deployment.to_glib_none().0, &mut error);
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
}
}
//#[cfg(any(feature = "v2018_6", feature = "dox"))]
//#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))]
#[doc(alias = "ostree_sysroot_cleanup")]
pub fn cleanup(&self, cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<(), glib::Error> {
unsafe {
let mut error = std::ptr::null_mut();
let is_ok = ffi::ostree_sysroot_cleanup(self.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
}
}
//#[cfg(feature = "v2018_6")]
//#[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))]
//#[doc(alias = "ostree_sysroot_cleanup_prune_repo")]
//pub fn cleanup_prune_repo(&self, options: /*Ignored*/&mut RepoPruneOptions, cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<(i32, i32, u64), glib::Error> {
// unsafe { TODO: call ffi:ostree_sysroot_cleanup_prune_repo() }
//}
#[cfg(any(feature = "v2018_5", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_5")))]
#[cfg(feature = "v2018_5")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2018_5")))]
#[doc(alias = "ostree_sysroot_deploy_tree")]
pub fn deploy_tree(&self, osname: Option<&str>, revision: &str, origin: Option<&glib::KeyFile>, provided_merge_deployment: Option<&Deployment>, override_kernel_argv: &[&str], cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<Deployment, glib::Error> {
unsafe {
let mut out_new_deployment = ptr::null_mut();
let mut error = ptr::null_mut();
let mut out_new_deployment = std::ptr::null_mut();
let mut error = std::ptr::null_mut();
let is_ok = ffi::ostree_sysroot_deploy_tree(self.to_glib_none().0, osname.to_glib_none().0, revision.to_glib_none().0, origin.to_glib_none().0, provided_merge_deployment.to_glib_none().0, override_kernel_argv.to_glib_none().0, &mut out_new_deployment, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
if error.is_null() { Ok(from_glib_full(out_new_deployment)) } else { Err(from_glib_full(error)) }
}
}
#[cfg(any(feature = "v2020_7", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_7")))]
#[cfg(feature = "v2020_7")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2020_7")))]
#[doc(alias = "ostree_sysroot_deploy_tree_with_options")]
pub fn deploy_tree_with_options(&self, osname: Option<&str>, revision: &str, origin: Option<&glib::KeyFile>, provided_merge_deployment: Option<&Deployment>, opts: Option<&SysrootDeployTreeOpts>, cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<Deployment, glib::Error> {
unsafe {
let mut out_new_deployment = ptr::null_mut();
let mut error = ptr::null_mut();
let mut out_new_deployment = std::ptr::null_mut();
let mut error = std::ptr::null_mut();
let is_ok = ffi::ostree_sysroot_deploy_tree_with_options(self.to_glib_none().0, osname.to_glib_none().0, revision.to_glib_none().0, origin.to_glib_none().0, provided_merge_deployment.to_glib_none().0, mut_override(opts.to_glib_none().0), &mut out_new_deployment, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
if error.is_null() { Ok(from_glib_full(out_new_deployment)) } else { Err(from_glib_full(error)) }
}
}
@ -106,9 +103,9 @@ impl Sysroot {
#[doc(alias = "ostree_sysroot_deployment_set_kargs")]
pub fn deployment_set_kargs(&self, deployment: &Deployment, new_kargs: &[&str], cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let mut error = std::ptr::null_mut();
let is_ok = ffi::ostree_sysroot_deployment_set_kargs(self.to_glib_none().0, deployment.to_glib_none().0, new_kargs.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
}
}
@ -116,9 +113,9 @@ impl Sysroot {
#[doc(alias = "ostree_sysroot_deployment_set_kargs_in_place")]
pub fn deployment_set_kargs_in_place(&self, deployment: &Deployment, kargs_str: Option<&str>, cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let mut error = std::ptr::null_mut();
let is_ok = ffi::ostree_sysroot_deployment_set_kargs_in_place(self.to_glib_none().0, deployment.to_glib_none().0, kargs_str.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
}
}
@ -126,33 +123,33 @@ impl Sysroot {
#[doc(alias = "ostree_sysroot_deployment_set_mutable")]
pub fn deployment_set_mutable(&self, deployment: &Deployment, is_mutable: bool, cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let mut error = std::ptr::null_mut();
let is_ok = ffi::ostree_sysroot_deployment_set_mutable(self.to_glib_none().0, deployment.to_glib_none().0, is_mutable.into_glib(), cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
}
}
#[cfg(any(feature = "v2018_3", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_3")))]
#[cfg(feature = "v2018_3")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2018_3")))]
#[doc(alias = "ostree_sysroot_deployment_set_pinned")]
pub fn deployment_set_pinned(&self, deployment: &Deployment, is_pinned: bool) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let mut error = std::ptr::null_mut();
let is_ok = ffi::ostree_sysroot_deployment_set_pinned(self.to_glib_none().0, deployment.to_glib_none().0, is_pinned.into_glib(), &mut error);
assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
}
}
#[cfg(any(feature = "v2016_4", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2016_4")))]
#[cfg(feature = "v2016_4")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2016_4")))]
#[doc(alias = "ostree_sysroot_deployment_unlock")]
pub fn deployment_unlock(&self, deployment: &Deployment, unlocked_state: DeploymentUnlockedState, cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let mut error = std::ptr::null_mut();
let is_ok = ffi::ostree_sysroot_deployment_unlock(self.to_glib_none().0, deployment.to_glib_none().0, unlocked_state.into_glib(), cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
}
}
@ -160,9 +157,9 @@ impl Sysroot {
#[doc(alias = "ostree_sysroot_ensure_initialized")]
pub fn ensure_initialized(&self, cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let mut error = std::ptr::null_mut();
let is_ok = ffi::ostree_sysroot_ensure_initialized(self.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
}
}
@ -231,8 +228,8 @@ impl Sysroot {
}
}
#[cfg(any(feature = "v2018_5", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_5")))]
#[cfg(feature = "v2018_5")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2018_5")))]
#[doc(alias = "ostree_sysroot_get_staged_deployment")]
#[doc(alias = "get_staged_deployment")]
pub fn staged_deployment(&self) -> Option<Deployment> {
@ -249,44 +246,44 @@ impl Sysroot {
}
}
#[cfg(any(feature = "v2016_4", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2016_4")))]
#[cfg(feature = "v2016_4")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2016_4")))]
#[doc(alias = "ostree_sysroot_init_osname")]
pub fn init_osname(&self, osname: &str, cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let mut error = std::ptr::null_mut();
let is_ok = ffi::ostree_sysroot_init_osname(self.to_glib_none().0, osname.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
}
}
#[cfg(any(feature = "v2020_1", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_1")))]
#[cfg(feature = "v2020_1")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2020_1")))]
#[doc(alias = "ostree_sysroot_initialize")]
pub fn initialize(&self) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let mut error = std::ptr::null_mut();
let is_ok = ffi::ostree_sysroot_initialize(self.to_glib_none().0, &mut error);
assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
}
}
#[cfg(any(feature = "v2022_7", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2022_7")))]
#[cfg(feature = "v2022_7")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2022_7")))]
#[doc(alias = "ostree_sysroot_initialize_with_mount_namespace")]
pub fn initialize_with_mount_namespace(&self, cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let mut error = std::ptr::null_mut();
let is_ok = ffi::ostree_sysroot_initialize_with_mount_namespace(self.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
}
}
#[cfg(any(feature = "v2020_1", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_1")))]
#[cfg(feature = "v2020_1")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2020_1")))]
#[doc(alias = "ostree_sysroot_is_booted")]
pub fn is_booted(&self) -> bool {
unsafe {
@ -297,22 +294,22 @@ impl Sysroot {
#[doc(alias = "ostree_sysroot_load")]
pub fn load(&self, cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let mut error = std::ptr::null_mut();
let is_ok = ffi::ostree_sysroot_load(self.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
}
}
#[cfg(any(feature = "v2016_4", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2016_4")))]
#[cfg(feature = "v2016_4")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2016_4")))]
#[doc(alias = "ostree_sysroot_load_if_changed")]
pub fn load_if_changed(&self, cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<bool, glib::Error> {
unsafe {
let mut out_changed = mem::MaybeUninit::uninit();
let mut error = ptr::null_mut();
let mut out_changed = std::mem::MaybeUninit::uninit();
let mut error = std::ptr::null_mut();
let is_ok = ffi::ostree_sysroot_load_if_changed(self.to_glib_none().0, out_changed.as_mut_ptr(), cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
if error.is_null() { Ok(from_glib(out_changed.assume_init())) } else { Err(from_glib_full(error)) }
}
}
@ -320,9 +317,9 @@ impl Sysroot {
#[doc(alias = "ostree_sysroot_lock")]
pub fn lock(&self) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let mut error = std::ptr::null_mut();
let is_ok = ffi::ostree_sysroot_lock(self.to_glib_none().0, &mut error);
assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
}
}
@ -342,7 +339,7 @@ impl Sysroot {
let user_data: Box_<glib::thread_guard::ThreadGuard<P>> = Box_::new(glib::thread_guard::ThreadGuard::new(callback));
unsafe extern "C" fn lock_async_trampoline<P: FnOnce(Result<(), glib::Error>) + 'static>(_source_object: *mut glib::gobject_ffi::GObject, res: *mut gio::ffi::GAsyncResult, user_data: glib::ffi::gpointer) {
let mut error = ptr::null_mut();
let mut error = std::ptr::null_mut();
let _ = ffi::ostree_sysroot_lock_finish(_source_object as *mut _, res, &mut error);
let result = if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) };
let callback: Box_<glib::thread_guard::ThreadGuard<P>> = Box_::from_raw(user_data as *mut _);
@ -378,27 +375,27 @@ impl Sysroot {
#[doc(alias = "ostree_sysroot_prepare_cleanup")]
pub fn prepare_cleanup(&self, cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let mut error = std::ptr::null_mut();
let is_ok = ffi::ostree_sysroot_prepare_cleanup(self.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
}
}
#[cfg(any(feature = "v2017_7", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_7")))]
#[cfg(feature = "v2017_7")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2017_7")))]
#[doc(alias = "ostree_sysroot_query_deployments_for")]
pub fn query_deployments_for(&self, osname: Option<&str>) -> (Option<Deployment>, Option<Deployment>) {
unsafe {
let mut out_pending = ptr::null_mut();
let mut out_rollback = ptr::null_mut();
let mut out_pending = std::ptr::null_mut();
let mut out_rollback = std::ptr::null_mut();
ffi::ostree_sysroot_query_deployments_for(self.to_glib_none().0, osname.to_glib_none().0, &mut out_pending, &mut out_rollback);
(from_glib_full(out_pending), from_glib_full(out_rollback))
}
}
#[cfg(any(feature = "v2017_7", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_7")))]
#[cfg(feature = "v2017_7")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2017_7")))]
#[doc(alias = "ostree_sysroot_repo")]
pub fn repo(&self) -> Repo {
unsafe {
@ -406,19 +403,19 @@ impl Sysroot {
}
}
#[cfg(any(feature = "v2021_1", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2021_1")))]
#[cfg(feature = "v2021_1")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2021_1")))]
#[doc(alias = "ostree_sysroot_require_booted_deployment")]
pub fn require_booted_deployment(&self) -> Result<Deployment, glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let mut error = std::ptr::null_mut();
let ret = ffi::ostree_sysroot_require_booted_deployment(self.to_glib_none().0, &mut error);
if error.is_null() { Ok(from_glib_none(ret)) } else { Err(from_glib_full(error)) }
}
}
#[cfg(any(feature = "v2020_1", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_1")))]
#[cfg(feature = "v2020_1")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2020_1")))]
#[doc(alias = "ostree_sysroot_set_mount_namespace_in_use")]
pub fn set_mount_namespace_in_use(&self) {
unsafe {
@ -429,48 +426,48 @@ impl Sysroot {
#[doc(alias = "ostree_sysroot_simple_write_deployment")]
pub fn simple_write_deployment(&self, osname: Option<&str>, new_deployment: &Deployment, merge_deployment: Option<&Deployment>, flags: SysrootSimpleWriteDeploymentFlags, cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let mut error = std::ptr::null_mut();
let is_ok = ffi::ostree_sysroot_simple_write_deployment(self.to_glib_none().0, osname.to_glib_none().0, new_deployment.to_glib_none().0, merge_deployment.to_glib_none().0, flags.into_glib(), cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
}
}
#[cfg(any(feature = "v2020_7", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_7")))]
#[cfg(feature = "v2020_7")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2020_7")))]
#[doc(alias = "ostree_sysroot_stage_overlay_initrd")]
pub fn stage_overlay_initrd(&self, fd: i32, cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<glib::GString, glib::Error> {
unsafe {
let mut out_checksum = ptr::null_mut();
let mut error = ptr::null_mut();
let mut out_checksum = std::ptr::null_mut();
let mut error = std::ptr::null_mut();
let is_ok = ffi::ostree_sysroot_stage_overlay_initrd(self.to_glib_none().0, fd, &mut out_checksum, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
if error.is_null() { Ok(from_glib_full(out_checksum)) } else { Err(from_glib_full(error)) }
}
}
#[cfg(any(feature = "v2018_5", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_5")))]
#[cfg(feature = "v2018_5")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2018_5")))]
#[doc(alias = "ostree_sysroot_stage_tree")]
pub fn stage_tree(&self, osname: Option<&str>, revision: &str, origin: Option<&glib::KeyFile>, merge_deployment: Option<&Deployment>, override_kernel_argv: &[&str], cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<Deployment, glib::Error> {
unsafe {
let mut out_new_deployment = ptr::null_mut();
let mut error = ptr::null_mut();
let mut out_new_deployment = std::ptr::null_mut();
let mut error = std::ptr::null_mut();
let is_ok = ffi::ostree_sysroot_stage_tree(self.to_glib_none().0, osname.to_glib_none().0, revision.to_glib_none().0, origin.to_glib_none().0, merge_deployment.to_glib_none().0, override_kernel_argv.to_glib_none().0, &mut out_new_deployment, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
if error.is_null() { Ok(from_glib_full(out_new_deployment)) } else { Err(from_glib_full(error)) }
}
}
#[cfg(any(feature = "v2020_7", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_7")))]
#[cfg(feature = "v2020_7")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2020_7")))]
#[doc(alias = "ostree_sysroot_stage_tree_with_options")]
pub fn stage_tree_with_options(&self, osname: Option<&str>, revision: &str, origin: Option<&glib::KeyFile>, merge_deployment: Option<&Deployment>, opts: &SysrootDeployTreeOpts, cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<Deployment, glib::Error> {
unsafe {
let mut out_new_deployment = ptr::null_mut();
let mut error = ptr::null_mut();
let mut out_new_deployment = std::ptr::null_mut();
let mut error = std::ptr::null_mut();
let is_ok = ffi::ostree_sysroot_stage_tree_with_options(self.to_glib_none().0, osname.to_glib_none().0, revision.to_glib_none().0, origin.to_glib_none().0, merge_deployment.to_glib_none().0, mut_override(opts.to_glib_none().0), &mut out_new_deployment, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
if error.is_null() { Ok(from_glib_full(out_new_deployment)) } else { Err(from_glib_full(error)) }
}
}
@ -478,10 +475,10 @@ impl Sysroot {
#[doc(alias = "ostree_sysroot_try_lock")]
pub fn try_lock(&self) -> Result<bool, glib::Error> {
unsafe {
let mut out_acquired = mem::MaybeUninit::uninit();
let mut error = ptr::null_mut();
let mut out_acquired = std::mem::MaybeUninit::uninit();
let mut error = std::ptr::null_mut();
let is_ok = ffi::ostree_sysroot_try_lock(self.to_glib_none().0, out_acquired.as_mut_ptr(), &mut error);
assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
if error.is_null() { Ok(from_glib(out_acquired.assume_init())) } else { Err(from_glib_full(error)) }
}
}
@ -500,24 +497,36 @@ impl Sysroot {
}
}
#[doc(alias = "ostree_sysroot_write_deployments")]
pub fn write_deployments(&self, new_deployments: &[Deployment], cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<(), glib::Error> {
#[cfg(feature = "v2023_11")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2023_11")))]
#[doc(alias = "ostree_sysroot_update_post_copy")]
pub fn update_post_copy(&self, cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let is_ok = ffi::ostree_sysroot_write_deployments(self.to_glib_none().0, new_deployments.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
let mut error = std::ptr::null_mut();
let is_ok = ffi::ostree_sysroot_update_post_copy(self.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
}
}
#[cfg(any(feature = "v2017_4", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_4")))]
#[doc(alias = "ostree_sysroot_write_deployments")]
pub fn write_deployments(&self, new_deployments: &[Deployment], cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<(), glib::Error> {
unsafe {
let mut error = std::ptr::null_mut();
let is_ok = ffi::ostree_sysroot_write_deployments(self.to_glib_none().0, new_deployments.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
}
}
#[cfg(feature = "v2017_4")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2017_4")))]
#[doc(alias = "ostree_sysroot_write_deployments_with_options")]
pub fn write_deployments_with_options(&self, new_deployments: &[Deployment], opts: &SysrootWriteDeploymentsOpts, cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let mut error = std::ptr::null_mut();
let is_ok = ffi::ostree_sysroot_write_deployments_with_options(self.to_glib_none().0, new_deployments.to_glib_none().0, mut_override(opts.to_glib_none().0), cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
}
}
@ -525,9 +534,9 @@ impl Sysroot {
#[doc(alias = "ostree_sysroot_write_origin_file")]
pub fn write_origin_file(&self, deployment: &Deployment, new_origin: Option<&glib::KeyFile>, cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let mut error = std::ptr::null_mut();
let is_ok = ffi::ostree_sysroot_write_origin_file(self.to_glib_none().0, deployment.to_glib_none().0, new_origin.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
}
}
@ -540,8 +549,8 @@ impl Sysroot {
}
}
#[cfg(any(feature = "v2017_10", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_10")))]
#[cfg(feature = "v2017_10")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2017_10")))]
#[doc(alias = "journal-msg")]
pub fn connect_journal_msg<F: Fn(&Self, &str) + Send + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn journal_msg_trampoline<F: Fn(&Sysroot, &str) + Send + 'static>(this: *mut ffi::OstreeSysroot, msg: *mut libc::c_char, f: glib::ffi::gpointer) {
@ -551,15 +560,9 @@ impl Sysroot {
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"journal-msg\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(journal_msg_trampoline::<F> as *const ())), Box_::into_raw(f))
Some(std::mem::transmute::<_, unsafe extern "C" fn()>(journal_msg_trampoline::<F> as *const ())), Box_::into_raw(f))
}
}
}
unsafe impl Send for Sysroot {}
impl fmt::Display for Sysroot {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.write_str("Sysroot")
}
}

View File

@ -2,19 +2,8 @@
// from gir-files
// DO NOT EDIT
use crate::AsyncProgress;
use crate::Repo;
use crate::RepoPullFlags;
use crate::Sysroot;
use crate::SysrootUpgraderFlags;
use crate::SysrootUpgraderPullFlags;
use glib::object::IsA;
use glib::object::ObjectType as ObjectType_;
use glib::translate::*;
use glib::StaticType;
use std::fmt;
use std::mem;
use std::ptr;
use crate::{AsyncProgress,Repo,RepoPullFlags,Sysroot,SysrootUpgraderFlags,SysrootUpgraderPullFlags};
use glib::{prelude::*,translate::*};
glib::wrapper! {
#[doc(alias = "OstreeSysrootUpgrader")]
@ -29,7 +18,7 @@ impl SysrootUpgrader {
#[doc(alias = "ostree_sysroot_upgrader_new")]
pub fn new(sysroot: &Sysroot, cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<SysrootUpgrader, glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let mut error = std::ptr::null_mut();
let ret = ffi::ostree_sysroot_upgrader_new(sysroot.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) }
}
@ -39,7 +28,7 @@ impl SysrootUpgrader {
#[doc(alias = "new_for_os")]
pub fn for_os(sysroot: &Sysroot, osname: Option<&str>, cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<SysrootUpgrader, glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let mut error = std::ptr::null_mut();
let ret = ffi::ostree_sysroot_upgrader_new_for_os(sysroot.to_glib_none().0, osname.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) }
}
@ -49,7 +38,7 @@ impl SysrootUpgrader {
#[doc(alias = "new_for_os_with_flags")]
pub fn for_os_with_flags(sysroot: &Sysroot, osname: Option<&str>, flags: SysrootUpgraderFlags, cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<SysrootUpgrader, glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let mut error = std::ptr::null_mut();
let ret = ffi::ostree_sysroot_upgrader_new_for_os_with_flags(sysroot.to_glib_none().0, osname.to_glib_none().0, flags.into_glib(), cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) }
}
@ -58,9 +47,9 @@ impl SysrootUpgrader {
#[doc(alias = "ostree_sysroot_upgrader_deploy")]
pub fn deploy(&self, cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let mut error = std::ptr::null_mut();
let is_ok = ffi::ostree_sysroot_upgrader_deploy(self.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
}
}
@ -91,10 +80,10 @@ impl SysrootUpgrader {
#[doc(alias = "ostree_sysroot_upgrader_pull")]
pub fn pull(&self, flags: RepoPullFlags, upgrader_flags: SysrootUpgraderPullFlags, progress: Option<&AsyncProgress>, cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<bool, glib::Error> {
unsafe {
let mut out_changed = mem::MaybeUninit::uninit();
let mut error = ptr::null_mut();
let mut out_changed = std::mem::MaybeUninit::uninit();
let mut error = std::ptr::null_mut();
let is_ok = ffi::ostree_sysroot_upgrader_pull(self.to_glib_none().0, flags.into_glib(), upgrader_flags.into_glib(), progress.to_glib_none().0, out_changed.as_mut_ptr(), cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
if error.is_null() { Ok(from_glib(out_changed.assume_init())) } else { Err(from_glib_full(error)) }
}
}
@ -102,10 +91,10 @@ impl SysrootUpgrader {
#[doc(alias = "ostree_sysroot_upgrader_pull_one_dir")]
pub fn pull_one_dir(&self, dir_to_pull: &str, flags: RepoPullFlags, upgrader_flags: SysrootUpgraderPullFlags, progress: Option<&AsyncProgress>, cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<bool, glib::Error> {
unsafe {
let mut out_changed = mem::MaybeUninit::uninit();
let mut error = ptr::null_mut();
let mut out_changed = std::mem::MaybeUninit::uninit();
let mut error = std::ptr::null_mut();
let is_ok = ffi::ostree_sysroot_upgrader_pull_one_dir(self.to_glib_none().0, dir_to_pull.to_glib_none().0, flags.into_glib(), upgrader_flags.into_glib(), progress.to_glib_none().0, out_changed.as_mut_ptr(), cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
if error.is_null() { Ok(from_glib(out_changed.assume_init())) } else { Err(from_glib_full(error)) }
}
}
@ -113,38 +102,32 @@ impl SysrootUpgrader {
#[doc(alias = "ostree_sysroot_upgrader_set_origin")]
pub fn set_origin(&self, origin: Option<&glib::KeyFile>, cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let mut error = std::ptr::null_mut();
let is_ok = ffi::ostree_sysroot_upgrader_set_origin(self.to_glib_none().0, origin.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
}
}
pub fn flags(&self) -> SysrootUpgraderFlags {
glib::ObjectExt::property(self, "flags")
ObjectExt::property(self, "flags")
}
pub fn osname(&self) -> Option<glib::GString> {
glib::ObjectExt::property(self, "osname")
ObjectExt::property(self, "osname")
}
pub fn sysroot(&self) -> Option<Sysroot> {
glib::ObjectExt::property(self, "sysroot")
ObjectExt::property(self, "sysroot")
}
#[doc(alias = "ostree_sysroot_upgrader_check_timestamps")]
pub fn check_timestamps(repo: &Repo, from_rev: &str, to_rev: &str) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let mut error = std::ptr::null_mut();
let is_ok = ffi::ostree_sysroot_upgrader_check_timestamps(repo.to_glib_none().0, from_rev.to_glib_none().0, to_rev.to_glib_none().0, &mut error);
assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
}
}
}
impl fmt::Display for SysrootUpgrader {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.write_str("SysrootUpgrader")
}
}

View File

@ -1,2 +1,2 @@
Generated by gir (https://github.com/gtk-rs/gir @ 0eeebbdf9d4d)
from gir-files (@ e93ebd738598)
Generated by gir (https://github.com/gtk-rs/gir @ 5223ce91b97a)
from gir-files (@ cae315c499c1)

View File

@ -5,7 +5,8 @@ use crate::RepoMode;
use crate::{Checksum, ObjectDetails, ObjectName, ObjectType, Repo, RepoTransactionStats};
use ffi::OstreeRepoListObjectsFlags;
use glib::ffi as glib_sys;
use glib::{self, translate::*, Error, IsA};
use glib::object::IsA;
use glib::{self, translate::*, Error};
#[cfg(any(feature = "v2017_10", feature = "dox"))]
use std::os::fd::BorrowedFd;
use std::{

View File

@ -74,6 +74,8 @@ impl Sysroot {
#[cfg(test)]
mod tests {
use gio::prelude::*;
use super::*;
#[test]
@ -112,6 +114,9 @@ mod tests {
sysroot.path()
};
assert_eq!(path_created.to_string(), path_loaded.to_string());
assert_eq!(
format!("{:?}", path_created.path()),
format!("{:?}", path_loaded.path())
);
}
}

View File

@ -4,17 +4,17 @@ system-deps = "6"
[dependencies]
libc = "0.2"
[dependencies.gio]
[dependencies.gio_sys]
package = "gio-sys"
version = "0.18"
version = "0.19"
[dependencies.glib]
[dependencies.glib_sys]
package = "glib-sys"
version = "0.18"
version = "0.19"
[dependencies.gobject]
[dependencies.gobject_sys]
package = "gobject-sys"
version = "0.18"
version = "0.19"
[dev-dependencies]
shell-words = "1.0.0"
@ -69,6 +69,8 @@ v2022_5 = ["v2022_2"]
v2022_6 = ["v2022_5"]
v2022_7 = ["v2022_5"]
v2023_1 = ["v2022_7"]
v2023_8 = ["v2023_1"]
v2023_11 = ["v2023_8"]
[lib]
name = "ostree_sys"
@ -84,10 +86,14 @@ license = "MIT"
links = "ostree-1"
name = "ostree-sys"
repository = "https://github.com/ostreedev/ostree-rs"
version = "0.14.0"
version = "0.15.0"
edition = "2021"
[package.metadata.docs.rs]
features = ["dox"]
rustc-args = ["--cfg", "docsrs"]
rustdoc-args = ["--cfg", "docsrs", "--generate-link-to-definition"]
[package.metadata.system-deps.ostree_1]
name = "ostree-1"
version = "0.0"
@ -232,3 +238,9 @@ version = "2022.7"
[package.metadata.system-deps.ostree_1.v2023_1]
version = "2023.1"
[package.metadata.system-deps.ostree_1.v2023_8]
version = "2023.8"
[package.metadata.system-deps.ostree_1.v2023_11]
version = "2023.11"

View File

@ -2,13 +2,13 @@
// from gir-files
// DO NOT EDIT
#[cfg(not(feature = "dox"))]
#[cfg(not(docsrs))]
use std::process;
#[cfg(feature = "dox")]
#[cfg(docsrs)]
fn main() {} // prevent linking libraries to avoid documentation failure
#[cfg(not(feature = "dox"))]
#[cfg(not(docsrs))]
fn main() {
if let Err(s) = system_deps::Config::new().probe() {
println!("cargo:warning={s}");

View File

@ -1,2 +1,2 @@
Generated by gir (https://github.com/gtk-rs/gir @ 0eeebbdf9d4d)
from gir-files (@ e93ebd738598)
Generated by gir (https://github.com/gtk-rs/gir @ 5223ce91b97a)
from gir-files (@ cae315c499c1)

File diff suppressed because it is too large Load Diff

View File

@ -2,13 +2,15 @@
// from gir-files
// DO NOT EDIT
#![cfg(unix)]
use ostree_sys::*;
use std::env;
use std::error::Error;
use std::ffi::OsString;
use std::mem::{align_of, size_of};
use std::path::Path;
use std::process::Command;
use std::process::{Command, Stdio};
use std::str;
use tempfile::Builder;
@ -68,9 +70,11 @@ fn pkg_config_cflags(packages: &[&str]) -> Result<Vec<String>, Box<dyn Error>> {
let mut cmd = Command::new(pkg_config);
cmd.arg("--cflags");
cmd.args(packages);
cmd.stderr(Stdio::inherit());
let out = cmd.output()?;
if !out.status.success() {
return Err(format!("command {cmd:?} returned {}", out.status).into());
let (status, stdout) = (out.status, String::from_utf8_lossy(&out.stdout));
return Err(format!("command {cmd:?} failed, {status:?}\nstdout: {stdout}").into());
}
let stdout = str::from_utf8(&out.stdout)?;
Ok(shell_words::split(stdout.trim())?)
@ -110,7 +114,6 @@ impl Results {
}
#[test]
#[cfg(target_os = "linux")]
fn cross_validate_constants_with_c() {
let mut c_constants: Vec<(String, String)> = Vec::new();
@ -145,7 +148,6 @@ fn cross_validate_constants_with_c() {
}
#[test]
#[cfg(target_os = "linux")]
fn cross_validate_layout_with_c() {
let mut c_layouts = Vec::new();
@ -187,13 +189,15 @@ fn get_c_output(name: &str) -> Result<String, Box<dyn Error>> {
let cc = Compiler::new().expect("configured compiler");
cc.compile(&c_file, &exe)?;
let mut abi_cmd = Command::new(exe);
let output = abi_cmd.output()?;
if !output.status.success() {
return Err(format!("command {abi_cmd:?} failed, {output:?}").into());
let mut cmd = Command::new(exe);
cmd.stderr(Stdio::inherit());
let out = cmd.output()?;
if !out.status.success() {
let (status, stdout) = (out.status, String::from_utf8_lossy(&out.stdout));
return Err(format!("command {cmd:?} failed, {status:?}\nstdout: {stdout}").into());
}
Ok(String::from_utf8(output.stdout)?)
Ok(String::from_utf8(out.stdout)?)
}
const RUST_LAYOUTS: &[(&str, Layout)] = &[
@ -680,6 +684,10 @@ const RUST_CONSTANTS: &[(&str, &str)] = &[
"2",
),
("(guint) OSTREE_REPO_COMMIT_MODIFIER_FLAGS_NONE", "0"),
(
"(guint) OSTREE_REPO_COMMIT_MODIFIER_FLAGS_SELINUX_LABEL_V1",
"64",
),
("(guint) OSTREE_REPO_COMMIT_MODIFIER_FLAGS_SKIP_XATTRS", "1"),
("(guint) OSTREE_REPO_COMMIT_STATE_FSCK_PARTIAL", "2"),
("(guint) OSTREE_REPO_COMMIT_STATE_NORMAL", "0"),

View File

@ -6,174 +6,173 @@
#include <stdio.h>
#define PRINT_CONSTANT(CONSTANT_NAME) \
printf ("%s;", #CONSTANT_NAME); \
printf (_Generic ((CONSTANT_NAME), \
char *: "%s", \
const char *: "%s", \
char: "%c", \
signed char: "%hhd", \
unsigned char: "%hhu", \
short int: "%hd", \
unsigned short int: "%hu", \
int: "%d", \
unsigned int: "%u", \
long: "%ld", \
unsigned long: "%lu", \
long long: "%lld", \
unsigned long long: "%llu", \
float: "%f", \
double: "%f", \
long double: "%ld"), \
CONSTANT_NAME); \
printf ("\n");
printf("%s;", #CONSTANT_NAME); \
printf(_Generic((CONSTANT_NAME), \
char *: "%s", \
const char *: "%s", \
char: "%c", \
signed char: "%hhd", \
unsigned char: "%hhu", \
short int: "%hd", \
unsigned short int: "%hu", \
int: "%d", \
unsigned int: "%u", \
long: "%ld", \
unsigned long: "%lu", \
long long: "%lld", \
unsigned long long: "%llu", \
float: "%f", \
double: "%f", \
long double: "%ld"), \
CONSTANT_NAME); \
printf("\n");
int
main ()
{
PRINT_CONSTANT ((guint)OSTREE_CHECKSUM_FLAGS_CANONICAL_PERMISSIONS);
PRINT_CONSTANT ((guint)OSTREE_CHECKSUM_FLAGS_IGNORE_XATTRS);
PRINT_CONSTANT ((guint)OSTREE_CHECKSUM_FLAGS_NONE);
PRINT_CONSTANT (OSTREE_COMMIT_GVARIANT_STRING);
PRINT_CONSTANT (OSTREE_COMMIT_META_KEY_ARCHITECTURE);
PRINT_CONSTANT (OSTREE_COMMIT_META_KEY_COLLECTION_BINDING);
PRINT_CONSTANT (OSTREE_COMMIT_META_KEY_ENDOFLIFE);
PRINT_CONSTANT (OSTREE_COMMIT_META_KEY_ENDOFLIFE_REBASE);
PRINT_CONSTANT (OSTREE_COMMIT_META_KEY_REF_BINDING);
PRINT_CONSTANT (OSTREE_COMMIT_META_KEY_SOURCE_TITLE);
PRINT_CONSTANT (OSTREE_COMMIT_META_KEY_VERSION);
PRINT_CONSTANT ((gint)OSTREE_DEPLOYMENT_UNLOCKED_DEVELOPMENT);
PRINT_CONSTANT ((gint)OSTREE_DEPLOYMENT_UNLOCKED_HOTFIX);
PRINT_CONSTANT ((gint)OSTREE_DEPLOYMENT_UNLOCKED_NONE);
PRINT_CONSTANT ((gint)OSTREE_DEPLOYMENT_UNLOCKED_TRANSIENT);
PRINT_CONSTANT ((guint)OSTREE_DIFF_FLAGS_IGNORE_XATTRS);
PRINT_CONSTANT ((guint)OSTREE_DIFF_FLAGS_NONE);
PRINT_CONSTANT (OSTREE_DIRMETA_GVARIANT_STRING);
PRINT_CONSTANT (OSTREE_FILEMETA_GVARIANT_STRING);
PRINT_CONSTANT ((gint)OSTREE_GPG_ERROR_EXPIRED_KEY);
PRINT_CONSTANT ((gint)OSTREE_GPG_ERROR_EXPIRED_SIGNATURE);
PRINT_CONSTANT ((gint)OSTREE_GPG_ERROR_INVALID_SIGNATURE);
PRINT_CONSTANT ((gint)OSTREE_GPG_ERROR_MISSING_KEY);
PRINT_CONSTANT ((gint)OSTREE_GPG_ERROR_NO_SIGNATURE);
PRINT_CONSTANT ((gint)OSTREE_GPG_ERROR_REVOKED_KEY);
PRINT_CONSTANT (OSTREE_GPG_KEY_GVARIANT_STRING);
PRINT_CONSTANT ((gint)OSTREE_GPG_SIGNATURE_ATTR_EXP_TIMESTAMP);
PRINT_CONSTANT ((gint)OSTREE_GPG_SIGNATURE_ATTR_FINGERPRINT);
PRINT_CONSTANT ((gint)OSTREE_GPG_SIGNATURE_ATTR_FINGERPRINT_PRIMARY);
PRINT_CONSTANT ((gint)OSTREE_GPG_SIGNATURE_ATTR_HASH_ALGO_NAME);
PRINT_CONSTANT ((gint)OSTREE_GPG_SIGNATURE_ATTR_KEY_EXPIRED);
PRINT_CONSTANT ((gint)OSTREE_GPG_SIGNATURE_ATTR_KEY_EXP_TIMESTAMP);
PRINT_CONSTANT ((gint)OSTREE_GPG_SIGNATURE_ATTR_KEY_EXP_TIMESTAMP_PRIMARY);
PRINT_CONSTANT ((gint)OSTREE_GPG_SIGNATURE_ATTR_KEY_MISSING);
PRINT_CONSTANT ((gint)OSTREE_GPG_SIGNATURE_ATTR_KEY_REVOKED);
PRINT_CONSTANT ((gint)OSTREE_GPG_SIGNATURE_ATTR_PUBKEY_ALGO_NAME);
PRINT_CONSTANT ((gint)OSTREE_GPG_SIGNATURE_ATTR_SIG_EXPIRED);
PRINT_CONSTANT ((gint)OSTREE_GPG_SIGNATURE_ATTR_TIMESTAMP);
PRINT_CONSTANT ((gint)OSTREE_GPG_SIGNATURE_ATTR_USER_EMAIL);
PRINT_CONSTANT ((gint)OSTREE_GPG_SIGNATURE_ATTR_USER_NAME);
PRINT_CONSTANT ((gint)OSTREE_GPG_SIGNATURE_ATTR_VALID);
PRINT_CONSTANT ((guint)OSTREE_GPG_SIGNATURE_FORMAT_DEFAULT);
PRINT_CONSTANT (OSTREE_MAX_METADATA_SIZE);
PRINT_CONSTANT (OSTREE_MAX_METADATA_WARN_SIZE);
PRINT_CONSTANT (OSTREE_METADATA_KEY_BOOTABLE);
PRINT_CONSTANT (OSTREE_METADATA_KEY_LINUX);
PRINT_CONSTANT (OSTREE_META_KEY_DEPLOY_COLLECTION_ID);
PRINT_CONSTANT ((gint)OSTREE_OBJECT_TYPE_COMMIT);
PRINT_CONSTANT ((gint)OSTREE_OBJECT_TYPE_COMMIT_META);
PRINT_CONSTANT ((gint)OSTREE_OBJECT_TYPE_DIR_META);
PRINT_CONSTANT ((gint)OSTREE_OBJECT_TYPE_DIR_TREE);
PRINT_CONSTANT ((gint)OSTREE_OBJECT_TYPE_FILE);
PRINT_CONSTANT ((gint)OSTREE_OBJECT_TYPE_FILE_XATTRS);
PRINT_CONSTANT ((gint)OSTREE_OBJECT_TYPE_FILE_XATTRS_LINK);
PRINT_CONSTANT ((gint)OSTREE_OBJECT_TYPE_PAYLOAD_LINK);
PRINT_CONSTANT ((gint)OSTREE_OBJECT_TYPE_TOMBSTONE_COMMIT);
PRINT_CONSTANT (OSTREE_ORIGIN_TRANSIENT_GROUP);
PRINT_CONSTANT (OSTREE_PATH_BOOTED);
PRINT_CONSTANT ((gint)OSTREE_REPO_CHECKOUT_FILTER_ALLOW);
PRINT_CONSTANT ((gint)OSTREE_REPO_CHECKOUT_FILTER_SKIP);
PRINT_CONSTANT ((gint)OSTREE_REPO_CHECKOUT_MODE_NONE);
PRINT_CONSTANT ((gint)OSTREE_REPO_CHECKOUT_MODE_USER);
PRINT_CONSTANT ((gint)OSTREE_REPO_CHECKOUT_OVERWRITE_ADD_FILES);
PRINT_CONSTANT ((gint)OSTREE_REPO_CHECKOUT_OVERWRITE_NONE);
PRINT_CONSTANT ((gint)OSTREE_REPO_CHECKOUT_OVERWRITE_UNION_FILES);
PRINT_CONSTANT ((gint)OSTREE_REPO_CHECKOUT_OVERWRITE_UNION_IDENTICAL);
PRINT_CONSTANT ((gint)OSTREE_REPO_COMMIT_FILTER_ALLOW);
PRINT_CONSTANT ((gint)OSTREE_REPO_COMMIT_FILTER_SKIP);
PRINT_CONSTANT ((gint)OSTREE_REPO_COMMIT_ITER_RESULT_DIR);
PRINT_CONSTANT ((gint)OSTREE_REPO_COMMIT_ITER_RESULT_END);
PRINT_CONSTANT ((gint)OSTREE_REPO_COMMIT_ITER_RESULT_ERROR);
PRINT_CONSTANT ((gint)OSTREE_REPO_COMMIT_ITER_RESULT_FILE);
PRINT_CONSTANT ((guint)OSTREE_REPO_COMMIT_MODIFIER_FLAGS_CANONICAL_PERMISSIONS);
PRINT_CONSTANT ((guint)OSTREE_REPO_COMMIT_MODIFIER_FLAGS_CONSUME);
PRINT_CONSTANT ((guint)OSTREE_REPO_COMMIT_MODIFIER_FLAGS_DEVINO_CANONICAL);
PRINT_CONSTANT ((guint)OSTREE_REPO_COMMIT_MODIFIER_FLAGS_ERROR_ON_UNLABELED);
PRINT_CONSTANT ((guint)OSTREE_REPO_COMMIT_MODIFIER_FLAGS_GENERATE_SIZES);
PRINT_CONSTANT ((guint)OSTREE_REPO_COMMIT_MODIFIER_FLAGS_NONE);
PRINT_CONSTANT ((guint)OSTREE_REPO_COMMIT_MODIFIER_FLAGS_SKIP_XATTRS);
PRINT_CONSTANT ((guint)OSTREE_REPO_COMMIT_STATE_FSCK_PARTIAL);
PRINT_CONSTANT ((guint)OSTREE_REPO_COMMIT_STATE_NORMAL);
PRINT_CONSTANT ((guint)OSTREE_REPO_COMMIT_STATE_PARTIAL);
PRINT_CONSTANT ((guint)OSTREE_REPO_COMMIT_TRAVERSE_FLAG_COMMIT_ONLY);
PRINT_CONSTANT ((guint)OSTREE_REPO_COMMIT_TRAVERSE_FLAG_NONE);
PRINT_CONSTANT ((guint)OSTREE_REPO_LIST_OBJECTS_ALL);
PRINT_CONSTANT ((guint)OSTREE_REPO_LIST_OBJECTS_LOOSE);
PRINT_CONSTANT ((guint)OSTREE_REPO_LIST_OBJECTS_NO_PARENTS);
PRINT_CONSTANT ((guint)OSTREE_REPO_LIST_OBJECTS_PACKED);
PRINT_CONSTANT ((guint)OSTREE_REPO_LIST_REFS_EXT_ALIASES);
PRINT_CONSTANT ((guint)OSTREE_REPO_LIST_REFS_EXT_EXCLUDE_MIRRORS);
PRINT_CONSTANT ((guint)OSTREE_REPO_LIST_REFS_EXT_EXCLUDE_REMOTES);
PRINT_CONSTANT ((guint)OSTREE_REPO_LIST_REFS_EXT_NONE);
PRINT_CONSTANT ((gint)OSTREE_REPO_LOCK_EXCLUSIVE);
PRINT_CONSTANT ((gint)OSTREE_REPO_LOCK_SHARED);
PRINT_CONSTANT (OSTREE_REPO_METADATA_REF);
PRINT_CONSTANT ((gint)OSTREE_REPO_MODE_ARCHIVE);
PRINT_CONSTANT ((gint)OSTREE_REPO_MODE_ARCHIVE_Z2);
PRINT_CONSTANT ((gint)OSTREE_REPO_MODE_BARE);
PRINT_CONSTANT ((gint)OSTREE_REPO_MODE_BARE_SPLIT_XATTRS);
PRINT_CONSTANT ((gint)OSTREE_REPO_MODE_BARE_USER);
PRINT_CONSTANT ((gint)OSTREE_REPO_MODE_BARE_USER_ONLY);
PRINT_CONSTANT ((guint)OSTREE_REPO_PRUNE_FLAGS_COMMIT_ONLY);
PRINT_CONSTANT ((guint)OSTREE_REPO_PRUNE_FLAGS_NONE);
PRINT_CONSTANT ((guint)OSTREE_REPO_PRUNE_FLAGS_NO_PRUNE);
PRINT_CONSTANT ((guint)OSTREE_REPO_PRUNE_FLAGS_REFS_ONLY);
PRINT_CONSTANT ((guint)OSTREE_REPO_PULL_FLAGS_BAREUSERONLY_FILES);
PRINT_CONSTANT ((guint)OSTREE_REPO_PULL_FLAGS_COMMIT_ONLY);
PRINT_CONSTANT ((guint)OSTREE_REPO_PULL_FLAGS_MIRROR);
PRINT_CONSTANT ((guint)OSTREE_REPO_PULL_FLAGS_NONE);
PRINT_CONSTANT ((guint)OSTREE_REPO_PULL_FLAGS_TRUSTED_HTTP);
PRINT_CONSTANT ((guint)OSTREE_REPO_PULL_FLAGS_UNTRUSTED);
PRINT_CONSTANT ((gint)OSTREE_REPO_REMOTE_CHANGE_ADD);
PRINT_CONSTANT ((gint)OSTREE_REPO_REMOTE_CHANGE_ADD_IF_NOT_EXISTS);
PRINT_CONSTANT ((gint)OSTREE_REPO_REMOTE_CHANGE_DELETE);
PRINT_CONSTANT ((gint)OSTREE_REPO_REMOTE_CHANGE_DELETE_IF_EXISTS);
PRINT_CONSTANT ((gint)OSTREE_REPO_REMOTE_CHANGE_REPLACE);
PRINT_CONSTANT ((guint)OSTREE_REPO_RESOLVE_REV_EXT_LOCAL_ONLY);
PRINT_CONSTANT ((guint)OSTREE_REPO_RESOLVE_REV_EXT_NONE);
PRINT_CONSTANT ((guint)OSTREE_REPO_VERIFY_FLAGS_NONE);
PRINT_CONSTANT ((guint)OSTREE_REPO_VERIFY_FLAGS_NO_GPG);
PRINT_CONSTANT ((guint)OSTREE_REPO_VERIFY_FLAGS_NO_SIGNAPI);
PRINT_CONSTANT ((guint)OSTREE_SEPOLICY_RESTORECON_FLAGS_ALLOW_NOLABEL);
PRINT_CONSTANT ((guint)OSTREE_SEPOLICY_RESTORECON_FLAGS_KEEP_EXISTING);
PRINT_CONSTANT ((guint)OSTREE_SEPOLICY_RESTORECON_FLAGS_NONE);
PRINT_CONSTANT (OSTREE_SHA256_DIGEST_LEN);
PRINT_CONSTANT (OSTREE_SHA256_STRING_LEN);
PRINT_CONSTANT (OSTREE_SIGN_NAME_ED25519);
PRINT_CONSTANT ((gint)OSTREE_STATIC_DELTA_GENERATE_OPT_LOWLATENCY);
PRINT_CONSTANT ((gint)OSTREE_STATIC_DELTA_GENERATE_OPT_MAJOR);
PRINT_CONSTANT ((gint)OSTREE_STATIC_DELTA_INDEX_FLAGS_NONE);
PRINT_CONSTANT (OSTREE_SUMMARY_GVARIANT_STRING);
PRINT_CONSTANT (OSTREE_SUMMARY_SIG_GVARIANT_STRING);
PRINT_CONSTANT ((guint)OSTREE_SYSROOT_SIMPLE_WRITE_DEPLOYMENT_FLAGS_NONE);
PRINT_CONSTANT ((guint)OSTREE_SYSROOT_SIMPLE_WRITE_DEPLOYMENT_FLAGS_NOT_DEFAULT);
PRINT_CONSTANT ((guint)OSTREE_SYSROOT_SIMPLE_WRITE_DEPLOYMENT_FLAGS_NO_CLEAN);
PRINT_CONSTANT ((guint)OSTREE_SYSROOT_SIMPLE_WRITE_DEPLOYMENT_FLAGS_RETAIN);
PRINT_CONSTANT ((guint)OSTREE_SYSROOT_SIMPLE_WRITE_DEPLOYMENT_FLAGS_RETAIN_PENDING);
PRINT_CONSTANT ((guint)OSTREE_SYSROOT_SIMPLE_WRITE_DEPLOYMENT_FLAGS_RETAIN_ROLLBACK);
PRINT_CONSTANT ((guint)OSTREE_SYSROOT_UPGRADER_FLAGS_IGNORE_UNCONFIGURED);
PRINT_CONSTANT ((guint)OSTREE_SYSROOT_UPGRADER_FLAGS_STAGE);
PRINT_CONSTANT ((guint)OSTREE_SYSROOT_UPGRADER_PULL_FLAGS_ALLOW_OLDER);
PRINT_CONSTANT ((guint)OSTREE_SYSROOT_UPGRADER_PULL_FLAGS_NONE);
PRINT_CONSTANT ((guint)OSTREE_SYSROOT_UPGRADER_PULL_FLAGS_SYNTHETIC);
PRINT_CONSTANT (OSTREE_TIMESTAMP);
PRINT_CONSTANT (OSTREE_TREE_GVARIANT_STRING);
return 0;
int main() {
PRINT_CONSTANT((guint) OSTREE_CHECKSUM_FLAGS_CANONICAL_PERMISSIONS);
PRINT_CONSTANT((guint) OSTREE_CHECKSUM_FLAGS_IGNORE_XATTRS);
PRINT_CONSTANT((guint) OSTREE_CHECKSUM_FLAGS_NONE);
PRINT_CONSTANT(OSTREE_COMMIT_GVARIANT_STRING);
PRINT_CONSTANT(OSTREE_COMMIT_META_KEY_ARCHITECTURE);
PRINT_CONSTANT(OSTREE_COMMIT_META_KEY_COLLECTION_BINDING);
PRINT_CONSTANT(OSTREE_COMMIT_META_KEY_ENDOFLIFE);
PRINT_CONSTANT(OSTREE_COMMIT_META_KEY_ENDOFLIFE_REBASE);
PRINT_CONSTANT(OSTREE_COMMIT_META_KEY_REF_BINDING);
PRINT_CONSTANT(OSTREE_COMMIT_META_KEY_SOURCE_TITLE);
PRINT_CONSTANT(OSTREE_COMMIT_META_KEY_VERSION);
PRINT_CONSTANT((gint) OSTREE_DEPLOYMENT_UNLOCKED_DEVELOPMENT);
PRINT_CONSTANT((gint) OSTREE_DEPLOYMENT_UNLOCKED_HOTFIX);
PRINT_CONSTANT((gint) OSTREE_DEPLOYMENT_UNLOCKED_NONE);
PRINT_CONSTANT((gint) OSTREE_DEPLOYMENT_UNLOCKED_TRANSIENT);
PRINT_CONSTANT((guint) OSTREE_DIFF_FLAGS_IGNORE_XATTRS);
PRINT_CONSTANT((guint) OSTREE_DIFF_FLAGS_NONE);
PRINT_CONSTANT(OSTREE_DIRMETA_GVARIANT_STRING);
PRINT_CONSTANT(OSTREE_FILEMETA_GVARIANT_STRING);
PRINT_CONSTANT((gint) OSTREE_GPG_ERROR_EXPIRED_KEY);
PRINT_CONSTANT((gint) OSTREE_GPG_ERROR_EXPIRED_SIGNATURE);
PRINT_CONSTANT((gint) OSTREE_GPG_ERROR_INVALID_SIGNATURE);
PRINT_CONSTANT((gint) OSTREE_GPG_ERROR_MISSING_KEY);
PRINT_CONSTANT((gint) OSTREE_GPG_ERROR_NO_SIGNATURE);
PRINT_CONSTANT((gint) OSTREE_GPG_ERROR_REVOKED_KEY);
PRINT_CONSTANT(OSTREE_GPG_KEY_GVARIANT_STRING);
PRINT_CONSTANT((gint) OSTREE_GPG_SIGNATURE_ATTR_EXP_TIMESTAMP);
PRINT_CONSTANT((gint) OSTREE_GPG_SIGNATURE_ATTR_FINGERPRINT);
PRINT_CONSTANT((gint) OSTREE_GPG_SIGNATURE_ATTR_FINGERPRINT_PRIMARY);
PRINT_CONSTANT((gint) OSTREE_GPG_SIGNATURE_ATTR_HASH_ALGO_NAME);
PRINT_CONSTANT((gint) OSTREE_GPG_SIGNATURE_ATTR_KEY_EXPIRED);
PRINT_CONSTANT((gint) OSTREE_GPG_SIGNATURE_ATTR_KEY_EXP_TIMESTAMP);
PRINT_CONSTANT((gint) OSTREE_GPG_SIGNATURE_ATTR_KEY_EXP_TIMESTAMP_PRIMARY);
PRINT_CONSTANT((gint) OSTREE_GPG_SIGNATURE_ATTR_KEY_MISSING);
PRINT_CONSTANT((gint) OSTREE_GPG_SIGNATURE_ATTR_KEY_REVOKED);
PRINT_CONSTANT((gint) OSTREE_GPG_SIGNATURE_ATTR_PUBKEY_ALGO_NAME);
PRINT_CONSTANT((gint) OSTREE_GPG_SIGNATURE_ATTR_SIG_EXPIRED);
PRINT_CONSTANT((gint) OSTREE_GPG_SIGNATURE_ATTR_TIMESTAMP);
PRINT_CONSTANT((gint) OSTREE_GPG_SIGNATURE_ATTR_USER_EMAIL);
PRINT_CONSTANT((gint) OSTREE_GPG_SIGNATURE_ATTR_USER_NAME);
PRINT_CONSTANT((gint) OSTREE_GPG_SIGNATURE_ATTR_VALID);
PRINT_CONSTANT((guint) OSTREE_GPG_SIGNATURE_FORMAT_DEFAULT);
PRINT_CONSTANT(OSTREE_MAX_METADATA_SIZE);
PRINT_CONSTANT(OSTREE_MAX_METADATA_WARN_SIZE);
PRINT_CONSTANT(OSTREE_METADATA_KEY_BOOTABLE);
PRINT_CONSTANT(OSTREE_METADATA_KEY_LINUX);
PRINT_CONSTANT(OSTREE_META_KEY_DEPLOY_COLLECTION_ID);
PRINT_CONSTANT((gint) OSTREE_OBJECT_TYPE_COMMIT);
PRINT_CONSTANT((gint) OSTREE_OBJECT_TYPE_COMMIT_META);
PRINT_CONSTANT((gint) OSTREE_OBJECT_TYPE_DIR_META);
PRINT_CONSTANT((gint) OSTREE_OBJECT_TYPE_DIR_TREE);
PRINT_CONSTANT((gint) OSTREE_OBJECT_TYPE_FILE);
PRINT_CONSTANT((gint) OSTREE_OBJECT_TYPE_FILE_XATTRS);
PRINT_CONSTANT((gint) OSTREE_OBJECT_TYPE_FILE_XATTRS_LINK);
PRINT_CONSTANT((gint) OSTREE_OBJECT_TYPE_PAYLOAD_LINK);
PRINT_CONSTANT((gint) OSTREE_OBJECT_TYPE_TOMBSTONE_COMMIT);
PRINT_CONSTANT(OSTREE_ORIGIN_TRANSIENT_GROUP);
PRINT_CONSTANT(OSTREE_PATH_BOOTED);
PRINT_CONSTANT((gint) OSTREE_REPO_CHECKOUT_FILTER_ALLOW);
PRINT_CONSTANT((gint) OSTREE_REPO_CHECKOUT_FILTER_SKIP);
PRINT_CONSTANT((gint) OSTREE_REPO_CHECKOUT_MODE_NONE);
PRINT_CONSTANT((gint) OSTREE_REPO_CHECKOUT_MODE_USER);
PRINT_CONSTANT((gint) OSTREE_REPO_CHECKOUT_OVERWRITE_ADD_FILES);
PRINT_CONSTANT((gint) OSTREE_REPO_CHECKOUT_OVERWRITE_NONE);
PRINT_CONSTANT((gint) OSTREE_REPO_CHECKOUT_OVERWRITE_UNION_FILES);
PRINT_CONSTANT((gint) OSTREE_REPO_CHECKOUT_OVERWRITE_UNION_IDENTICAL);
PRINT_CONSTANT((gint) OSTREE_REPO_COMMIT_FILTER_ALLOW);
PRINT_CONSTANT((gint) OSTREE_REPO_COMMIT_FILTER_SKIP);
PRINT_CONSTANT((gint) OSTREE_REPO_COMMIT_ITER_RESULT_DIR);
PRINT_CONSTANT((gint) OSTREE_REPO_COMMIT_ITER_RESULT_END);
PRINT_CONSTANT((gint) OSTREE_REPO_COMMIT_ITER_RESULT_ERROR);
PRINT_CONSTANT((gint) OSTREE_REPO_COMMIT_ITER_RESULT_FILE);
PRINT_CONSTANT((guint) OSTREE_REPO_COMMIT_MODIFIER_FLAGS_CANONICAL_PERMISSIONS);
PRINT_CONSTANT((guint) OSTREE_REPO_COMMIT_MODIFIER_FLAGS_CONSUME);
PRINT_CONSTANT((guint) OSTREE_REPO_COMMIT_MODIFIER_FLAGS_DEVINO_CANONICAL);
PRINT_CONSTANT((guint) OSTREE_REPO_COMMIT_MODIFIER_FLAGS_ERROR_ON_UNLABELED);
PRINT_CONSTANT((guint) OSTREE_REPO_COMMIT_MODIFIER_FLAGS_GENERATE_SIZES);
PRINT_CONSTANT((guint) OSTREE_REPO_COMMIT_MODIFIER_FLAGS_NONE);
PRINT_CONSTANT((guint) OSTREE_REPO_COMMIT_MODIFIER_FLAGS_SELINUX_LABEL_V1);
PRINT_CONSTANT((guint) OSTREE_REPO_COMMIT_MODIFIER_FLAGS_SKIP_XATTRS);
PRINT_CONSTANT((guint) OSTREE_REPO_COMMIT_STATE_FSCK_PARTIAL);
PRINT_CONSTANT((guint) OSTREE_REPO_COMMIT_STATE_NORMAL);
PRINT_CONSTANT((guint) OSTREE_REPO_COMMIT_STATE_PARTIAL);
PRINT_CONSTANT((guint) OSTREE_REPO_COMMIT_TRAVERSE_FLAG_COMMIT_ONLY);
PRINT_CONSTANT((guint) OSTREE_REPO_COMMIT_TRAVERSE_FLAG_NONE);
PRINT_CONSTANT((guint) OSTREE_REPO_LIST_OBJECTS_ALL);
PRINT_CONSTANT((guint) OSTREE_REPO_LIST_OBJECTS_LOOSE);
PRINT_CONSTANT((guint) OSTREE_REPO_LIST_OBJECTS_NO_PARENTS);
PRINT_CONSTANT((guint) OSTREE_REPO_LIST_OBJECTS_PACKED);
PRINT_CONSTANT((guint) OSTREE_REPO_LIST_REFS_EXT_ALIASES);
PRINT_CONSTANT((guint) OSTREE_REPO_LIST_REFS_EXT_EXCLUDE_MIRRORS);
PRINT_CONSTANT((guint) OSTREE_REPO_LIST_REFS_EXT_EXCLUDE_REMOTES);
PRINT_CONSTANT((guint) OSTREE_REPO_LIST_REFS_EXT_NONE);
PRINT_CONSTANT((gint) OSTREE_REPO_LOCK_EXCLUSIVE);
PRINT_CONSTANT((gint) OSTREE_REPO_LOCK_SHARED);
PRINT_CONSTANT(OSTREE_REPO_METADATA_REF);
PRINT_CONSTANT((gint) OSTREE_REPO_MODE_ARCHIVE);
PRINT_CONSTANT((gint) OSTREE_REPO_MODE_ARCHIVE_Z2);
PRINT_CONSTANT((gint) OSTREE_REPO_MODE_BARE);
PRINT_CONSTANT((gint) OSTREE_REPO_MODE_BARE_SPLIT_XATTRS);
PRINT_CONSTANT((gint) OSTREE_REPO_MODE_BARE_USER);
PRINT_CONSTANT((gint) OSTREE_REPO_MODE_BARE_USER_ONLY);
PRINT_CONSTANT((guint) OSTREE_REPO_PRUNE_FLAGS_COMMIT_ONLY);
PRINT_CONSTANT((guint) OSTREE_REPO_PRUNE_FLAGS_NONE);
PRINT_CONSTANT((guint) OSTREE_REPO_PRUNE_FLAGS_NO_PRUNE);
PRINT_CONSTANT((guint) OSTREE_REPO_PRUNE_FLAGS_REFS_ONLY);
PRINT_CONSTANT((guint) OSTREE_REPO_PULL_FLAGS_BAREUSERONLY_FILES);
PRINT_CONSTANT((guint) OSTREE_REPO_PULL_FLAGS_COMMIT_ONLY);
PRINT_CONSTANT((guint) OSTREE_REPO_PULL_FLAGS_MIRROR);
PRINT_CONSTANT((guint) OSTREE_REPO_PULL_FLAGS_NONE);
PRINT_CONSTANT((guint) OSTREE_REPO_PULL_FLAGS_TRUSTED_HTTP);
PRINT_CONSTANT((guint) OSTREE_REPO_PULL_FLAGS_UNTRUSTED);
PRINT_CONSTANT((gint) OSTREE_REPO_REMOTE_CHANGE_ADD);
PRINT_CONSTANT((gint) OSTREE_REPO_REMOTE_CHANGE_ADD_IF_NOT_EXISTS);
PRINT_CONSTANT((gint) OSTREE_REPO_REMOTE_CHANGE_DELETE);
PRINT_CONSTANT((gint) OSTREE_REPO_REMOTE_CHANGE_DELETE_IF_EXISTS);
PRINT_CONSTANT((gint) OSTREE_REPO_REMOTE_CHANGE_REPLACE);
PRINT_CONSTANT((guint) OSTREE_REPO_RESOLVE_REV_EXT_LOCAL_ONLY);
PRINT_CONSTANT((guint) OSTREE_REPO_RESOLVE_REV_EXT_NONE);
PRINT_CONSTANT((guint) OSTREE_REPO_VERIFY_FLAGS_NONE);
PRINT_CONSTANT((guint) OSTREE_REPO_VERIFY_FLAGS_NO_GPG);
PRINT_CONSTANT((guint) OSTREE_REPO_VERIFY_FLAGS_NO_SIGNAPI);
PRINT_CONSTANT((guint) OSTREE_SEPOLICY_RESTORECON_FLAGS_ALLOW_NOLABEL);
PRINT_CONSTANT((guint) OSTREE_SEPOLICY_RESTORECON_FLAGS_KEEP_EXISTING);
PRINT_CONSTANT((guint) OSTREE_SEPOLICY_RESTORECON_FLAGS_NONE);
PRINT_CONSTANT(OSTREE_SHA256_DIGEST_LEN);
PRINT_CONSTANT(OSTREE_SHA256_STRING_LEN);
PRINT_CONSTANT(OSTREE_SIGN_NAME_ED25519);
PRINT_CONSTANT((gint) OSTREE_STATIC_DELTA_GENERATE_OPT_LOWLATENCY);
PRINT_CONSTANT((gint) OSTREE_STATIC_DELTA_GENERATE_OPT_MAJOR);
PRINT_CONSTANT((gint) OSTREE_STATIC_DELTA_INDEX_FLAGS_NONE);
PRINT_CONSTANT(OSTREE_SUMMARY_GVARIANT_STRING);
PRINT_CONSTANT(OSTREE_SUMMARY_SIG_GVARIANT_STRING);
PRINT_CONSTANT((guint) OSTREE_SYSROOT_SIMPLE_WRITE_DEPLOYMENT_FLAGS_NONE);
PRINT_CONSTANT((guint) OSTREE_SYSROOT_SIMPLE_WRITE_DEPLOYMENT_FLAGS_NOT_DEFAULT);
PRINT_CONSTANT((guint) OSTREE_SYSROOT_SIMPLE_WRITE_DEPLOYMENT_FLAGS_NO_CLEAN);
PRINT_CONSTANT((guint) OSTREE_SYSROOT_SIMPLE_WRITE_DEPLOYMENT_FLAGS_RETAIN);
PRINT_CONSTANT((guint) OSTREE_SYSROOT_SIMPLE_WRITE_DEPLOYMENT_FLAGS_RETAIN_PENDING);
PRINT_CONSTANT((guint) OSTREE_SYSROOT_SIMPLE_WRITE_DEPLOYMENT_FLAGS_RETAIN_ROLLBACK);
PRINT_CONSTANT((guint) OSTREE_SYSROOT_UPGRADER_FLAGS_IGNORE_UNCONFIGURED);
PRINT_CONSTANT((guint) OSTREE_SYSROOT_UPGRADER_FLAGS_STAGE);
PRINT_CONSTANT((guint) OSTREE_SYSROOT_UPGRADER_PULL_FLAGS_ALLOW_OLDER);
PRINT_CONSTANT((guint) OSTREE_SYSROOT_UPGRADER_PULL_FLAGS_NONE);
PRINT_CONSTANT((guint) OSTREE_SYSROOT_UPGRADER_PULL_FLAGS_SYNTHETIC);
PRINT_CONSTANT(OSTREE_TIMESTAMP);
PRINT_CONSTANT(OSTREE_TREE_GVARIANT_STRING);
return 0;
}

View File

@ -6,113 +6,60 @@
#include <stdalign.h>
#include <stdio.h>
int
main ()
{
printf ("%s;%zu;%zu\n", "OstreeAsyncProgressClass", sizeof (OstreeAsyncProgressClass),
alignof (OstreeAsyncProgressClass));
printf ("%s;%zu;%zu\n", "OstreeChecksumFlags", sizeof (OstreeChecksumFlags),
alignof (OstreeChecksumFlags));
printf ("%s;%zu;%zu\n", "OstreeCollectionRef", sizeof (OstreeCollectionRef),
alignof (OstreeCollectionRef));
printf ("%s;%zu;%zu\n", "OstreeCollectionRefv", sizeof (OstreeCollectionRefv),
alignof (OstreeCollectionRefv));
printf ("%s;%zu;%zu\n", "OstreeCommitSizesEntry", sizeof (OstreeCommitSizesEntry),
alignof (OstreeCommitSizesEntry));
printf ("%s;%zu;%zu\n", "OstreeContentWriterClass", sizeof (OstreeContentWriterClass),
alignof (OstreeContentWriterClass));
printf ("%s;%zu;%zu\n", "OstreeDeploymentUnlockedState", sizeof (OstreeDeploymentUnlockedState),
alignof (OstreeDeploymentUnlockedState));
printf ("%s;%zu;%zu\n", "OstreeDiffDirsOptions", sizeof (OstreeDiffDirsOptions),
alignof (OstreeDiffDirsOptions));
printf ("%s;%zu;%zu\n", "OstreeDiffFlags", sizeof (OstreeDiffFlags), alignof (OstreeDiffFlags));
printf ("%s;%zu;%zu\n", "OstreeDiffItem", sizeof (OstreeDiffItem), alignof (OstreeDiffItem));
printf ("%s;%zu;%zu\n", "OstreeGpgError", sizeof (OstreeGpgError), alignof (OstreeGpgError));
printf ("%s;%zu;%zu\n", "OstreeGpgSignatureAttr", sizeof (OstreeGpgSignatureAttr),
alignof (OstreeGpgSignatureAttr));
printf ("%s;%zu;%zu\n", "OstreeGpgSignatureFormatFlags", sizeof (OstreeGpgSignatureFormatFlags),
alignof (OstreeGpgSignatureFormatFlags));
printf ("%s;%zu;%zu\n", "OstreeMutableTreeClass", sizeof (OstreeMutableTreeClass),
alignof (OstreeMutableTreeClass));
printf ("%s;%zu;%zu\n", "OstreeMutableTreeIter", sizeof (OstreeMutableTreeIter),
alignof (OstreeMutableTreeIter));
printf ("%s;%zu;%zu\n", "OstreeObjectType", sizeof (OstreeObjectType),
alignof (OstreeObjectType));
printf ("%s;%zu;%zu\n", "OstreeRepoCheckoutAtOptions", sizeof (OstreeRepoCheckoutAtOptions),
alignof (OstreeRepoCheckoutAtOptions));
printf ("%s;%zu;%zu\n", "OstreeRepoCheckoutFilterResult", sizeof (OstreeRepoCheckoutFilterResult),
alignof (OstreeRepoCheckoutFilterResult));
printf ("%s;%zu;%zu\n", "OstreeRepoCheckoutMode", sizeof (OstreeRepoCheckoutMode),
alignof (OstreeRepoCheckoutMode));
printf ("%s;%zu;%zu\n", "OstreeRepoCheckoutOverwriteMode",
sizeof (OstreeRepoCheckoutOverwriteMode), alignof (OstreeRepoCheckoutOverwriteMode));
printf ("%s;%zu;%zu\n", "OstreeRepoCommitFilterResult", sizeof (OstreeRepoCommitFilterResult),
alignof (OstreeRepoCommitFilterResult));
printf ("%s;%zu;%zu\n", "OstreeRepoCommitIterResult", sizeof (OstreeRepoCommitIterResult),
alignof (OstreeRepoCommitIterResult));
printf ("%s;%zu;%zu\n", "OstreeRepoCommitModifierFlags", sizeof (OstreeRepoCommitModifierFlags),
alignof (OstreeRepoCommitModifierFlags));
printf ("%s;%zu;%zu\n", "OstreeRepoCommitState", sizeof (OstreeRepoCommitState),
alignof (OstreeRepoCommitState));
printf ("%s;%zu;%zu\n", "OstreeRepoCommitTraverseFlags", sizeof (OstreeRepoCommitTraverseFlags),
alignof (OstreeRepoCommitTraverseFlags));
printf ("%s;%zu;%zu\n", "OstreeRepoCommitTraverseIter", sizeof (OstreeRepoCommitTraverseIter),
alignof (OstreeRepoCommitTraverseIter));
printf ("%s;%zu;%zu\n", "OstreeRepoFileClass", sizeof (OstreeRepoFileClass),
alignof (OstreeRepoFileClass));
printf ("%s;%zu;%zu\n", "OstreeRepoFinderAvahiClass", sizeof (OstreeRepoFinderAvahiClass),
alignof (OstreeRepoFinderAvahiClass));
printf ("%s;%zu;%zu\n", "OstreeRepoFinderConfigClass", sizeof (OstreeRepoFinderConfigClass),
alignof (OstreeRepoFinderConfigClass));
printf ("%s;%zu;%zu\n", "OstreeRepoFinderInterface", sizeof (OstreeRepoFinderInterface),
alignof (OstreeRepoFinderInterface));
printf ("%s;%zu;%zu\n", "OstreeRepoFinderMountClass", sizeof (OstreeRepoFinderMountClass),
alignof (OstreeRepoFinderMountClass));
printf ("%s;%zu;%zu\n", "OstreeRepoFinderOverrideClass", sizeof (OstreeRepoFinderOverrideClass),
alignof (OstreeRepoFinderOverrideClass));
printf ("%s;%zu;%zu\n", "OstreeRepoFinderResult", sizeof (OstreeRepoFinderResult),
alignof (OstreeRepoFinderResult));
printf ("%s;%zu;%zu\n", "OstreeRepoFinderResultv", sizeof (OstreeRepoFinderResultv),
alignof (OstreeRepoFinderResultv));
printf ("%s;%zu;%zu\n", "OstreeRepoListObjectsFlags", sizeof (OstreeRepoListObjectsFlags),
alignof (OstreeRepoListObjectsFlags));
printf ("%s;%zu;%zu\n", "OstreeRepoListRefsExtFlags", sizeof (OstreeRepoListRefsExtFlags),
alignof (OstreeRepoListRefsExtFlags));
printf ("%s;%zu;%zu\n", "OstreeRepoLockType", sizeof (OstreeRepoLockType),
alignof (OstreeRepoLockType));
printf ("%s;%zu;%zu\n", "OstreeRepoMode", sizeof (OstreeRepoMode), alignof (OstreeRepoMode));
printf ("%s;%zu;%zu\n", "OstreeRepoPruneFlags", sizeof (OstreeRepoPruneFlags),
alignof (OstreeRepoPruneFlags));
printf ("%s;%zu;%zu\n", "OstreeRepoPruneOptions", sizeof (OstreeRepoPruneOptions),
alignof (OstreeRepoPruneOptions));
printf ("%s;%zu;%zu\n", "OstreeRepoPullFlags", sizeof (OstreeRepoPullFlags),
alignof (OstreeRepoPullFlags));
printf ("%s;%zu;%zu\n", "OstreeRepoRemoteChange", sizeof (OstreeRepoRemoteChange),
alignof (OstreeRepoRemoteChange));
printf ("%s;%zu;%zu\n", "OstreeRepoResolveRevExtFlags", sizeof (OstreeRepoResolveRevExtFlags),
alignof (OstreeRepoResolveRevExtFlags));
printf ("%s;%zu;%zu\n", "OstreeRepoTransactionStats", sizeof (OstreeRepoTransactionStats),
alignof (OstreeRepoTransactionStats));
printf ("%s;%zu;%zu\n", "OstreeRepoVerifyFlags", sizeof (OstreeRepoVerifyFlags),
alignof (OstreeRepoVerifyFlags));
printf ("%s;%zu;%zu\n", "OstreeSePolicyRestoreconFlags", sizeof (OstreeSePolicyRestoreconFlags),
alignof (OstreeSePolicyRestoreconFlags));
printf ("%s;%zu;%zu\n", "OstreeSignInterface", sizeof (OstreeSignInterface),
alignof (OstreeSignInterface));
printf ("%s;%zu;%zu\n", "OstreeStaticDeltaGenerateOpt", sizeof (OstreeStaticDeltaGenerateOpt),
alignof (OstreeStaticDeltaGenerateOpt));
printf ("%s;%zu;%zu\n", "OstreeStaticDeltaIndexFlags", sizeof (OstreeStaticDeltaIndexFlags),
alignof (OstreeStaticDeltaIndexFlags));
printf ("%s;%zu;%zu\n", "OstreeSysrootDeployTreeOpts", sizeof (OstreeSysrootDeployTreeOpts),
alignof (OstreeSysrootDeployTreeOpts));
printf ("%s;%zu;%zu\n", "OstreeSysrootSimpleWriteDeploymentFlags",
sizeof (OstreeSysrootSimpleWriteDeploymentFlags),
alignof (OstreeSysrootSimpleWriteDeploymentFlags));
printf ("%s;%zu;%zu\n", "OstreeSysrootUpgraderFlags", sizeof (OstreeSysrootUpgraderFlags),
alignof (OstreeSysrootUpgraderFlags));
printf ("%s;%zu;%zu\n", "OstreeSysrootUpgraderPullFlags", sizeof (OstreeSysrootUpgraderPullFlags),
alignof (OstreeSysrootUpgraderPullFlags));
printf ("%s;%zu;%zu\n", "OstreeSysrootWriteDeploymentsOpts",
sizeof (OstreeSysrootWriteDeploymentsOpts), alignof (OstreeSysrootWriteDeploymentsOpts));
return 0;
int main() {
printf("%s;%zu;%zu\n", "OstreeAsyncProgressClass", sizeof(OstreeAsyncProgressClass), alignof(OstreeAsyncProgressClass));
printf("%s;%zu;%zu\n", "OstreeChecksumFlags", sizeof(OstreeChecksumFlags), alignof(OstreeChecksumFlags));
printf("%s;%zu;%zu\n", "OstreeCollectionRef", sizeof(OstreeCollectionRef), alignof(OstreeCollectionRef));
printf("%s;%zu;%zu\n", "OstreeCollectionRefv", sizeof(OstreeCollectionRefv), alignof(OstreeCollectionRefv));
printf("%s;%zu;%zu\n", "OstreeCommitSizesEntry", sizeof(OstreeCommitSizesEntry), alignof(OstreeCommitSizesEntry));
printf("%s;%zu;%zu\n", "OstreeContentWriterClass", sizeof(OstreeContentWriterClass), alignof(OstreeContentWriterClass));
printf("%s;%zu;%zu\n", "OstreeDeploymentUnlockedState", sizeof(OstreeDeploymentUnlockedState), alignof(OstreeDeploymentUnlockedState));
printf("%s;%zu;%zu\n", "OstreeDiffDirsOptions", sizeof(OstreeDiffDirsOptions), alignof(OstreeDiffDirsOptions));
printf("%s;%zu;%zu\n", "OstreeDiffFlags", sizeof(OstreeDiffFlags), alignof(OstreeDiffFlags));
printf("%s;%zu;%zu\n", "OstreeDiffItem", sizeof(OstreeDiffItem), alignof(OstreeDiffItem));
printf("%s;%zu;%zu\n", "OstreeGpgError", sizeof(OstreeGpgError), alignof(OstreeGpgError));
printf("%s;%zu;%zu\n", "OstreeGpgSignatureAttr", sizeof(OstreeGpgSignatureAttr), alignof(OstreeGpgSignatureAttr));
printf("%s;%zu;%zu\n", "OstreeGpgSignatureFormatFlags", sizeof(OstreeGpgSignatureFormatFlags), alignof(OstreeGpgSignatureFormatFlags));
printf("%s;%zu;%zu\n", "OstreeMutableTreeClass", sizeof(OstreeMutableTreeClass), alignof(OstreeMutableTreeClass));
printf("%s;%zu;%zu\n", "OstreeMutableTreeIter", sizeof(OstreeMutableTreeIter), alignof(OstreeMutableTreeIter));
printf("%s;%zu;%zu\n", "OstreeObjectType", sizeof(OstreeObjectType), alignof(OstreeObjectType));
printf("%s;%zu;%zu\n", "OstreeRepoCheckoutAtOptions", sizeof(OstreeRepoCheckoutAtOptions), alignof(OstreeRepoCheckoutAtOptions));
printf("%s;%zu;%zu\n", "OstreeRepoCheckoutFilterResult", sizeof(OstreeRepoCheckoutFilterResult), alignof(OstreeRepoCheckoutFilterResult));
printf("%s;%zu;%zu\n", "OstreeRepoCheckoutMode", sizeof(OstreeRepoCheckoutMode), alignof(OstreeRepoCheckoutMode));
printf("%s;%zu;%zu\n", "OstreeRepoCheckoutOverwriteMode", sizeof(OstreeRepoCheckoutOverwriteMode), alignof(OstreeRepoCheckoutOverwriteMode));
printf("%s;%zu;%zu\n", "OstreeRepoCommitFilterResult", sizeof(OstreeRepoCommitFilterResult), alignof(OstreeRepoCommitFilterResult));
printf("%s;%zu;%zu\n", "OstreeRepoCommitIterResult", sizeof(OstreeRepoCommitIterResult), alignof(OstreeRepoCommitIterResult));
printf("%s;%zu;%zu\n", "OstreeRepoCommitModifierFlags", sizeof(OstreeRepoCommitModifierFlags), alignof(OstreeRepoCommitModifierFlags));
printf("%s;%zu;%zu\n", "OstreeRepoCommitState", sizeof(OstreeRepoCommitState), alignof(OstreeRepoCommitState));
printf("%s;%zu;%zu\n", "OstreeRepoCommitTraverseFlags", sizeof(OstreeRepoCommitTraverseFlags), alignof(OstreeRepoCommitTraverseFlags));
printf("%s;%zu;%zu\n", "OstreeRepoCommitTraverseIter", sizeof(OstreeRepoCommitTraverseIter), alignof(OstreeRepoCommitTraverseIter));
printf("%s;%zu;%zu\n", "OstreeRepoFileClass", sizeof(OstreeRepoFileClass), alignof(OstreeRepoFileClass));
printf("%s;%zu;%zu\n", "OstreeRepoFinderAvahiClass", sizeof(OstreeRepoFinderAvahiClass), alignof(OstreeRepoFinderAvahiClass));
printf("%s;%zu;%zu\n", "OstreeRepoFinderConfigClass", sizeof(OstreeRepoFinderConfigClass), alignof(OstreeRepoFinderConfigClass));
printf("%s;%zu;%zu\n", "OstreeRepoFinderInterface", sizeof(OstreeRepoFinderInterface), alignof(OstreeRepoFinderInterface));
printf("%s;%zu;%zu\n", "OstreeRepoFinderMountClass", sizeof(OstreeRepoFinderMountClass), alignof(OstreeRepoFinderMountClass));
printf("%s;%zu;%zu\n", "OstreeRepoFinderOverrideClass", sizeof(OstreeRepoFinderOverrideClass), alignof(OstreeRepoFinderOverrideClass));
printf("%s;%zu;%zu\n", "OstreeRepoFinderResult", sizeof(OstreeRepoFinderResult), alignof(OstreeRepoFinderResult));
printf("%s;%zu;%zu\n", "OstreeRepoFinderResultv", sizeof(OstreeRepoFinderResultv), alignof(OstreeRepoFinderResultv));
printf("%s;%zu;%zu\n", "OstreeRepoListObjectsFlags", sizeof(OstreeRepoListObjectsFlags), alignof(OstreeRepoListObjectsFlags));
printf("%s;%zu;%zu\n", "OstreeRepoListRefsExtFlags", sizeof(OstreeRepoListRefsExtFlags), alignof(OstreeRepoListRefsExtFlags));
printf("%s;%zu;%zu\n", "OstreeRepoLockType", sizeof(OstreeRepoLockType), alignof(OstreeRepoLockType));
printf("%s;%zu;%zu\n", "OstreeRepoMode", sizeof(OstreeRepoMode), alignof(OstreeRepoMode));
printf("%s;%zu;%zu\n", "OstreeRepoPruneFlags", sizeof(OstreeRepoPruneFlags), alignof(OstreeRepoPruneFlags));
printf("%s;%zu;%zu\n", "OstreeRepoPruneOptions", sizeof(OstreeRepoPruneOptions), alignof(OstreeRepoPruneOptions));
printf("%s;%zu;%zu\n", "OstreeRepoPullFlags", sizeof(OstreeRepoPullFlags), alignof(OstreeRepoPullFlags));
printf("%s;%zu;%zu\n", "OstreeRepoRemoteChange", sizeof(OstreeRepoRemoteChange), alignof(OstreeRepoRemoteChange));
printf("%s;%zu;%zu\n", "OstreeRepoResolveRevExtFlags", sizeof(OstreeRepoResolveRevExtFlags), alignof(OstreeRepoResolveRevExtFlags));
printf("%s;%zu;%zu\n", "OstreeRepoTransactionStats", sizeof(OstreeRepoTransactionStats), alignof(OstreeRepoTransactionStats));
printf("%s;%zu;%zu\n", "OstreeRepoVerifyFlags", sizeof(OstreeRepoVerifyFlags), alignof(OstreeRepoVerifyFlags));
printf("%s;%zu;%zu\n", "OstreeSePolicyRestoreconFlags", sizeof(OstreeSePolicyRestoreconFlags), alignof(OstreeSePolicyRestoreconFlags));
printf("%s;%zu;%zu\n", "OstreeSignInterface", sizeof(OstreeSignInterface), alignof(OstreeSignInterface));
printf("%s;%zu;%zu\n", "OstreeStaticDeltaGenerateOpt", sizeof(OstreeStaticDeltaGenerateOpt), alignof(OstreeStaticDeltaGenerateOpt));
printf("%s;%zu;%zu\n", "OstreeStaticDeltaIndexFlags", sizeof(OstreeStaticDeltaIndexFlags), alignof(OstreeStaticDeltaIndexFlags));
printf("%s;%zu;%zu\n", "OstreeSysrootDeployTreeOpts", sizeof(OstreeSysrootDeployTreeOpts), alignof(OstreeSysrootDeployTreeOpts));
printf("%s;%zu;%zu\n", "OstreeSysrootSimpleWriteDeploymentFlags", sizeof(OstreeSysrootSimpleWriteDeploymentFlags), alignof(OstreeSysrootSimpleWriteDeploymentFlags));
printf("%s;%zu;%zu\n", "OstreeSysrootUpgraderFlags", sizeof(OstreeSysrootUpgraderFlags), alignof(OstreeSysrootUpgraderFlags));
printf("%s;%zu;%zu\n", "OstreeSysrootUpgraderPullFlags", sizeof(OstreeSysrootUpgraderPullFlags), alignof(OstreeSysrootUpgraderPullFlags));
printf("%s;%zu;%zu\n", "OstreeSysrootWriteDeploymentsOpts", sizeof(OstreeSysrootWriteDeploymentsOpts), alignof(OstreeSysrootWriteDeploymentsOpts));
return 0;
}

View File

@ -30,7 +30,7 @@ fn list_repo_objects() {
commit_cnt += 1;
}
x => {
panic!("unexpected object type {}", x);
panic!("unexpected object type {:?}", x);
}
}
}