summaryrefslogtreecommitdiffstats
path: root/openpgp-ffi/include/sequoia/openpgp.h
diff options
context:
space:
mode:
authorNeal H. Walfield <neal@pep.foundation>2019-05-11 14:48:09 +0200
committerNeal H. Walfield <neal@pep.foundation>2019-05-11 14:48:09 +0200
commit5a2688066b934f73ff4e69640f2bc47211a84451 (patch)
treebc7c83efc28b9df3cfb8b0b1bf0198be623ffcaa /openpgp-ffi/include/sequoia/openpgp.h
parentccaccf692688451e984e75b2d020a7077dc15546 (diff)
openpgp: Make {is,possible}_{message,keyring,tpk} return a Result
- PacketParserEOF::is_message, PacketParserEOF::is_keyring, PacketParserEOF::is_tpk, PacketParserResult::possible_message, PacketParserResult::possible_keyring, and PacketParserResult::possible_tpk returned a boolean. - Change them to return a Result<()> instead, which is more Rusty, and, in particular, allows the caller to determine why the message didn't parse.
Diffstat (limited to 'openpgp-ffi/include/sequoia/openpgp.h')
-rw-r--r--openpgp-ffi/include/sequoia/openpgp.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/openpgp-ffi/include/sequoia/openpgp.h b/openpgp-ffi/include/sequoia/openpgp.h
index b6fac2a6..1e9b7ef6 100644
--- a/openpgp-ffi/include/sequoia/openpgp.h
+++ b/openpgp-ffi/include/sequoia/openpgp.h
@@ -1195,8 +1195,12 @@ void pgp_packet_parser_free (pgp_packet_parser_t pp);
/*/
/// Returns whether the message is a well-formed OpenPGP message.
+///
+/// If the message is not well-formed, `*errp` explains why this is
+/// not the case.
/*/
-bool pgp_packet_parser_eof_is_message(pgp_packet_parser_eof_t eof);
+bool pgp_packet_parser_eof_is_message(pgp_error_t *errp,
+ pgp_packet_parser_eof_t eof);
/*/
/// Frees the packet parser EOF object.