diff options
author | Neal H. Walfield <neal@pep.foundation> | 2018-11-22 11:20:00 +0100 |
---|---|---|
committer | Neal H. Walfield <neal@pep.foundation> | 2018-11-22 11:20:00 +0100 |
commit | 2814bf1b4275e9a58f15059e20d249c667e572d5 (patch) | |
tree | df8a80c50426b78e6a479e586eb30394811c0ffb /ffi | |
parent | d42f3db864d2b4df1cda82b4f8f79dda7c48acab (diff) |
ffi: Wrap PacketParserEOF::is_message.
- Add sq_packet_parser_eof_is_message.
Diffstat (limited to 'ffi')
-rw-r--r-- | ffi/include/sequoia/openpgp.h | 5 | ||||
-rw-r--r-- | ffi/src/openpgp.rs | 10 |
2 files changed, 15 insertions, 0 deletions
diff --git a/ffi/include/sequoia/openpgp.h b/ffi/include/sequoia/openpgp.h index 0c7a67b9..0c01f070 100644 --- a/ffi/include/sequoia/openpgp.h +++ b/ffi/include/sequoia/openpgp.h @@ -1039,6 +1039,11 @@ void sq_packet_parser_result_free (sq_packet_parser_result_t ppr); void sq_packet_parser_free (sq_packet_parser_t pp); /*/ +/// Returns whether the message is a well-formed OpenPGP message. +/*/ +int sq_packet_parser_eof_is_message(sq_packet_parser_eof_t eof); + +/*/ /// Frees the packet parser EOF object. /*/ void sq_packet_parser_eof_free (sq_packet_parser_eof_t eof); diff --git a/ffi/src/openpgp.rs b/ffi/src/openpgp.rs index 87015901..dba14a60 100644 --- a/ffi/src/openpgp.rs +++ b/ffi/src/openpgp.rs @@ -1620,6 +1620,16 @@ pub extern "system" fn sq_packet_parser_free(pp: *mut PacketParser) { /// Frees the packet parser EOF object. #[no_mangle] +pub extern "system" fn sq_packet_parser_eof_is_message( + eof: Option<&PacketParserEOF>) -> bool +{ + let eof = eof.expect("EOF is NULL"); + + eof.is_message() +} + +/// Frees the packet parser EOF object. +#[no_mangle] pub extern "system" fn sq_packet_parser_eof_free(eof: *mut PacketParserEOF) { if eof.is_null() { return } unsafe { |