summaryrefslogtreecommitdiffstats
path: root/openpgp-ffi
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2020-10-01 12:06:14 +0200
committerJustus Winter <justus@sequoia-pgp.org>2020-10-02 15:09:10 +0200
commit46f9d859b56cfbbf8a0e41d76f2d0abaa055b73d (patch)
tree25cfaa36095be4568119fa555c14be84738b8a5f /openpgp-ffi
parent23cb4b184b8c710d5c54bd45dbad206d59ae36b3 (diff)
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.
Diffstat (limited to 'openpgp-ffi')
-rw-r--r--openpgp-ffi/include/sequoia/openpgp.h2
-rw-r--r--openpgp-ffi/src/cert.rs10
2 files changed, 6 insertions, 6 deletions
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.