1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen /* 0 while file is being created */
b9f564d00b7a115f465ffd6840341c7b8f9bfc8aTimo Sirainen /* list of attachment paths while saving/copying message */
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainenstruct dbox_file *sdbox_file_init(struct sdbox_mailbox *mbox, uint32_t uid);
e8762c2b4914db7997fa9eb644a91586952d1876Timo Sirainenstruct dbox_file *sdbox_file_create(struct sdbox_mailbox *mbox);
b9f564d00b7a115f465ffd6840341c7b8f9bfc8aTimo Sirainen/* Get file's extrefs metadata. */
b9f564d00b7a115f465ffd6840341c7b8f9bfc8aTimo Sirainenint sdbox_file_get_attachments(struct dbox_file *file, const char **extrefs_r);
b9f564d00b7a115f465ffd6840341c7b8f9bfc8aTimo Sirainen/* Returns attachment path for this file, given the source path. The result is
b9f564d00b7a115f465ffd6840341c7b8f9bfc8aTimo Sirainen always <hash>-<guid>-<mailbox_guid>-<uid>. The source path is expected to
b9f564d00b7a115f465ffd6840341c7b8f9bfc8aTimo Sirainen contain <hash>-<guid>[-*]. */
b9f564d00b7a115f465ffd6840341c7b8f9bfc8aTimo Sirainensdbox_file_attachment_relpath(struct sdbox_file *file, const char *srcpath);
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen/* Assign UID for a newly created file (by renaming it) */
172b6edea36e425b0d0c35a854721ae63f57c289Timo Sirainenint sdbox_file_assign_uid(struct sdbox_file *file, uint32_t uid,
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainenint sdbox_file_create_fd(struct dbox_file *file, const char *path,
c2d2161296e2361f97ee48b70b168602157069e6Timo Sirainen/* Move the file to alt path or back. */
c2d2161296e2361f97ee48b70b168602157069e6Timo Sirainenint sdbox_file_move(struct dbox_file *file, bool alt_path);
b9f564d00b7a115f465ffd6840341c7b8f9bfc8aTimo Sirainen/* Unlink file and all of its referenced attachments. */
b9f564d00b7a115f465ffd6840341c7b8f9bfc8aTimo Sirainenint sdbox_file_unlink_with_attachments(struct sdbox_file *sfile);
19557f192d37cd54a1a090a8a26d9d47265e4413Aki Tuomi/* Unlink file and its attachments when rolling back a saved message. */