diff options
author | Justus Winter <justus@sequoia-pgp.org> | 2019-07-09 12:51:10 +0200 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2019-07-15 12:47:53 +0200 |
commit | 775f0c039349335df880d35db7df6c131419f0eb (patch) | |
tree | 2d16928f3a629b7afae95cf1b9d518c5603a9f93 /ffi | |
parent | caec575e3c44e6045e29aa452ad31f91d04ec139 (diff) |
Prepare for Rust 2018.
- This is the result of running `cargo fix --edition`, with some
manual adjustments.
- The vast majority of changes merely qualify module paths with
'crate::'.
- Two instances of adding an anonymous pattern to a trait's
function.
- `async` is a keyword in Rust 2018, and hence it needs to be
escaped (e.g. in the case of the net::r#async module).
- The manual adjustments were needed due to various shortcomings of
the analysis employed by `cargo fix`, e.g. unexpanded macros,
procedural macros, lalrpop grammars.
Diffstat (limited to 'ffi')
-rw-r--r-- | ffi/src/core.rs | 40 | ||||
-rw-r--r-- | ffi/src/error.rs | 6 | ||||
-rw-r--r-- | ffi/src/lib.rs | 3 | ||||
-rw-r--r-- | ffi/src/net.rs | 22 | ||||
-rw-r--r-- | ffi/src/store.rs | 86 |
5 files changed, 78 insertions, 79 deletions
diff --git a/ffi/src/core.rs b/ffi/src/core.rs index 70d333be..111ae19f 100644 --- a/ffi/src/core.rs +++ b/ffi/src/core.rs @@ -48,7 +48,7 @@ use sequoia_core::Config; #[doc(hidden)] pub struct Context { pub(crate) c: core::Context, - e: *mut ::error::Error, + e: *mut crate::error::Error, } impl Context { @@ -56,7 +56,7 @@ impl Context { Context{c: c, e: ptr::null_mut()} } - pub(crate) fn errp(&mut self) -> &mut *mut ::error::Error { + pub(crate) fn errp(&mut self) -> &mut *mut crate::error::Error { &mut self.e } } @@ -64,8 +64,8 @@ impl Context { /// Returns the last error. /// /// Returns and removes the last error from the context. -#[::ffi_catch_abort] #[no_mangle] pub extern "C" -fn sq_context_last_error(ctx: *mut Context) -> *mut ::error::Error { +#[::sequoia_ffi_macros::extern_fn] #[no_mangle] pub extern "C" +fn sq_context_last_error(ctx: *mut Context) -> *mut crate::error::Error { let ctx = ffi_param_ref_mut!(ctx); ::std::mem::replace(&mut ctx.e, ptr::null_mut()) } @@ -74,15 +74,15 @@ fn sq_context_last_error(ctx: *mut Context) -> *mut ::error::Error { /// /// Returns `NULL` on errors. If `errp` is not `NULL`, the error is /// stored there. -#[::ffi_catch_abort] #[no_mangle] pub extern "C" -fn sq_context_new(errp: Option<&mut *mut ::error::Error>) +#[::sequoia_ffi_macros::extern_fn] #[no_mangle] pub extern "C" +fn sq_context_new(errp: Option<&mut *mut crate::error::Error>) -> *mut Context { ffi_make_fry_from_errp!(errp); ffi_try_box!(core::Context::new().map(|ctx| Context::new(ctx))) } /// Frees a context. -#[::ffi_catch_abort] #[no_mangle] pub extern "C" +#[::sequoia_ffi_macros::extern_fn] #[no_mangle] pub extern "C" fn sq_context_free(context: Option<&mut Context>) { ffi_free!(context) } @@ -92,41 +92,41 @@ fn sq_context_free(context: Option<&mut Context>) { /// The configuration is seeded like in `sq_context_new`, but can be /// modified. A configuration has to be finalized using /// `sq_config_build()` in order to turn it into a Context. -#[::ffi_catch_abort] #[no_mangle] pub extern "C" +#[::sequoia_ffi_macros::extern_fn] #[no_mangle] pub extern "C" fn sq_context_configure() -> *mut Config { Box::into_raw(Box::new(core::Context::configure())) } /// Returns the directory containing shared state. -#[::ffi_catch_abort] #[no_mangle] pub extern "C" +#[::sequoia_ffi_macros::extern_fn] #[no_mangle] pub extern "C" fn sq_context_home(ctx: *const Context) -> *const c_char { let ctx = ffi_param_ref!(ctx); ctx.c.home().to_string_lossy().as_ptr() as *const c_char } /// Returns the directory containing backend servers. -#[::ffi_catch_abort] #[no_mangle] pub extern "C" +#[::sequoia_ffi_macros::extern_fn] #[no_mangle] pub extern "C" fn sq_context_lib(ctx: *const Context) -> *const c_char { let ctx = ffi_param_ref!(ctx); ctx.c.lib().to_string_lossy().as_bytes().as_ptr() as *const c_char } /// Returns the network policy. -#[::ffi_catch_abort] #[no_mangle] pub extern "C" +#[::sequoia_ffi_macros::extern_fn] #[no_mangle] pub extern "C" fn sq_context_network_policy(ctx: *const Context) -> c_int { let ctx = ffi_param_ref!(ctx); u8::from(ctx.c.network_policy()) as c_int } /// Returns the IPC policy. -#[::ffi_catch_abort] #[no_mangle] pub extern "C" +#[::sequoia_ffi_macros::extern_fn] #[no_mangle] pub extern "C" fn sq_context_ipc_policy(ctx: *const Context) -> c_int { let ctx = ffi_param_ref!(ctx); u8::from(ctx.c.ipc_policy()) as c_int } /// Returns whether or not this is an ephemeral context. -#[::ffi_catch_abort] #[no_mangle] pub extern "C" +#[::sequoia_ffi_macros::extern_fn] #[no_mangle] pub extern "C" fn sq_context_ephemeral(ctx: *const Context) -> u8 { let ctx = ffi_param_ref!(ctx); if ctx.c.ephemeral() { 1 } else { 0 } @@ -139,8 +139,8 @@ fn sq_context_ephemeral(ctx: *const Context) -> u8 { /// /// Consumes `cfg`. Returns `NULL` on errors. Returns `NULL` on /// errors. If `errp` is not `NULL`, the error is stored there. -#[::ffi_catch_abort] #[no_mangle] pub extern "C" -fn sq_config_build(cfg: *mut Config, errp: Option<&mut *mut ::error::Error>) +#[::sequoia_ffi_macros::extern_fn] #[no_mangle] pub extern "C" +fn sq_config_build(cfg: *mut Config, errp: Option<&mut *mut crate::error::Error>) -> *mut Context { ffi_make_fry_from_errp!(errp); let cfg = ffi_param_move!(cfg); @@ -149,7 +149,7 @@ fn sq_config_build(cfg: *mut Config, errp: Option<&mut *mut ::error::Error>) } /// Sets the directory containing shared state. -#[::ffi_catch_abort] #[no_mangle] pub extern "C" +#[::sequoia_ffi_macros::extern_fn] #[no_mangle] pub extern "C" fn sq_config_home(cfg: *mut Config, home: *const c_char) { let cfg = ffi_param_ref_mut!(cfg); let home = ffi_param_cstr!(home).to_string_lossy(); @@ -157,7 +157,7 @@ fn sq_config_home(cfg: *mut Config, home: *const c_char) { } /// Set the directory containing backend servers. -#[::ffi_catch_abort] #[no_mangle] pub extern "C" +#[::sequoia_ffi_macros::extern_fn] #[no_mangle] pub extern "C" fn sq_config_lib(cfg: *mut Config, lib: *const c_char) { let cfg = ffi_param_ref_mut!(cfg); let lib = ffi_param_cstr!(lib).to_string_lossy(); @@ -165,7 +165,7 @@ fn sq_config_lib(cfg: *mut Config, lib: *const c_char) { } /// Sets the network policy. -#[::ffi_catch_abort] #[no_mangle] pub extern "C" +#[::sequoia_ffi_macros::extern_fn] #[no_mangle] pub extern "C" fn sq_config_network_policy(cfg: *mut Config, policy: c_int) { let cfg = ffi_param_ref_mut!(cfg); if policy < 0 || policy > 3 { @@ -175,7 +175,7 @@ fn sq_config_network_policy(cfg: *mut Config, policy: c_int) { } /// Sets the IPC policy. -#[::ffi_catch_abort] #[no_mangle] pub extern "C" +#[::sequoia_ffi_macros::extern_fn] #[no_mangle] pub extern "C" fn sq_config_ipc_policy(cfg: *mut Config, policy: c_int) { let cfg = ffi_param_ref_mut!(cfg); if policy < 0 || policy > 2 { @@ -185,7 +185,7 @@ fn sq_config_ipc_policy(cfg: *mut Config, policy: c_int) { } /// Makes this context ephemeral. -#[::ffi_catch_abort] #[no_mangle] pub extern "C" +#[::sequoia_ffi_macros::extern_fn] #[no_mangle] pub extern "C" fn sq_config_ephemeral(cfg: *mut Config) { let cfg = ffi_param_ref_mut!(cfg); cfg.set_ephemeral(); diff --git a/ffi/src/error.rs b/ffi/src/error.rs index 889e4ac5..6b791d97 100644 --- a/ffi/src/error.rs +++ b/ffi/src/error.rs @@ -5,12 +5,12 @@ use std::io; extern crate sequoia_openpgp as openpgp; use sequoia_core as core; -pub use openpgp::error::Status; +pub use crate::openpgp::error::Status; -pub(crate) use ::openpgp::error::Error; +pub(crate) use crate::openpgp::error::Error; trait FromSequoiaError<'a> { - fn from_sequoia_error(&'a failure::Error) -> Status; + fn from_sequoia_error(_: &'a failure::Error) -> Status; } impl<'a> FromSequoiaError<'a> for Status { diff --git a/ffi/src/lib.rs b/ffi/src/lib.rs index 1a68d87e..bc864f76 100644 --- a/ffi/src/lib.rs +++ b/ffi/src/lib.rs @@ -117,7 +117,6 @@ extern crate nettle; extern crate sequoia_ffi_macros; use sequoia_ffi_macros::{ - ffi_catch_abort, ffi_wrapper_type, }; extern crate sequoia_openpgp; @@ -131,7 +130,7 @@ pub mod openpgp { include!("../../openpgp-ffi/src/common.rs"); } -pub(crate) use openpgp::{ +pub(crate) use crate::openpgp::{ io, build_hasher, strndup, diff --git a/ffi/src/net.rs b/ffi/src/net.rs index 3f25b643..d99da30c 100644 --- a/ffi/src/net.rs +++ b/ffi/src/net.rs @@ -38,11 +38,11 @@ use sequoia_net::KeyServer; use super::error::Status; use super::core::Context; -use ::openpgp::keyid::KeyID; -use ::openpgp::tpk::TPK; -use ::RefRaw; -use MoveResultIntoRaw; -use Maybe; +use crate::openpgp::keyid::KeyID; +use crate::openpgp::tpk::TPK; +use crate::RefRaw; +use crate::MoveResultIntoRaw; +use crate::Maybe; /// Returns a handle for the given URI. /// @@ -50,7 +50,7 @@ use Maybe; /// e.g. `hkps://examle.org`. /// /// Returns `NULL` on errors. -#[::ffi_catch_abort] #[no_mangle] pub extern "C" +#[::sequoia_ffi_macros::extern_fn] #[no_mangle] pub extern "C" fn sq_keyserver_new(ctx: *mut Context, uri: *const c_char) -> *mut KeyServer { let ctx = ffi_param_ref_mut!(ctx); ffi_make_fry_from_ctx!(ctx); @@ -66,7 +66,7 @@ fn sq_keyserver_new(ctx: *mut Context, uri: *const c_char) -> *mut KeyServer { /// size `len` used to authenticate the server. /// /// Returns `NULL` on errors. -#[::ffi_catch_abort] #[no_mangle] pub extern "C" +#[::sequoia_ffi_macros::extern_fn] #[no_mangle] pub extern "C" fn sq_keyserver_with_cert(ctx: *mut Context, uri: *const c_char, cert: *const u8, @@ -95,7 +95,7 @@ fn sq_keyserver_with_cert(ctx: *mut Context, /// included in this library. It is a good default choice. /// /// Returns `NULL` on errors. -#[::ffi_catch_abort] #[no_mangle] pub extern "C" +#[::sequoia_ffi_macros::extern_fn] #[no_mangle] pub extern "C" fn sq_keyserver_sks_pool(ctx: *mut Context) -> *mut KeyServer { let ctx = ffi_param_ref_mut!(ctx); ffi_make_fry_from_ctx!(ctx); @@ -103,7 +103,7 @@ fn sq_keyserver_sks_pool(ctx: *mut Context) -> *mut KeyServer { } /// Frees a keyserver object. -#[::ffi_catch_abort] #[no_mangle] pub extern "C" +#[::sequoia_ffi_macros::extern_fn] #[no_mangle] pub extern "C" fn sq_keyserver_free(ks: Option<&mut KeyServer>) { ffi_free!(ks) } @@ -111,7 +111,7 @@ fn sq_keyserver_free(ks: Option<&mut KeyServer>) { /// Retrieves the key with the given `keyid`. /// /// Returns `NULL` on errors. -#[::ffi_catch_abort] #[no_mangle] pub extern "C" +#[::sequoia_ffi_macros::extern_fn] #[no_mangle] pub extern "C" fn sq_keyserver_get(ctx: *mut Context, ks: *mut KeyServer, id: *const KeyID) @@ -127,7 +127,7 @@ fn sq_keyserver_get(ctx: *mut Context, /// Sends the given key to the server. /// /// Returns != 0 on errors. -#[::ffi_catch_abort] #[no_mangle] pub extern "C" +#[::sequoia_ffi_macros::extern_fn] #[no_mangle] pub extern "C" fn sq_keyserver_send(ctx: *mut Context, ks: *mut KeyServer, tpk: *const TPK) diff --git a/ffi/src/store.rs b/ffi/src/store.rs index a5e49c8b..9941044f 100644 --- a/ffi/src/store.rs +++ b/ffi/src/store.rs @@ -35,16 +35,16 @@ use sequoia_store::{ use super::error::Status; use super::core::Context; -use ::openpgp::fingerprint::Fingerprint; -use ::openpgp::keyid::KeyID; -use ::openpgp::tpk::TPK; -use RefRaw; -use MoveIntoRaw; -use MoveResultIntoRaw; -use Maybe; +use crate::openpgp::fingerprint::Fingerprint; +use crate::openpgp::keyid::KeyID; +use crate::openpgp::tpk::TPK; +use crate::RefRaw; +use crate::MoveIntoRaw; +use crate::MoveResultIntoRaw; +use crate::Maybe; /// Lists all stores with the given prefix. -#[::ffi_catch_abort] #[no_mangle] pub extern "C" +#[::sequoia_ffi_macros::extern_fn] #[no_mangle] pub extern "C" fn sq_store_list_stores(ctx: *mut Context, realm_prefix: *const c_char) -> *mut StoreIter { @@ -61,7 +61,7 @@ fn sq_store_list_stores(ctx: *mut Context, /// stores realm is stored there. If `namep` is not `NULL`, the /// stores name is stored there. If `policyp` is not `NULL`, the /// stores network policy is stored there. -#[::ffi_catch_abort] #[no_mangle] pub extern "C" +#[::sequoia_ffi_macros::extern_fn] #[no_mangle] pub extern "C" fn sq_store_iter_next(iter: *mut StoreIter, realmp: Option<&mut *mut c_char>, namep: Option<&mut *mut c_char>, @@ -89,13 +89,13 @@ fn sq_store_iter_next(iter: *mut StoreIter, } /// Frees a sq_store_iter_t. -#[::ffi_catch_abort] #[no_mangle] pub extern "C" +#[::sequoia_ffi_macros::extern_fn] #[no_mangle] pub extern "C" fn sq_store_iter_free(iter: Option<&mut StoreIter>) { ffi_free!(iter) } /// Lists all keys in the common key pool. -#[::ffi_catch_abort] #[no_mangle] pub extern "C" +#[::sequoia_ffi_macros::extern_fn] #[no_mangle] pub extern "C" fn sq_store_list_keys(ctx: *mut Context) -> *mut KeyIter { let ctx = ffi_param_ref_mut!(ctx); ffi_make_fry_from_ctx!(ctx); @@ -104,7 +104,7 @@ fn sq_store_list_keys(ctx: *mut Context) -> *mut KeyIter { } /// Lists all log entries. -#[::ffi_catch_abort] #[no_mangle] pub extern "C" +#[::sequoia_ffi_macros::extern_fn] #[no_mangle] pub extern "C" fn sq_store_server_log(ctx: *mut Context) -> *mut LogIter { let ctx = ffi_param_ref_mut!(ctx); ffi_make_fry_from_ctx!(ctx); @@ -116,7 +116,7 @@ fn sq_store_server_log(ctx: *mut Context) -> *mut LogIter { /// /// Returns `NULL` on exhaustion. If `fpp` is not `NULL`, the key's /// fingerprint is stored there. -#[::ffi_catch_abort] #[no_mangle] pub extern "C" +#[::sequoia_ffi_macros::extern_fn] #[no_mangle] pub extern "C" fn sq_key_iter_next(iter: *mut KeyIter, fpp: Option<&mut Maybe<Fingerprint>>) -> *mut Key { @@ -139,7 +139,7 @@ fn sq_key_iter_next(iter: *mut KeyIter, } /// Frees a sq_key_iter_t. -#[::ffi_catch_abort] #[no_mangle] pub extern "C" +#[::sequoia_ffi_macros::extern_fn] #[no_mangle] pub extern "C" fn sq_key_iter_free(iter: Option<&mut KeyIter>) { ffi_free!(iter) } @@ -148,7 +148,7 @@ fn sq_key_iter_free(iter: Option<&mut KeyIter>) { /// Returns the next log entry. /// /// Returns `NULL` on exhaustion. -#[::ffi_catch_abort] #[no_mangle] pub extern "C" +#[::sequoia_ffi_macros::extern_fn] #[no_mangle] pub extern "C" fn sq_log_iter_next(iter: *mut LogIter) -> *mut Log { let iter = ffi_param_ref_mut!(iter); match iter.next() { @@ -173,7 +173,7 @@ fn sq_log_iter_next(iter: *mut LogIter) -> *mut Log { } /// Frees a sq_log_iter_t. -#[::ffi_catch_abort] #[no_mangle] pub extern "C" +#[::sequoia_ffi_macros::extern_fn] #[no_mangle] pub extern "C" fn sq_log_iter_free(iter: Option<&mut LogIter>) { ffi_free!(iter) } @@ -189,7 +189,7 @@ fn sq_log_iter_free(iter: Option<&mut LogIter>) { /// of the context that created the store in the first place. /// Opening the store with a different network policy is /// forbidden. -#[::ffi_catch_abort] #[no_mangle] pub extern "C" +#[::sequoia_ffi_macros::extern_fn] #[no_mangle] pub extern "C" fn sq_store_open(ctx: *mut Context, realm: *const c_char, name: *const c_char) @@ -203,13 +203,13 @@ fn sq_store_open(ctx: *mut Context, } /// Frees a sq_store_t. -#[::ffi_catch_abort] #[no_mangle] pub extern "C" +#[::sequoia_ffi_macros::extern_fn] #[no_mangle] pub extern "C" fn sq_store_free(store: Option<&mut Store>) { ffi_free!(store) } /// Adds a key identified by fingerprint to the store. -#[::ffi_catch_abort] #[no_mangle] pub extern "C" +#[::sequoia_ffi_macros::extern_fn] #[no_mangle] pub extern "C" fn sq_store_add(ctx: *mut Context, store: *const Store, label: *const c_char, @@ -225,7 +225,7 @@ fn sq_store_add(ctx: *mut Context, } /// Imports a key into the store. -#[::ffi_catch_abort] #[no_mangle] pub extern "C" +#[::sequoia_ffi_macros::extern_fn] #[no_mangle] pub extern "C" fn sq_store_import(ctx: *mut Context, store: *const Store, label: *const c_char, @@ -241,7 +241,7 @@ fn sq_store_import(ctx: *mut Context, } /// Returns the binding for the given label. -#[::ffi_catch_abort] #[no_mangle] pub extern "C" +#[::sequoia_ffi_macros::extern_fn] #[no_mangle] pub extern "C" fn sq_store_lookup(ctx: *mut Context, store: *const Store, label: *const c_char) @@ -255,7 +255,7 @@ fn sq_store_lookup(ctx: *mut Context, } /// Looks up a key in the common key pool by KeyID. -#[::ffi_catch_abort] #[no_mangle] pub extern "C" +#[::sequoia_ffi_macros::extern_fn] #[no_mangle] pub extern "C" fn sq_store_lookup_by_keyid(ctx: *mut Context, keyid: *const KeyID) -> *mut Key { @@ -267,7 +267,7 @@ fn sq_store_lookup_by_keyid(ctx: *mut Context, keyid: *const KeyID) } /// Looks up a key in the common key pool by (Sub)KeyID. -#[::ffi_catch_abort] #[no_mangle] pub extern "C" +#[::sequoia_ffi_macros::extern_fn] #[no_mangle] pub extern "C" fn sq_store_lookup_by_subkeyid(ctx: *mut Context, keyid: *const KeyID) -> *mut Key { @@ -281,7 +281,7 @@ fn sq_store_lookup_by_subkeyid(ctx: *mut Context, keyid: *const KeyID) /// Deletes this store. /// /// Consumes `store`. Returns != 0 on error. -#[::ffi_catch_abort] #[no_mangle] pub extern "C" +#[::sequoia_ffi_macros::extern_fn] #[no_mangle] pub extern "C" fn sq_store_delete(ctx: *mut Context, store: *mut Store) -> Status { let ctx = ffi_param_ref_mut!(ctx); @@ -292,7 +292,7 @@ fn sq_store_delete(ctx: *mut Context, store: *mut Store) } /// Lists all bindings. -#[::ffi_catch_abort] #[no_mangle] pub extern "C" +#[::sequoia_ffi_macros::extern_fn] #[no_mangle] pub extern "C" fn sq_store_iter(ctx: *mut Context, store: *const Store) -> *mut BindingIter { let ctx = ffi_param_ref_mut!(ctx); @@ -307,7 +307,7 @@ fn sq_store_iter(ctx: *mut Context, store: *const Store) /// Returns `NULL` on exhaustion. If `labelp` is not `NULL`, the /// bindings label is stored there. If `fpp` is not `NULL`, the /// bindings fingerprint is stored there. -#[::ffi_catch_abort] #[no_mangle] pub extern "C" +#[::sequoia_ffi_macros::extern_fn] #[no_mangle] pub extern "C" fn sq_binding_iter_next(iter: *mut BindingIter, labelp: Option<&mut *mut c_char>, fpp: Option<&mut Maybe<Fingerprint>>) @@ -335,13 +335,13 @@ fn sq_binding_iter_next(iter: *mut BindingIter, } /// Frees a sq_binding_iter_t. -#[::ffi_catch_abort] #[no_mangle] pub extern "C" +#[::sequoia_ffi_macros::extern_fn] #[no_mangle] pub extern "C" fn sq_binding_iter_free(iter: Option<&mut BindingIter>) { ffi_free!(iter) } /// Lists all log entries related to this store. -#[::ffi_catch_abort] #[no_mangle] pub extern "C" +#[::sequoia_ffi_macros::extern_fn] #[no_mangle] pub extern "C" fn sq_store_log(ctx: *mut Context, store: *const Store) -> *mut LogIter { let ctx = ffi_param_ref_mut!(ctx); @@ -352,19 +352,19 @@ fn sq_store_log(ctx: *mut Context, store: *const Store) } /// Frees a sq_binding_t. -#[::ffi_catch_abort] #[no_mangle] pub extern "C" +#[::sequoia_ffi_macros::extern_fn] #[no_mangle] pub extern "C" fn sq_binding_free(binding: Option<&mut Binding>) { ffi_free!(binding) } /// Frees a sq_key_t. -#[::ffi_catch_abort] #[no_mangle] pub extern "C" +#[::sequoia_ffi_macros::extern_fn] #[no_mangle] pub extern "C" fn sq_key_free(key: Option<&mut Key>) { ffi_free!(key) } /// Frees a sq_log_t. -#[::ffi_catch_abort] #[no_mangle] pub extern "C" +#[::sequoia_ffi_macros::extern_fn] #[no_mangle] pub extern "C" fn sq_log_free(log: Option<&mut Log>) { if let Some(log) = log { let log = unsafe { Box::from_raw(log) }; @@ -387,7 +387,7 @@ fn sq_log_free(log: Option<&mut Log>) { } /// Returns the `sq_stats_t` of this binding. -#[::ffi_catch_abort] #[no_mangle] pub extern "C" +#[::sequoia_ffi_macros::extern_fn] #[no_mangle] pub extern "C" fn sq_binding_stats(ctx: *mut Context, binding: *const Binding) -> *mut Stats { let ctx = ffi_param_ref_mut!(ctx); @@ -398,7 +398,7 @@ fn sq_binding_stats(ctx: *mut Context, binding: *const Binding) } /// Returns the `sq_key_t` of this binding. -#[::ffi_catch_abort] #[no_mangle] pub extern "C" +#[::sequoia_ffi_macros::extern_fn] #[no_mangle] pub extern "C" fn sq_binding_key(ctx: *mut Context, binding: *const Binding) -> *mut Key { let ctx = ffi_param_ref_mut!(ctx); @@ -409,7 +409,7 @@ fn sq_binding_key(ctx: *mut Context, binding: *const Binding) } /// Returns the `pgp_tpk_t` of this binding. -#[::ffi_catch_abort] #[no_mangle] pub extern "C" +#[::sequoia_ffi_macros::extern_fn] #[no_mangle] pub extern "C" fn sq_binding_tpk(ctx: *mut Context, binding: *const Binding) -> Maybe<TPK> { let ctx = ffi_param_ref_mut!(ctx); @@ -435,7 +435,7 @@ fn sq_binding_tpk(ctx: *mut Context, binding: *const Binding) /// `Error::Conflict` is returned, and you have to resolve the /// conflict, either by ignoring the new key, or by using /// `sq_binding_rotate` to force a rotation. -#[::ffi_catch_abort] #[no_mangle] pub extern "C" +#[::sequoia_ffi_macros::extern_fn] #[no_mangle] pub extern "C" fn sq_binding_import(ctx: *mut Context, binding: *const Binding, tpk: *const TPK) @@ -462,7 +462,7 @@ fn sq_binding_import(ctx: *mut Context, /// `tpk` properly. How to do that depends on your thread model. /// You could simply ask Alice to call her communication partner /// Bob and confirm that he rotated his keys. -#[::ffi_catch_abort] #[no_mangle] pub extern "C" +#[::sequoia_ffi_macros::extern_fn] #[no_mangle] pub extern "C" fn sq_binding_rotate(ctx: *mut Context, binding: *const Binding, tpk: *const TPK) @@ -478,7 +478,7 @@ fn sq_binding_rotate(ctx: *mut Context, /// Deletes this binding. /// /// Consumes `binding`. Returns != 0 on error. -#[::ffi_catch_abort] #[no_mangle] pub extern "C" +#[::sequoia_ffi_macros::extern_fn] #[no_mangle] pub extern "C" fn sq_binding_delete(ctx: *mut Context, binding: *mut Binding) -> Status { @@ -490,7 +490,7 @@ fn sq_binding_delete(ctx: *mut Context, } /// Lists all log entries related to this binding. -#[::ffi_catch_abort] #[no_mangle] pub extern "C" +#[::sequoia_ffi_macros::extern_fn] #[no_mangle] pub extern "C" fn sq_binding_log(ctx: *mut Context, binding: *const Binding) -> *mut LogIter { @@ -502,7 +502,7 @@ fn sq_binding_log(ctx: *mut Context, } /// Returns the `sq_stats_t` of this key. -#[::ffi_catch_abort] #[no_mangle] pub extern "C" +#[::sequoia_ffi_macros::extern_fn] #[no_mangle] pub extern "C" fn sq_key_stats(ctx: *mut Context, key: *const Key) -> *mut Stats { @@ -514,7 +514,7 @@ fn sq_key_stats(ctx: *mut Context, } /// Returns the `pgp_tpk_t`. -#[::ffi_catch_abort] #[no_mangle] pub extern "C" +#[::sequoia_ffi_macros::extern_fn] #[no_mangle] pub extern "C" fn sq_key_tpk(ctx: *mut Context, key: *const Key) -> Maybe<TPK> { @@ -534,7 +534,7 @@ fn sq_key_tpk(ctx: *mut Context, /// /// If the new key does not match the current key, /// `Error::Conflict` is returned. -#[::ffi_catch_abort] #[no_mangle] pub extern "C" +#[::sequoia_ffi_macros::extern_fn] #[no_mangle] pub extern "C" fn sq_key_import(ctx: *mut Context, key: *const Key, tpk: *const TPK) @@ -548,7 +548,7 @@ fn sq_key_import(ctx: *mut Context, } /// Lists all log entries related to this key. -#[::ffi_catch_abort] #[no_mangle] pub extern "C" +#[::sequoia_ffi_macros::extern_fn] #[no_mangle] pub extern "C" fn sq_key_log(ctx: *mut Context, key: *const Key) -> *mut LogIter { @@ -560,7 +560,7 @@ fn sq_key_log(ctx: *mut Context, } /// Frees a sq_stats_t. -#[::ffi_catch_abort] #[no_mangle] pub extern "C" +#[::sequoia_ffi_macros::extern_fn] #[no_mangle] pub extern "C" fn sq_stats_free(stats: Option<&mut Stats>) { ffi_free!(stats) } |