return strstr(cmd, "%f") && strstr(cmd, "%t");
}
+/**
+ * comp_msg_padding_size - Returns the padding between messages.
+ */
+static int comp_msg_padding_size(struct Context *ctx)
+{
+ if (!ctx)
+ return 0;
+
+ struct CompressInfo *ci = ctx->compress_info;
+ if (!ci)
+ return 0;
+
+ struct MxOps *ops = ci->child_ops;
+ if (!ops || !ops->msg_padding_size)
+ return 0;
+
+ return ops->msg_padding_size(ctx);
+}
+
/**
* comp_path_probe - Is this a compressed mailbox? - Implements MxOps::path_probe
*/
// clang-format off
/**
- * struct mx_comp_ops - Compressed mailbox - Implements ::MxOps
+ * struct mx_comp_ops - Compressed mailbox - Implements ::MxOps
*
* Compress only uses open, close and check.
* The message functions are delegated to mbox.
.msg_open_new = comp_msg_open_new,
.msg_commit = comp_msg_commit,
.msg_close = comp_msg_close,
+ .msg_padding_size = comp_msg_padding_size,
.tags_edit = NULL,
.tags_commit = NULL,
.path_probe = comp_path_probe,
return 0;
}
+static int mbox_msg_padding_size(struct Context *ctx)
+{
+ return 1;
+}
+
+static int mmdf_msg_padding_size(struct Context *ctx)
+{
+ return 10;
+}
+
/**
* reopen_mailbox - Close and reopen a mailbox
* @param ctx Mailbox
.msg_open_new = mbox_msg_open_new,
.msg_commit = mbox_msg_commit,
.msg_close = mbox_msg_close,
+ .msg_padding_size = mbox_msg_padding_size,
.tags_edit = NULL,
.tags_commit = NULL,
.path_probe = mbox_path_probe,
.msg_open_new = mbox_msg_open_new,
.msg_commit = mmdf_msg_commit,
.msg_close = mbox_msg_close,
+ .msg_padding_size = mmdf_msg_padding_size,
.tags_edit = NULL,
.tags_commit = NULL,
.path_probe = mbox_path_probe,
* @retval 0 Success
* @retval -1 Failure
*/
+ int (*msg_padding_size)(struct Context *ctx);
int (*tags_edit) (struct Context *ctx, const char *tags, char *buf, size_t buflen);
/**
* tags_edit - Prompt and validate new messages tags
};
/* Wrappers for the Mailbox API, see MxOps */
-int mx_mbox_check (struct Context *ctx, int *index_hint);
-int mx_mbox_close (struct Context **pctx, int *index_hint);
-struct Context *mx_mbox_open (const char *path, int flags);
-int mx_mbox_sync (struct Context *ctx, int *index_hint);
-int mx_msg_close (struct Context *ctx, struct Message **msg);
-int mx_msg_commit (struct Context *ctx, struct Message *msg);
-struct Message *mx_msg_open_new(struct Context *ctx, struct Header *hdr, int flags);
-struct Message *mx_msg_open (struct Context *ctx, int msgno);
-int mx_path_canon (char *buf, size_t buflen, const char *folder);
-int mx_path_parent (char *buf, size_t buflen);
-int mx_path_pretty (char *buf, size_t buflen, const char *folder);
-int mx_path_probe (const char *path, const struct stat *st);
-int mx_tags_commit (struct Context *ctx, struct Header *hdr, char *tags);
-int mx_tags_edit (struct Context *ctx, const char *tags, char *buf, size_t buflen);
+int mx_mbox_check (struct Context *ctx, int *index_hint);
+int mx_mbox_close (struct Context **pctx, int *index_hint);
+struct Context *mx_mbox_open (const char *path, int flags);
+int mx_mbox_sync (struct Context *ctx, int *index_hint);
+int mx_msg_close (struct Context *ctx, struct Message **msg);
+int mx_msg_commit (struct Context *ctx, struct Message *msg);
+struct Message *mx_msg_open_new (struct Context *ctx, struct Header *hdr, int flags);
+struct Message *mx_msg_open (struct Context *ctx, int msgno);
+int mx_msg_padding_size(struct Context *ctx);
+int mx_path_canon (char *buf, size_t buflen, const char *folder);
+int mx_path_parent (char *buf, size_t buflen);
+int mx_path_pretty (char *buf, size_t buflen, const char *folder);
+int mx_path_probe (const char *path, const struct stat *st);
+int mx_tags_commit (struct Context *ctx, struct Header *hdr, char *tags);
+int mx_tags_edit (struct Context *ctx, const char *tags, char *buf, size_t buflen);
int mx_access(const char *path, int flags);
void mx_alloc_memory(struct Context *ctx);