summaryrefslogtreecommitdiffstats
path: root/ffi
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2018-10-16 15:06:10 +0200
committerJustus Winter <justus@sequoia-pgp.org>2018-10-16 16:25:39 +0200
commit3d996ff3bc0e939caa6c0edb81c75e763d8c8344 (patch)
treef1d32b1d1b6531c8708cbf0d7641a93ac9f636c6 /ffi
parent09664cf092f19648c8d2a14ff1b76d418ed0a42f (diff)
openpgp: Improve the streaming writer API.
- Also, improve documentation and doctests.
Diffstat (limited to 'ffi')
-rw-r--r--ffi/include/sequoia/openpgp.h6
-rw-r--r--ffi/src/openpgp.rs10
2 files changed, 6 insertions, 10 deletions
diff --git a/ffi/include/sequoia/openpgp.h b/ffi/include/sequoia/openpgp.h
index 476f76b2..e95ed440 100644
--- a/ffi/include/sequoia/openpgp.h
+++ b/ffi/include/sequoia/openpgp.h
@@ -947,11 +947,9 @@ sq_status_t sq_packet_parser_decrypt (sq_context_t ctx,
typedef struct sq_writer_stack *sq_writer_stack_t;
/*/
-/// Wraps a `std::io::Write`r for use with the streaming subsystem.
-///
-/// XXX: This interface will likely change.
+/// Streams an OpenPGP message.
/*/
-sq_writer_stack_t sq_writer_stack_wrap (sq_writer_t writer);
+sq_writer_stack_t sq_writer_stack_message (sq_writer_t writer);
/*/
/// Writes up to `len` bytes of `buf` into `writer`.
diff --git a/ffi/src/openpgp.rs b/ffi/src/openpgp.rs
index b2d357e6..6ecc4b78 100644
--- a/ffi/src/openpgp.rs
+++ b/ffi/src/openpgp.rs
@@ -1524,7 +1524,7 @@ pub extern "system" fn sq_packet_parser_result_eof<'a>
use self::openpgp::serialize::{
writer,
stream::{
- wrap,
+ Message,
Cookie,
ArbitraryWriter,
Signer,
@@ -1535,11 +1535,9 @@ use self::openpgp::serialize::{
};
-/// Wraps a `std::io::Write`r for use with the streaming subsystem.
-///
-/// XXX: This interface will likely change.
+/// Streams an OpenPGP message.
#[no_mangle]
-pub extern "system" fn sq_writer_stack_wrap
+pub extern "system" fn sq_writer_stack_message
(writer: *mut Box<Write>)
-> *mut writer::Stack<'static, Cookie>
{
@@ -1547,7 +1545,7 @@ pub extern "system" fn sq_writer_stack_wrap
let writer = unsafe {
Box::from_raw(writer)
};
- box_raw!(wrap(writer))
+ box_raw!(Message::new(writer))
}
/// Writes up to `len` bytes of `buf` into `writer`.