From 46f9d859b56cfbbf8a0e41d76f2d0abaa055b73d Mon Sep 17 00:00:00 2001 From: Justus Winter Date: Thu, 1 Oct 2020 12:06:14 +0200 Subject: openpgp: Rename Cert::merge_packets to Cert::insert_packets. - This is closer to collection types such as HashMap, and distinguishes the function from Cert::merge that merges two certificates. - See #572. --- openpgp-ffi/include/sequoia/openpgp.h | 2 +- openpgp-ffi/src/cert.rs | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'openpgp-ffi') diff --git a/openpgp-ffi/include/sequoia/openpgp.h b/openpgp-ffi/include/sequoia/openpgp.h index a5c49596..75b6098b 100644 --- a/openpgp-ffi/include/sequoia/openpgp.h +++ b/openpgp-ffi/include/sequoia/openpgp.h @@ -908,7 +908,7 @@ pgp_cert_t pgp_cert_merge (pgp_error_t *errp, /// Consumes `cert` and the packets in `packets`. The buffer, however, /// must be freed by the caller. /*/ -pgp_cert_t pgp_cert_merge_packets (pgp_error_t *errp, +pgp_cert_t pgp_cert_insert_packets (pgp_error_t *errp, pgp_cert_t cert, pgp_packet_t *packets, size_t packets_len); diff --git a/openpgp-ffi/src/cert.rs b/openpgp-ffi/src/cert.rs index c1040c11..450d2925 100644 --- a/openpgp-ffi/src/cert.rs +++ b/openpgp-ffi/src/cert.rs @@ -109,7 +109,7 @@ fn pgp_cert_merge(errp: Option<&mut *mut crate::error::Error>, /// Consumes `cert` and the packets in `packets`. The buffer, however, /// must be managed by the caller. #[::sequoia_ffi_macros::extern_fn] #[no_mangle] pub extern "C" -fn pgp_cert_merge_packets(errp: Option<&mut *mut crate::error::Error>, +fn pgp_cert_insert_packets(errp: Option<&mut *mut crate::error::Error>, cert: *mut Cert, packets: *mut *mut Packet, packets_len: size_t) @@ -120,7 +120,7 @@ fn pgp_cert_merge_packets(errp: Option<&mut *mut crate::error::Error>, }; let packets = packets.iter_mut().map(|&mut p| p.move_from_raw()); - cert.merge_packets(packets).move_into_raw(errp) + cert.insert_packets(packets).move_into_raw(errp) } /// Returns the fingerprint. @@ -220,7 +220,7 @@ fn int_to_reason_for_revocation(code: c_int) -> ReasonForRevocation { /// pgp_key_pair_free (primary_keypair); /// /// pgp_packet_t packet = pgp_signature_into_packet (revocation); -/// cert = pgp_cert_merge_packets (NULL, cert, &packet, 1); +/// cert = pgp_cert_insert_packets (NULL, cert, &packet, 1); /// assert (cert); /// /// pgp_revocation_status_t rs = pgp_cert_revocation_status (cert, policy, 0); @@ -278,7 +278,7 @@ fn pgp_cert_revoke_in_place(errp: Option<&mut *mut crate::error::Error>, let builder = CertRevocationBuilder::new(); let builder = ffi_try_or!(builder.set_reason_for_revocation(code, reason), None); let sig = builder.build(signer.as_mut(), &cert, None); - cert.merge_packets(sig).move_into_raw(errp) + cert.insert_packets(sig).move_into_raw(errp) } /// Returns whether the Cert is alive at the specified time. @@ -314,7 +314,7 @@ fn pgp_cert_set_expiration_time(errp: Option<&mut *mut crate::error::Error>, let sigs = ffi_try_or!(cert.set_expiration_time(policy, None, signer.as_mut(), maybe_time(expiry)), None); - cert.merge_packets(sigs).move_into_raw(errp) + cert.insert_packets(sigs).move_into_raw(errp) } /// Returns whether the Cert includes any secret key material. -- cgit v1.2.3