conf: add some more loose types
This commit is contained in:
parent
7f8f32e4d0
commit
6a86340e9f
|
|
@ -27,6 +27,11 @@ generate = [
|
|||
"OSTree.RepoCheckoutFilterResult",
|
||||
"OSTree.RepoCheckoutMode",
|
||||
"OSTree.RepoCheckoutOverwriteMode",
|
||||
"OSTree.RepoCommitFilterResult",
|
||||
"OSTree.RepoCommitFilter",
|
||||
"OSTree.RepoCommitIterResult",
|
||||
"OSTree.RepoCommitModifierFlags",
|
||||
"OSTree.RepoCommitTraverseFlags",
|
||||
"OSTree.RepoCommitModifier",
|
||||
"OSTree.RepoCommitState",
|
||||
"OSTree.RepoDevInoCache",
|
||||
|
|
@ -36,6 +41,7 @@ generate = [
|
|||
"OSTree.RepoFinderConfig",
|
||||
"OSTree.RepoFinderMount",
|
||||
"OSTree.RepoFinderOverride",
|
||||
"OSTree.RepoListObjectsFlags",
|
||||
"OSTree.RepoListRefsExtFlags",
|
||||
"OSTree.RepoMode",
|
||||
"OSTree.RepoPruneFlags",
|
||||
|
|
@ -51,18 +57,23 @@ generate = [
|
|||
"OSTree.SysrootUpgrader",
|
||||
"OSTree.SysrootUpgraderFlags",
|
||||
"OSTree.SysrootUpgraderPullFlags",
|
||||
|
||||
]
|
||||
|
||||
manual = [
|
||||
# types from glib/gio we need
|
||||
"Gio.AsyncReadyCallback",
|
||||
"Gio.AsyncResult",
|
||||
"Gio.Cancellable",
|
||||
"Gio.File",
|
||||
"Gio.FileInfo",
|
||||
"Gio.FileQueryInfoFlags",
|
||||
"Gio.FilterInputStream",
|
||||
"Gio.InputStream",
|
||||
"Gio.VolumeMonitor",
|
||||
"GLib.Bytes",
|
||||
"GLib.Checksum",
|
||||
"GLib.DestroyNotify",
|
||||
"GLib.Error",
|
||||
"GLib.KeyFile",
|
||||
"GLib.MainContext",
|
||||
|
|
@ -71,6 +82,7 @@ manual = [
|
|||
"GLib.Variant",
|
||||
"GLib.VariantType",
|
||||
|
||||
# types implemented by hand
|
||||
"OSTree.RepoCheckoutAtOptions",
|
||||
"OSTree.RepoCheckoutFilter",
|
||||
]
|
||||
|
|
@ -78,6 +90,26 @@ manual = [
|
|||
ignore = [
|
||||
# only used for the already-deprecated checkout_tree_at function
|
||||
"OSTree.RepoCheckoutOptions",
|
||||
# types for zero-terminated arrays we probably don't want
|
||||
"OSTree.CollectionRefv",
|
||||
"OSTree.RepoFinderResultv",
|
||||
# not part of the public interface, as far as I can tell
|
||||
"OSTree.Bootloader",
|
||||
"OSTree.BootloaderGrub2",
|
||||
"OSTree.BootloaderInterface",
|
||||
"OSTree.BootloaderSyslinux",
|
||||
"OSTree.BootloaderUboot",
|
||||
"OSTree.ChecksumInputStream",
|
||||
"OSTree.ChecksumInputStreamBuilder",
|
||||
"OSTree.CmdPrivateVTable",
|
||||
"OSTree.GpgVerifier",
|
||||
"OSTree.LibarchiveInputStream",
|
||||
"OSTree.LzmaCompressor",
|
||||
"OSTree.LzmaDecompressor",
|
||||
"OSTree.RollsumMatches",
|
||||
# builders we don't want
|
||||
"OSTree.RepoBuilder",
|
||||
"OSTree.SysrootBuilder",
|
||||
]
|
||||
|
||||
[crate_name_overrides]
|
||||
|
|
|
|||
|
|
@ -383,6 +383,100 @@ impl FromGlib<ostree_sys::OstreeRepoCheckoutOverwriteMode> for RepoCheckoutOverw
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
|
||||
#[derive(Clone, Copy)]
|
||||
pub enum RepoCommitFilterResult {
|
||||
Allow,
|
||||
Skip,
|
||||
#[doc(hidden)]
|
||||
__Unknown(i32),
|
||||
}
|
||||
|
||||
impl fmt::Display for RepoCommitFilterResult {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(f, "RepoCommitFilterResult::{}", match *self {
|
||||
RepoCommitFilterResult::Allow => "Allow",
|
||||
RepoCommitFilterResult::Skip => "Skip",
|
||||
_ => "Unknown",
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl ToGlib for RepoCommitFilterResult {
|
||||
type GlibType = ostree_sys::OstreeRepoCommitFilterResult;
|
||||
|
||||
fn to_glib(&self) -> ostree_sys::OstreeRepoCommitFilterResult {
|
||||
match *self {
|
||||
RepoCommitFilterResult::Allow => ostree_sys::OSTREE_REPO_COMMIT_FILTER_ALLOW,
|
||||
RepoCommitFilterResult::Skip => ostree_sys::OSTREE_REPO_COMMIT_FILTER_SKIP,
|
||||
RepoCommitFilterResult::__Unknown(value) => value
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl FromGlib<ostree_sys::OstreeRepoCommitFilterResult> for RepoCommitFilterResult {
|
||||
fn from_glib(value: ostree_sys::OstreeRepoCommitFilterResult) -> Self {
|
||||
match value {
|
||||
0 => RepoCommitFilterResult::Allow,
|
||||
1 => RepoCommitFilterResult::Skip,
|
||||
value => RepoCommitFilterResult::__Unknown(value),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
|
||||
#[derive(Clone, Copy)]
|
||||
pub enum RepoCommitIterResult {
|
||||
Error,
|
||||
End,
|
||||
File,
|
||||
Dir,
|
||||
#[doc(hidden)]
|
||||
__Unknown(i32),
|
||||
}
|
||||
|
||||
impl fmt::Display for RepoCommitIterResult {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(f, "RepoCommitIterResult::{}", match *self {
|
||||
RepoCommitIterResult::Error => "Error",
|
||||
RepoCommitIterResult::End => "End",
|
||||
RepoCommitIterResult::File => "File",
|
||||
RepoCommitIterResult::Dir => "Dir",
|
||||
_ => "Unknown",
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl ToGlib for RepoCommitIterResult {
|
||||
type GlibType = ostree_sys::OstreeRepoCommitIterResult;
|
||||
|
||||
fn to_glib(&self) -> ostree_sys::OstreeRepoCommitIterResult {
|
||||
match *self {
|
||||
RepoCommitIterResult::Error => ostree_sys::OSTREE_REPO_COMMIT_ITER_RESULT_ERROR,
|
||||
RepoCommitIterResult::End => ostree_sys::OSTREE_REPO_COMMIT_ITER_RESULT_END,
|
||||
RepoCommitIterResult::File => ostree_sys::OSTREE_REPO_COMMIT_ITER_RESULT_FILE,
|
||||
RepoCommitIterResult::Dir => ostree_sys::OSTREE_REPO_COMMIT_ITER_RESULT_DIR,
|
||||
RepoCommitIterResult::__Unknown(value) => value
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl FromGlib<ostree_sys::OstreeRepoCommitIterResult> for RepoCommitIterResult {
|
||||
fn from_glib(value: ostree_sys::OstreeRepoCommitIterResult) -> Self {
|
||||
match value {
|
||||
0 => RepoCommitIterResult::Error,
|
||||
1 => RepoCommitIterResult::End,
|
||||
2 => RepoCommitIterResult::File,
|
||||
3 => RepoCommitIterResult::Dir,
|
||||
value => RepoCommitIterResult::__Unknown(value),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
|
||||
#[derive(Clone, Copy)]
|
||||
pub enum RepoMode {
|
||||
|
|
|
|||
|
|
@ -61,6 +61,34 @@ impl FromGlib<ostree_sys::OstreeDiffFlags> for DiffFlags {
|
|||
}
|
||||
}
|
||||
|
||||
bitflags! {
|
||||
pub struct RepoCommitModifierFlags: u32 {
|
||||
const NONE = 0;
|
||||
const SKIP_XATTRS = 1;
|
||||
const GENERATE_SIZES = 2;
|
||||
const CANONICAL_PERMISSIONS = 4;
|
||||
const ERROR_ON_UNLABELED = 8;
|
||||
const CONSUME = 16;
|
||||
const DEVINO_CANONICAL = 32;
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl ToGlib for RepoCommitModifierFlags {
|
||||
type GlibType = ostree_sys::OstreeRepoCommitModifierFlags;
|
||||
|
||||
fn to_glib(&self) -> ostree_sys::OstreeRepoCommitModifierFlags {
|
||||
self.bits()
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl FromGlib<ostree_sys::OstreeRepoCommitModifierFlags> for RepoCommitModifierFlags {
|
||||
fn from_glib(value: ostree_sys::OstreeRepoCommitModifierFlags) -> RepoCommitModifierFlags {
|
||||
RepoCommitModifierFlags::from_bits_truncate(value)
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v2015_7", feature = "dox"))]
|
||||
bitflags! {
|
||||
pub struct RepoCommitState: u32 {
|
||||
|
|
@ -87,6 +115,53 @@ impl FromGlib<ostree_sys::OstreeRepoCommitState> for RepoCommitState {
|
|||
}
|
||||
}
|
||||
|
||||
bitflags! {
|
||||
pub struct RepoCommitTraverseFlags: u32 {
|
||||
const REPO_COMMIT_TRAVERSE_FLAG_NONE = 1;
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl ToGlib for RepoCommitTraverseFlags {
|
||||
type GlibType = ostree_sys::OstreeRepoCommitTraverseFlags;
|
||||
|
||||
fn to_glib(&self) -> ostree_sys::OstreeRepoCommitTraverseFlags {
|
||||
self.bits()
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl FromGlib<ostree_sys::OstreeRepoCommitTraverseFlags> for RepoCommitTraverseFlags {
|
||||
fn from_glib(value: ostree_sys::OstreeRepoCommitTraverseFlags) -> RepoCommitTraverseFlags {
|
||||
RepoCommitTraverseFlags::from_bits_truncate(value)
|
||||
}
|
||||
}
|
||||
|
||||
bitflags! {
|
||||
pub struct RepoListObjectsFlags: u32 {
|
||||
const LOOSE = 1;
|
||||
const PACKED = 2;
|
||||
const ALL = 4;
|
||||
const NO_PARENTS = 8;
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl ToGlib for RepoListObjectsFlags {
|
||||
type GlibType = ostree_sys::OstreeRepoListObjectsFlags;
|
||||
|
||||
fn to_glib(&self) -> ostree_sys::OstreeRepoListObjectsFlags {
|
||||
self.bits()
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl FromGlib<ostree_sys::OstreeRepoListObjectsFlags> for RepoListObjectsFlags {
|
||||
fn from_glib(value: ostree_sys::OstreeRepoListObjectsFlags) -> RepoListObjectsFlags {
|
||||
RepoListObjectsFlags::from_bits_truncate(value)
|
||||
}
|
||||
}
|
||||
|
||||
bitflags! {
|
||||
pub struct RepoListRefsExtFlags: u32 {
|
||||
const NONE = 0;
|
||||
|
|
|
|||
|
|
@ -98,6 +98,8 @@ pub use self::enums::ObjectType;
|
|||
pub use self::enums::RepoCheckoutFilterResult;
|
||||
pub use self::enums::RepoCheckoutMode;
|
||||
pub use self::enums::RepoCheckoutOverwriteMode;
|
||||
pub use self::enums::RepoCommitFilterResult;
|
||||
pub use self::enums::RepoCommitIterResult;
|
||||
pub use self::enums::RepoMode;
|
||||
pub use self::enums::RepoPruneFlags;
|
||||
pub use self::enums::RepoRemoteChange;
|
||||
|
|
@ -107,8 +109,11 @@ mod flags;
|
|||
#[cfg(any(feature = "v2017_13", feature = "dox"))]
|
||||
pub use self::flags::ChecksumFlags;
|
||||
pub use self::flags::DiffFlags;
|
||||
pub use self::flags::RepoCommitModifierFlags;
|
||||
#[cfg(any(feature = "v2015_7", feature = "dox"))]
|
||||
pub use self::flags::RepoCommitState;
|
||||
pub use self::flags::RepoCommitTraverseFlags;
|
||||
pub use self::flags::RepoListObjectsFlags;
|
||||
pub use self::flags::RepoListRefsExtFlags;
|
||||
pub use self::flags::RepoPullFlags;
|
||||
pub use self::flags::RepoResolveRevExtFlags;
|
||||
|
|
|
|||
|
|
@ -344,7 +344,7 @@ impl Repo {
|
|||
// unsafe { TODO: call ostree_sys:ostree_repo_list_commit_objects_starting_with() }
|
||||
//}
|
||||
|
||||
//pub fn list_objects<P: IsA<gio::Cancellable>>(&self, flags: /*Ignored*/RepoListObjectsFlags, out_objects: /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 2, id: 182 }/TypeId { ns_id: 2, id: 182 }, cancellable: Option<&P>) -> Result<(), Error> {
|
||||
//pub fn list_objects<P: IsA<gio::Cancellable>>(&self, flags: RepoListObjectsFlags, out_objects: /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 2, id: 182 }/TypeId { ns_id: 2, id: 182 }, cancellable: Option<&P>) -> Result<(), Error> {
|
||||
// unsafe { TODO: call ostree_sys:ostree_repo_list_objects() }
|
||||
//}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@
|
|||
// DO NOT EDIT
|
||||
|
||||
use Repo;
|
||||
use RepoCommitFilterResult;
|
||||
use RepoCommitModifierFlags;
|
||||
#[cfg(any(feature = "v2017_13", feature = "dox"))]
|
||||
use RepoDevInoCache;
|
||||
use SePolicy;
|
||||
|
|
@ -25,9 +27,30 @@ glib_wrapper! {
|
|||
}
|
||||
|
||||
impl RepoCommitModifier {
|
||||
//pub fn new(flags: /*Ignored*/RepoCommitModifierFlags, commit_filter: /*Unimplemented*/Fn(&Repo, &str, &gio::FileInfo) -> /*Ignored*/RepoCommitFilterResult, user_data: /*Unimplemented*/Option<Fundamental: Pointer>) -> RepoCommitModifier {
|
||||
// unsafe { TODO: call ostree_sys:ostree_repo_commit_modifier_new() }
|
||||
//}
|
||||
pub fn new(flags: RepoCommitModifierFlags, commit_filter: Option<Box<dyn Fn(&Repo, &str, &gio::FileInfo) -> RepoCommitFilterResult + 'static>>) -> RepoCommitModifier {
|
||||
let commit_filter_data: Box_<Option<Box<dyn Fn(&Repo, &str, &gio::FileInfo) -> RepoCommitFilterResult + 'static>>> = Box::new(commit_filter);
|
||||
unsafe extern "C" fn commit_filter_func(repo: *mut ostree_sys::OstreeRepo, path: *const libc::c_char, file_info: *mut gio_sys::GFileInfo, user_data: glib_sys::gpointer) -> ostree_sys::OstreeRepoCommitFilterResult {
|
||||
let repo = from_glib_borrow(repo);
|
||||
let path: GString = from_glib_borrow(path);
|
||||
let 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 {
|
||||
callback(&repo, path.as_str(), &file_info)
|
||||
} else {
|
||||
panic!("cannot get closure...")
|
||||
};
|
||||
res.to_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_sys::gpointer) {
|
||||
let _callback: Box_<Option<Box<dyn Fn(&Repo, &str, &gio::FileInfo) -> RepoCommitFilterResult + 'static>>> = Box_::from_raw(data as *mut _);
|
||||
}
|
||||
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;
|
||||
unsafe {
|
||||
from_glib_full(ostree_sys::ostree_repo_commit_modifier_new(flags.to_glib(), commit_filter, Box::into_raw(super_callback0) as *mut _, destroy_call3))
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v2017_13", feature = "dox"))]
|
||||
pub fn set_devino_cache(&self, cache: &RepoDevInoCache) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue