4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen#ifndef RAW_STORAGE_H
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen#define RAW_STORAGE_H
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen#include "index-storage.h"
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen#define RAW_STORAGE_NAME "raw"
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen#define RAW_SUBSCRIPTION_FILE_NAME "subscriptions"
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainenstruct raw_storage {
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen struct mail_storage storage;
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen};
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainenstruct raw_mailbox {
d22301419109ed4a38351715e6760011421dadecTimo Sirainen struct mailbox box;
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen struct raw_storage *storage;
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen time_t mtime, ctime;
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen uoff_t size;
8fa302c0c0f110aecf266d20673aae567bd77f3bTimo Sirainen const char *envelope_sender;
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen
0dffa25d211be541ee3c953b23566a1a990789dfTimo Sirainen bool synced:1;
0dffa25d211be541ee3c953b23566a1a990789dfTimo Sirainen bool have_filename:1;
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen};
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen
8af1a286fb27446eeb0e7a8764cd3ed8d35ff2acJosef 'Jeff' Sipek#define RAW_STORAGE(s) container_of(s, struct raw_storage, storage)
8af1a286fb27446eeb0e7a8764cd3ed8d35ff2acJosef 'Jeff' Sipek#define RAW_MAILBOX(s) container_of(s, struct raw_mailbox, box)
8af1a286fb27446eeb0e7a8764cd3ed8d35ff2acJosef 'Jeff' Sipek
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainenextern struct mail_vfuncs raw_mail_vfuncs;
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen
34e9dfbce01a2807df8e2050b1cd7ae2cf014cd5Timo Sirainenstruct mail_user *
34e9dfbce01a2807df8e2050b1cd7ae2cf014cd5Timo Sirainenraw_storage_create_from_set(const struct setting_parser_info *set_info,
34e9dfbce01a2807df8e2050b1cd7ae2cf014cd5Timo Sirainen const struct mail_user_settings *set);
34e9dfbce01a2807df8e2050b1cd7ae2cf014cd5Timo Sirainen
15dd1857d40544e2c356d4f1c87c42a0579c665cTimo Sirainenint raw_mailbox_alloc_stream(struct mail_user *user, struct istream *input,
15dd1857d40544e2c356d4f1c87c42a0579c665cTimo Sirainen time_t received_time, const char *envelope_sender,
15dd1857d40544e2c356d4f1c87c42a0579c665cTimo Sirainen struct mailbox **box_r);
15dd1857d40544e2c356d4f1c87c42a0579c665cTimo Sirainenint raw_mailbox_alloc_path(struct mail_user *user, const char *path,
15dd1857d40544e2c356d4f1c87c42a0579c665cTimo Sirainen time_t received_time, const char *envelope_sender,
15dd1857d40544e2c356d4f1c87c42a0579c665cTimo Sirainen struct mailbox **box_r);
15dd1857d40544e2c356d4f1c87c42a0579c665cTimo Sirainen
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen#endif