8aeae03f9f447c8a792b215c9fb954468053c556Timo Sirainen/* Start building a message stream. The base_input contains the message
075081e25ef07989be10f7c9cf85f833f90be46fTimo Sirainen without attachments. The final stream must be exactly msg_size bytes.
075081e25ef07989be10f7c9cf85f833f90be46fTimo Sirainen If the original msg_size isn't known, it can be set to (uoff_t)-1. */
8aeae03f9f447c8a792b215c9fb954468053c556Timo Sirainenistream_attachment_connector_begin(struct istream *base_input, uoff_t msg_size);
8aeae03f9f447c8a792b215c9fb954468053c556Timo Sirainen/* Add the given input stream as attachment. The attachment starts at the given
8aeae03f9f447c8a792b215c9fb954468053c556Timo Sirainen start_offset in the (original) message. If base64_blocks_per_line is
8aeae03f9f447c8a792b215c9fb954468053c556Timo Sirainen non-zero, the input is base64-encoded with the given settings. The
8aeae03f9f447c8a792b215c9fb954468053c556Timo Sirainen (resulting base64-encoded) input must have exactly encoded_size bytes.
c48b861822f077e22723809e45dc1adda868200fTimo Sirainen Returns 0 if the input was ok, -1 if we've already reached msg_size or
c48b861822f077e22723809e45dc1adda868200fTimo Sirainen attachment offsets/sizes aren't valid. */
8aeae03f9f447c8a792b215c9fb954468053c556Timo Sirainenint istream_attachment_connector_add(struct istream_attachment_connector *conn,
8aeae03f9f447c8a792b215c9fb954468053c556Timo Sirainen const char **error_r);
8aeae03f9f447c8a792b215c9fb954468053c556Timo Sirainenistream_attachment_connector_finish(struct istream_attachment_connector **conn);