diff options
author | Neal H. Walfield <neal@pep.foundation> | 2020-06-17 08:51:31 +0200 |
---|---|---|
committer | Neal H. Walfield <neal@pep.foundation> | 2020-06-17 08:55:35 +0200 |
commit | 06db1756bbb0ff0f3e8f9f7c4b8ca9d2e1b70d7c (patch) | |
tree | 4c0acabd9d0cb947130d9b2cbe2d5bb1f2b5b4a5 /openpgp-ffi/src | |
parent | 6db1fb039a40aa8a25d97b41e2eb17e339bff8fe (diff) |
openpgp-ffi: Change return type.
- Change `pgp_user_id_amalgamation_user_id` and
`pgp_valid_user_id_amalgamation_user_id` to return a
`pgp_packet_t`, not a `pgp_user_id_t`.
- Most functions work with `pgp_packet_t`s, not `pgp_user_id_t`s.
Diffstat (limited to 'openpgp-ffi/src')
-rw-r--r-- | openpgp-ffi/src/amalgamation.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/openpgp-ffi/src/amalgamation.rs b/openpgp-ffi/src/amalgamation.rs index 7f75751d..18cf83e8 100644 --- a/openpgp-ffi/src/amalgamation.rs +++ b/openpgp-ffi/src/amalgamation.rs @@ -12,7 +12,7 @@ extern crate sequoia_openpgp as openpgp; use self::openpgp::cert::amalgamation::ValidAmalgamation as _; use self::openpgp::cert::amalgamation::ValidateAmalgamation as _; -use super::packet::userid::UserID; +use super::packet::Packet; use super::packet::signature::Signature; use super::policy::Policy; use super::revocation_status::RevocationStatus; @@ -37,14 +37,14 @@ type UserIDAmalgamationType<'a> derive = "Clone, Debug")] pub struct UserIDAmalgamation<'a>(UserIDAmalgamationType<'a>); -/// Returns a reference to the `UserID`. +/// Returns a copy of the `UserID`. #[::sequoia_ffi_macros::extern_fn] #[no_mangle] pub extern "C" fn pgp_user_id_amalgamation_user_id<'a>(ua: *const UserIDAmalgamation<'a>) - -> *const UserID + -> *mut Packet { let ua = ua.ref_raw(); - ua.userid().move_into_raw() + openpgp::Packet::from(ua.userid().clone()).move_into_raw() } /// A local alias to appease the proc macro transformation. @@ -64,11 +64,11 @@ pub struct ValidUserIDAmalgamation<'a>(ValidUserIDAmalgamationType<'a>); /// Returns a reference to the `UserID`. #[::sequoia_ffi_macros::extern_fn] #[no_mangle] pub extern "C" fn pgp_valid_user_id_amalgamation_user_id<'a>(ua: *const ValidUserIDAmalgamation<'a>) - -> *const UserID + -> *const Packet { let ua = ua.ref_raw(); - ua.userid().move_into_raw() + openpgp::Packet::from(ua.userid().clone()).move_into_raw() } /// Returns the UserID's revocation status. |