b9f564d00b7a115f465ffd6840341c7b8f9bfc8aTimo Sirainen /* path without attachment_dir/ prefix */
b9f564d00b7a115f465ffd6840341c7b8f9bfc8aTimo Sirainen /* offset in input stream where part begins */
b9f564d00b7a115f465ffd6840341c7b8f9bfc8aTimo Sirainen /* If non-zero, this attachment was saved as base64-decoded and it
b9f564d00b7a115f465ffd6840341c7b8f9bfc8aTimo Sirainen need to be encoded back before presenting it to client. Each line
b9f564d00b7a115f465ffd6840341c7b8f9bfc8aTimo Sirainen (except last one) consists of this many base64 blocks (4 chars of
b9f564d00b7a115f465ffd6840341c7b8f9bfc8aTimo Sirainen base64 encoded data). */
b9f564d00b7a115f465ffd6840341c7b8f9bfc8aTimo Sirainen /* Line feeds are CRLF instead of LF */
b9f564d00b7a115f465ffd6840341c7b8f9bfc8aTimo SirainenARRAY_DEFINE_TYPE(mail_attachment_extref, struct mail_attachment_extref);
b9f564d00b7a115f465ffd6840341c7b8f9bfc8aTimo Sirainenvoid index_attachment_save_begin(struct mail_save_context *ctx,
b9f564d00b7a115f465ffd6840341c7b8f9bfc8aTimo Sirainenint index_attachment_save_continue(struct mail_save_context *ctx);
b9f564d00b7a115f465ffd6840341c7b8f9bfc8aTimo Sirainenint index_attachment_save_finish(struct mail_save_context *ctx);
b9f564d00b7a115f465ffd6840341c7b8f9bfc8aTimo Sirainenvoid index_attachment_save_free(struct mail_save_context *ctx);
b9f564d00b7a115f465ffd6840341c7b8f9bfc8aTimo Sirainenindex_attachment_save_get_extrefs(struct mail_save_context *ctx);
b9f564d00b7a115f465ffd6840341c7b8f9bfc8aTimo Sirainen/* Delete a given attachment name from storage
b9f564d00b7a115f465ffd6840341c7b8f9bfc8aTimo Sirainen (name is same as mail_attachment_extref.name). */
b9f564d00b7a115f465ffd6840341c7b8f9bfc8aTimo Sirainenint index_attachment_delete(struct mail_storage *storage,
52de839a8249bff5eace53dc1401b28baa0c124bTimo Sirainenvoid index_attachment_append_extrefs(string_t *str,
52de839a8249bff5eace53dc1401b28baa0c124bTimo Sirainen const ARRAY_TYPE(mail_attachment_extref) *extrefs);
52de839a8249bff5eace53dc1401b28baa0c124bTimo Sirainen/* Parse extrefs value to given array. Names are allocated from the
52de839a8249bff5eace53dc1401b28baa0c124bTimo Sirainen given pool. */
52de839a8249bff5eace53dc1401b28baa0c124bTimo Sirainenbool index_attachment_parse_extrefs(const char *line, pool_t pool,
52de839a8249bff5eace53dc1401b28baa0c124bTimo Sirainenint index_attachment_stream_get(struct fs *fs, const char *attachment_dir,