From 0de59ff963a97014d47a2652e7216e135a39014e Mon Sep 17 00:00:00 2001 From: Justus Winter Date: Wed, 23 Jan 2019 12:34:53 +0100 Subject: openpgp-ffi: Remove pgp_tpk_dump. - This function was used early on to demonstrate the FFI layer. It can now be expressed using pgp_tpk_debug(). --- openpgp-ffi/examples/example.c | 8 ++++++-- openpgp-ffi/examples/reader.c | 6 +++++- openpgp-ffi/include/sequoia/openpgp.h | 4 ---- openpgp-ffi/src/tpk.rs | 9 --------- 4 files changed, 11 insertions(+), 16 deletions(-) (limited to 'openpgp-ffi') diff --git a/openpgp-ffi/examples/example.c b/openpgp-ffi/examples/example.c index 4d00876d..c23b4381 100644 --- a/openpgp-ffi/examples/example.c +++ b/openpgp-ffi/examples/example.c @@ -1,8 +1,9 @@ #define _GNU_SOURCE -#include #include +#include #include #include +#include #include #include #include @@ -37,7 +38,10 @@ main (int argc, char **argv) if (tpk == NULL) error (1, 0, "pgp_tpk_from_bytes: %s", pgp_error_string (err)); - pgp_tpk_dump (tpk); + char *debug = pgp_tpk_debug (tpk); + printf ("%s", debug); + free (debug); + pgp_tpk_free (tpk); munmap (b, st.st_size); close (fd); diff --git a/openpgp-ffi/examples/reader.c b/openpgp-ffi/examples/reader.c index f8a69adf..125b0e37 100644 --- a/openpgp-ffi/examples/reader.c +++ b/openpgp-ffi/examples/reader.c @@ -3,6 +3,7 @@ #include #include #include +#include #include #include #include @@ -39,7 +40,10 @@ main (int argc, char **argv) if (tpk == NULL) error (1, 0, "pgp_tpk_from_reader: %s", pgp_error_string (err)); - pgp_tpk_dump (tpk); + char *debug = pgp_tpk_debug (tpk); + printf ("%s", debug); + free (debug); + pgp_tpk_free (tpk); pgp_reader_free (reader); munmap (b, st.st_size); diff --git a/openpgp-ffi/include/sequoia/openpgp.h b/openpgp-ffi/include/sequoia/openpgp.h index bbb5c383..04616c17 100644 --- a/openpgp-ffi/include/sequoia/openpgp.h +++ b/openpgp-ffi/include/sequoia/openpgp.h @@ -889,10 +889,6 @@ pgp_tpk_t pgp_tpk_merge_packets (pgp_error_t *errp, pgp_tpk_t tpk, pgp_packet_t *packets, size_t packets_len); -/*/ -/// Dumps the TPK. -/*/ -void pgp_tpk_dump (const pgp_tpk_t tpk); /*/ /// Returns the fingerprint. diff --git a/openpgp-ffi/src/tpk.rs b/openpgp-ffi/src/tpk.rs index 8c381ba4..be2bd56d 100644 --- a/openpgp-ffi/src/tpk.rs +++ b/openpgp-ffi/src/tpk.rs @@ -169,15 +169,6 @@ pub extern "system" fn pgp_tpk_merge_packets(errp: Option<&mut *mut failure::Err ffi_try_box!(tpk.merge_packets(packets)) } -/// Dumps the TPK. -/// -/// XXX Remove this. -#[::ffi_catch_abort] #[no_mangle] -pub extern "system" fn pgp_tpk_dump(tpk: *const openpgp::TPK) { - let tpk = ffi_param_ref!(tpk); - println!("{:?}", *tpk); -} - /// Returns the fingerprint. #[::ffi_catch_abort] #[no_mangle] pub extern "system" fn pgp_tpk_fingerprint(tpk: *const openpgp::TPK) -- cgit v1.2.3