1
#ifndef ISTREAM_ATTACHMENT_CONNECTOR_H
2
#define ISTREAM_ATTACHMENT_CONNECTOR_H
4
/* Start building a message stream. The base_input contains the message
5
without attachments. The final stream must be exactly msg_size bytes. */
6
struct istream_attachment_connector *
7
istream_attachment_connector_begin(struct istream *base_input, uoff_t msg_size);
9
/* Add the given input stream as attachment. The attachment starts at the given
10
start_offset in the (original) message. If base64_blocks_per_line is
11
non-zero, the input is base64-encoded with the given settings. The
12
(resulting base64-encoded) input must have exactly encoded_size bytes.
14
Returns 0 if the input was ok, -1 if we've already reached msg_size or
15
attachment offsets/sizes aren't valid. */
16
int istream_attachment_connector_add(struct istream_attachment_connector *conn,
17
struct istream *decoded_input,
18
uoff_t start_offset, uoff_t encoded_size,
19
unsigned int base64_blocks_per_line,
20
bool base64_have_crlf,
21
const char **error_r);
24
istream_attachment_connector_finish(struct istream_attachment_connector **conn);
25
void istream_attachment_connector_abort(struct istream_attachment_connector **conn);