#define SNARF_CONTEXT(obj) \
MODULE_CONTEXT(obj, snarf_storage_module)
+#define SNARF_CONTEXT_REQUIRE(obj) \
+ MODULE_CONTEXT_REQUIRE(obj, snarf_storage_module)
struct snarf_mail_storage {
union mail_storage_module_context module_ctx;
static struct mailbox_sync_context *
snarf_sync_init(struct mailbox *box, enum mailbox_sync_flags flags)
{
- struct snarf_mailbox *sbox = SNARF_CONTEXT(box);
+ struct snarf_mailbox *sbox = SNARF_CONTEXT_REQUIRE(box);
(void)snarf(sbox->snarf_box, box);
/* close the mailbox so that we don't have to keep it locked */
static void snarf_mailbox_free(struct mailbox *box)
{
- struct snarf_mailbox *sbox = SNARF_CONTEXT(box);
+ struct snarf_mailbox *sbox = SNARF_CONTEXT_REQUIRE(box);
mailbox_free(&sbox->snarf_box);
sbox->module_ctx.super.free(box);
struct mailbox_list *list,
const char *vname, enum mailbox_flags flags)
{
- struct snarf_mail_storage *sstorage = SNARF_CONTEXT(storage);
+ struct snarf_mail_storage *sstorage = SNARF_CONTEXT_REQUIRE(storage);
struct mail_namespace *ns = mailbox_list_get_namespace(list);
struct mailbox *box;
struct mailbox_list *snarf_list;