gir: fix another out parameter

This commit is contained in:
Felix Krull 2020-08-25 20:57:36 +02:00 committed by Colin Walters
parent 24b5148374
commit cefbccaee7
4 changed files with 19 additions and 9 deletions

View File

@ -13925,7 +13925,10 @@ the secret key with #ostree_sign_set_sk.</doc>
line="273">the raw data to be signed with pre-loaded secret key</doc>
<type name="GLib.Bytes" c:type="GBytes*"/>
</parameter>
<parameter name="signature" transfer-ownership="none">
<parameter name="signature"
direction="out"
caller-allocates="0"
transfer-ownership="full">
<doc xml:space="preserve"
filename="ostree-sign.c"
line="274">in case of success will contain signature</doc>
@ -14364,7 +14367,10 @@ the secret key with #ostree_sign_set_sk.</doc>
line="273">the raw data to be signed with pre-loaded secret key</doc>
<type name="GLib.Bytes" c:type="GBytes*"/>
</parameter>
<parameter name="signature" transfer-ownership="none">
<parameter name="signature"
direction="out"
caller-allocates="0"
transfer-ownership="full">
<doc xml:space="preserve"
filename="ostree-sign.c"
line="274">in case of success will contain signature</doc>
@ -15013,7 +15019,10 @@ Based on ostree_repo_add_gpg_signature_summary implementation.</doc>
line="273">the raw data to be signed with pre-loaded secret key</doc>
<type name="GLib.Bytes" c:type="GBytes*"/>
</parameter>
<parameter name="signature" transfer-ownership="none">
<parameter name="signature"
direction="out"
caller-allocates="0"
transfer-ownership="full">
<doc xml:space="preserve"
filename="ostree-sign.c"
line="274">in case of success will contain signature</doc>

View File

@ -59,7 +59,7 @@ pub trait SignExt: 'static {
fn commit_verify<P: IsA<gio::Cancellable>>(&self, repo: &Repo, commit_checksum: &str, cancellable: Option<&P>) -> Result<Option<GString>, glib::Error>;
#[cfg(any(feature = "v2020_2", feature = "dox"))]
fn data<P: IsA<gio::Cancellable>>(&self, data: &glib::Bytes, signature: &glib::Bytes, cancellable: Option<&P>) -> Result<(), glib::Error>;
fn data<P: IsA<gio::Cancellable>>(&self, data: &glib::Bytes, cancellable: Option<&P>) -> Result<glib::Bytes, glib::Error>;
#[cfg(any(feature = "v2020_2", feature = "dox"))]
fn data_verify(&self, data: &glib::Bytes, signatures: &glib::Variant) -> Result<Option<GString>, glib::Error>;
@ -125,11 +125,12 @@ impl<O: IsA<Sign>> SignExt for O {
}
#[cfg(any(feature = "v2020_2", feature = "dox"))]
fn data<P: IsA<gio::Cancellable>>(&self, data: &glib::Bytes, signature: &glib::Bytes, cancellable: Option<&P>) -> Result<(), glib::Error> {
fn data<P: IsA<gio::Cancellable>>(&self, data: &glib::Bytes, cancellable: Option<&P>) -> Result<glib::Bytes, glib::Error> {
unsafe {
let mut signature = ptr::null_mut();
let mut error = ptr::null_mut();
let _ = ostree_sys::ostree_sign_data(self.as_ref().to_glib_none().0, data.to_glib_none().0, signature.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
let _ = ostree_sys::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);
if error.is_null() { Ok(from_glib_full(signature)) } else { Err(from_glib_full(error)) }
}
}

View File

@ -1,2 +1,2 @@
Generated by gir (https://github.com/gtk-rs/gir @ 2d1ffab1)
from gir-files (https://github.com/gtk-rs/gir-files @ 8338f8c+)
from gir-files (https://github.com/gtk-rs/gir-files @ ed7b959+)

View File

@ -1,2 +1,2 @@
Generated by gir (https://github.com/gtk-rs/gir @ 2d1ffab1)
from gir-files (https://github.com/gtk-rs/gir-files @ 8338f8c+)
from gir-files (https://github.com/gtk-rs/gir-files @ ed7b959+)