}
/**
- * comp_open_mailbox - Open a compressed mailbox
+ * comp_mbox_open - Open a compressed mailbox
* @param ctx Mailbox to open
* @retval 0 Success
* @retval -1 Error
* Then determine the type of the mailbox so we can delegate the handling of
* messages.
*/
-static int comp_open_mailbox(struct Context *ctx)
+static int comp_mbox_open(struct Context *ctx)
{
if (!ctx || (ctx->magic != MUTT_COMPRESSED))
return -1;
}
/**
- * comp_open_append_mailbox - Open a compressed mailbox for appending
+ * comp_mbox_open_append - Open a compressed mailbox for appending
* @param ctx Mailbox to open
* @param flags e.g. Does the file already exist?
* @retval 0 Success
* To append to a compressed mailbox we need an append-hook (or both open- and
* close-hooks).
*/
-static int comp_open_append_mailbox(struct Context *ctx, int flags)
+static int comp_mbox_open_append(struct Context *ctx, int flags)
{
if (!ctx)
return -1;
}
/**
- * comp_close_mailbox - Close a compressed mailbox
+ * comp_mbox_close - Close a compressed mailbox
* @param ctx Mailbox to close
* @retval 0 Success
* @retval -1 Failure
* If the mailbox has been changed then re-compress the tmp file.
* Then delete the tmp file.
*/
-static int comp_close_mailbox(struct Context *ctx)
+static int comp_mbox_close(struct Context *ctx)
{
if (!ctx)
return -1;
}
/**
- * comp_check_mailbox - Check for changes in the compressed file
+ * comp_mbox_check - Check for changes in the compressed file
* @param ctx Mailbox
* @param index_hint Currently selected mailbox
* @retval 0 Mailbox OK
*
* The return codes are picked to match mx_check_mailbox().
*/
-static int comp_check_mailbox(struct Context *ctx, int *index_hint)
+static int comp_mbox_check(struct Context *ctx, int *index_hint)
{
if (!ctx)
return -1;
}
/**
- * comp_open_message - Delegated to mbox handler
+ * comp_msg_open - Delegated to mbox handler
* @param ctx Mailbox
* @param msg Message to open
* @param msgno Message number
* @retval 0 Success
* @retval -1 Failure
*/
-static int comp_open_message(struct Context *ctx, struct Message *msg, int msgno)
+static int comp_msg_open(struct Context *ctx, struct Message *msg, int msgno)
{
if (!ctx)
return -1;
}
/**
- * comp_close_message - Delegated to mbox handler
+ * comp_msg_close - Delegated to mbox handler
* @param ctx Mailbox
* @param msg Message to close
* @retval 0 Success
* @retval -1 Failure
*/
-static int comp_close_message(struct Context *ctx, struct Message *msg)
+static int comp_msg_close(struct Context *ctx, struct Message *msg)
{
if (!ctx)
return -1;
}
/**
- * comp_commit_message - Delegated to mbox handler
+ * comp_msg_commit - Delegated to mbox handler
* @param ctx Mailbox
* @param msg Message to commit
* @retval 0 Success
* @retval -1 Failure
*/
-static int comp_commit_message(struct Context *ctx, struct Message *msg)
+static int comp_msg_commit(struct Context *ctx, struct Message *msg)
{
if (!ctx)
return -1;
}
/**
- * comp_open_new_message - Delegated to mbox handler
+ * comp_msg_open_new - Delegated to mbox handler
* @param ctx Mailbox
* @param msg Message to commit
* @param hdr Email header
* @retval 0 Success
* @retval -1 Failure
*/
-static int comp_open_new_message(struct Context *ctx, struct Message *msg, struct Header *hdr)
+static int comp_msg_open_new(struct Context *ctx, struct Message *msg, struct Header *hdr)
{
if (!ctx)
return -1;
}
/**
- * comp_sync_mailbox - Save changes to the compressed mailbox file
+ * comp_mbox_sync - Save changes to the compressed mailbox file
* @param ctx Mailbox to sync
* @param index_hint Currently selected mailbox
* @retval 0 Success
* @retval -1 Failure
*
- * Changes in NeoMutt only affect the tmp file. Calling comp_sync_mailbox()
+ * Changes in NeoMutt only affect the tmp file. Calling comp_mbox_sync()
* will commit them to the compressed file.
*/
-static int comp_sync_mailbox(struct Context *ctx, int *index_hint)
+static int comp_mbox_sync(struct Context *ctx, int *index_hint)
{
if (!ctx)
return -1;
return -1;
}
- int rc = comp_check_mailbox(ctx, index_hint);
+ int rc = comp_mbox_check(ctx, index_hint);
if (rc != 0)
goto sync_cleanup;
* The message functions are delegated to mbox.
*/
struct MxOps mx_comp_ops = {
- .mbox_open = comp_open_mailbox,
- .mbox_open_append = comp_open_append_mailbox,
- .mbox_check = comp_check_mailbox,
- .mbox_sync = comp_sync_mailbox,
- .mbox_close = comp_close_mailbox,
- .msg_open = comp_open_message,
- .msg_open_new = comp_open_new_message,
- .msg_commit = comp_commit_message,
- .msg_close = comp_close_message,
+ .mbox_open = comp_mbox_open,
+ .mbox_open_append = comp_mbox_open_append,
+ .mbox_check = comp_mbox_check,
+ .mbox_sync = comp_mbox_sync,
+ .mbox_close = comp_mbox_close,
+ .msg_open = comp_msg_open,
+ .msg_open_new = comp_msg_open_new,
+ .msg_commit = comp_msg_commit,
+ .msg_close = comp_msg_close,
.tags_edit = NULL,
.tags_commit = NULL,
};
}
/**
- * imap_open_mailbox - Open an IMAP mailbox
+ * imap_mbox_open - Open an IMAP mailbox
* @param ctx Context
* @retval 0 Success
* @retval -1 Failure
*/
-static int imap_open_mailbox(struct Context *ctx)
+static int imap_mbox_open(struct Context *ctx)
{
struct ImapData *idata = NULL;
struct ImapStatus *status = NULL;
}
/**
- * imap_open_mailbox_append - Open an IMAP mailbox to append
+ * imap_mbox_open_append - Open an IMAP mailbox to append
* @param ctx Context
* @param flags Mailbox flags (UNUSED)
* @retval 0 Success
* @retval -1 Failure
*/
-static int imap_open_mailbox_append(struct Context *ctx, int flags)
+static int imap_mbox_open_append(struct Context *ctx, int flags)
{
struct ImapData *idata = NULL;
char buf[LONG_STRING];
}
/**
- * imap_close_mailbox - Clean up IMAP data in Context
+ * imap_mbox_close - Clean up IMAP data in Context
* @param ctx Context
* @retval 0 Always
*/
-static int imap_close_mailbox(struct Context *ctx)
+static int imap_mbox_close(struct Context *ctx)
{
struct ImapData *idata = ctx->data;
/* Check to see if the mailbox is actually open */
if (!idata)
return 0;
- /* imap_open_mailbox_append() borrows the struct ImapData temporarily,
+ /* imap_mbox_open_append() borrows the struct ImapData temporarily,
* just for the connection, but does not set idata->ctx to the
* open-append ctx.
*
}
/**
- * imap_open_new_message - Open an IMAP message
+ * imap_msg_open_new - Open an IMAP message
* @param ctx Context (UNUSED)
* @param msg Message to open
* @param hdr Header (UNUSED)
* @retval 0 Success
* @retval -1 Failure
*/
-static int imap_open_new_message(struct Context *ctx, struct Message *msg, struct Header *hdr)
+static int imap_msg_open_new(struct Context *ctx, struct Message *msg, struct Header *hdr)
{
char tmp[_POSIX_PATH_MAX];
}
/**
- * imap_check_mailbox_reopen - Check for new mail (reopen mailbox if necessary)
+ * imap_mbox_check - Check for new mail (reopen mailbox if necessary)
* @param ctx Context
* @param index_hint Remember our place in the index
* @retval >0 Success, e.g. #MUTT_REOPENED
* @retval -1 Failure
*/
-static int imap_check_mailbox_reopen(struct Context *ctx, int *index_hint)
+static int imap_mbox_check(struct Context *ctx, int *index_hint)
{
int rc;
(void) index_hint;
}
/**
- * imap_edit_message_tags - Prompt and validate new messages tags
+ * imap_tags_edit - Prompt and validate new messages tags
* @param ctx Context
* @param tags Existing tags
* @param buf Buffer to store the tags
* @retval 0 No valid user input
* @retval 1 Buf set
*/
-static int imap_edit_message_tags(struct Context *ctx, const char *tags, char *buf, size_t buflen)
+static int imap_tags_edit(struct Context *ctx, const char *tags, char *buf, size_t buflen)
{
char *new = NULL;
char *checker = NULL;
}
/**
- * imap_commit_message_tags - Add/Change/Remove flags from headers
+ * imap_tags_commit - Add/Change/Remove flags from headers
* @param ctx Context
* @param hdr Header
* @param buf List of tags
* Also this method check that each flags is support by the server
* first and remove unsupported one.
*/
-static int imap_commit_message_tags(struct Context *ctx, struct Header *hdr, char *buf)
+static int imap_tags_commit(struct Context *ctx, struct Header *hdr, char *buf)
{
struct Buffer *cmd = NULL;
char uid[11];
* mx_imap_ops - Mailbox callback functions
*/
struct MxOps mx_imap_ops = {
- .mbox_open = imap_open_mailbox,
- .mbox_open_append = imap_open_mailbox_append,
- .mbox_check = imap_check_mailbox_reopen,
+ .mbox_open = imap_mbox_open,
+ .mbox_open_append = imap_mbox_open_append,
+ .mbox_check = imap_mbox_check,
.mbox_sync = NULL, /* imap syncing is handled by imap_sync_mailbox */
- .mbox_close = imap_close_mailbox,
- .msg_open = imap_fetch_message,
- .msg_open_new = imap_open_new_message,
- .msg_commit = imap_commit_message,
- .msg_close = imap_close_message,
- .tags_edit = imap_edit_message_tags,
- .tags_commit = imap_commit_message_tags,
+ .mbox_close = imap_mbox_close,
+ .msg_open = imap_msg_open,
+ .msg_open_new = imap_msg_open_new,
+ .msg_commit = imap_msg_commit,
+ .msg_close = imap_msg_close,
+ .tags_edit = imap_tags_edit,
+ .tags_commit = imap_tags_commit,
};
// clang-format on
int imap_cache_clean(struct ImapData *idata);
int imap_append_message(struct Context *ctx, struct Message *msg);
-int imap_fetch_message(struct Context *ctx, struct Message *msg, int msgno);
-int imap_close_message(struct Context *ctx, struct Message *msg);
-int imap_commit_message(struct Context *ctx, struct Message *msg);
+int imap_msg_open(struct Context *ctx, struct Message *msg, int msgno);
+int imap_msg_close(struct Context *ctx, struct Message *msg);
+int imap_msg_commit(struct Context *ctx, struct Message *msg);
/* util.c */
#ifdef USE_HCACHE
}
/**
- * imap_fetch_message - Fetch an email from an IMAP server
+ * imap_msg_open - Fetch an email from an IMAP server
* @param ctx Context
* @param msg Message to fetch
* @param msgno Index into ctr->hdrs
* @retval 0 Success
* @retval -1 Failure
*/
-int imap_fetch_message(struct Context *ctx, struct Message *msg, int msgno)
+int imap_msg_open(struct Context *ctx, struct Message *msg, int msgno)
{
struct Envelope *newenv = NULL;
char buf[LONG_STRING];
pc = imap_next_word(pc);
if (imap_get_literal_count(pc, &bytes) < 0)
{
- imap_error("imap_fetch_message()", buf);
+ imap_error("imap_msg_open()", buf);
goto bail;
}
if (output_progress)
}
/**
- * imap_close_message - Close an email
+ * imap_msg_close - Close an email
* @param ctx Context
* @param msg Email info
* @retval 0 Success
* @retval EOF Failure, see errno
*/
-int imap_close_message(struct Context *ctx, struct Message *msg)
+int imap_msg_close(struct Context *ctx, struct Message *msg)
{
return mutt_file_fclose(&msg->fp);
}
/**
- * imap_commit_message - Save changes to an email
+ * imap_msg_commit - Save changes to an email
* @param ctx Context
* @param msg Email info
* @retval 0 Success
* @retval EOF fclose() failed, see errno
* @retval -1 Failure
*/
-int imap_commit_message(struct Context *ctx, struct Message *msg)
+int imap_msg_commit(struct Context *ctx, struct Message *msg)
{
int r = mutt_file_fclose(&msg->fp);
}
/**
- * mbox_open_mailbox - open a mbox or mmdf style mailbox
+ * mbox_mbox_open - open a mbox or mmdf style mailbox
*/
-static int mbox_open_mailbox(struct Context *ctx)
+static int mbox_mbox_open(struct Context *ctx)
{
int rc;
return rc;
}
-static int mbox_open_mailbox_append(struct Context *ctx, int flags)
+static int mbox_mbox_open_append(struct Context *ctx, int flags)
{
ctx->fp = mutt_file_fopen(ctx->path, (flags & MUTT_NEWFOLDER) ? "w" : "a");
if (!ctx->fp)
return 0;
}
-static int mbox_close_mailbox(struct Context *ctx)
+static int mbox_mbox_close(struct Context *ctx)
{
if (!ctx->fp)
{
return 0;
}
-static int mbox_open_message(struct Context *ctx, struct Message *msg, int msgno)
+static int mbox_msg_open(struct Context *ctx, struct Message *msg, int msgno)
{
msg->fp = ctx->fp;
return 0;
}
-static int mbox_close_message(struct Context *ctx, struct Message *msg)
+static int mbox_msg_close(struct Context *ctx, struct Message *msg)
{
msg->fp = NULL;
return 0;
}
-static int mbox_commit_message(struct Context *ctx, struct Message *msg)
+static int mbox_msg_commit(struct Context *ctx, struct Message *msg)
{
if (fputc('\n', msg->fp) == EOF)
return -1;
return 0;
}
-static int mmdf_commit_message(struct Context *ctx, struct Message *msg)
+static int mmdf_msg_commit(struct Context *ctx, struct Message *msg)
{
if (fputs(MMDF_SEP, msg->fp) == EOF)
return -1;
return 0;
}
-static int mbox_open_new_message(struct Context *ctx, struct Message *msg, struct Header *hdr)
+static int mbox_msg_open_new(struct Context *ctx, struct Message *msg, struct Header *hdr)
{
msg->fp = ctx->fp;
return 0;
}
/**
- * mbox_check_mailbox - Has mailbox changed on disk
+ * mbox_mbox_check - Has mailbox changed on disk
* @param[in] ctx Context
* @param[out] index_hint Keep track of current index selection
* @retval #MUTT_REOPENED Mailbox has been reopened
* @retval 0 No change
* @retval -1 Error
*/
-static int mbox_check_mailbox(struct Context *ctx, int *index_hint)
+static int mbox_mbox_check(struct Context *ctx, int *index_hint)
{
struct stat st;
bool unlock = false;
}
/**
- * mbox_sync_mailbox - Sync a mailbox to disk
+ * mbox_mbox_sync - Sync a mailbox to disk
* @retval 0 Success
* @retval -1 Failure
*/
-static int mbox_sync_mailbox(struct Context *ctx, int *index_hint)
+static int mbox_mbox_sync(struct Context *ctx, int *index_hint)
{
char tempfile[_POSIX_PATH_MAX];
char buf[32];
}
/* Check to make sure that the file hasn't changed on disk */
- i = mbox_check_mailbox(ctx, index_hint);
+ i = mbox_mbox_check(ctx, index_hint);
if ((i == MUTT_NEW_MAIL) || (i == MUTT_REOPENED))
{
/* new mail arrived, or mailbox reopened */
// clang-format off
struct MxOps mx_mbox_ops = {
- .mbox_open = mbox_open_mailbox,
- .mbox_open_append = mbox_open_mailbox_append,
- .mbox_check = mbox_check_mailbox,
- .mbox_sync = mbox_sync_mailbox,
- .mbox_close = mbox_close_mailbox,
- .msg_open = mbox_open_message,
- .msg_open_new = mbox_open_new_message,
- .msg_commit = mbox_commit_message,
- .msg_close = mbox_close_message,
+ .mbox_open = mbox_mbox_open,
+ .mbox_open_append = mbox_mbox_open_append,
+ .mbox_check = mbox_mbox_check,
+ .mbox_sync = mbox_mbox_sync,
+ .mbox_close = mbox_mbox_close,
+ .msg_open = mbox_msg_open,
+ .msg_open_new = mbox_msg_open_new,
+ .msg_commit = mbox_msg_commit,
+ .msg_close = mbox_msg_close,
.tags_edit = NULL,
.tags_commit = NULL,
};
struct MxOps mx_mmdf_ops = {
- .mbox_open = mbox_open_mailbox,
- .mbox_open_append = mbox_open_mailbox_append,
- .mbox_check = mbox_check_mailbox,
- .mbox_sync = mbox_sync_mailbox,
- .mbox_close = mbox_close_mailbox,
- .msg_open = mbox_open_message,
- .msg_open_new = mbox_open_new_message,
- .msg_commit = mmdf_commit_message,
- .msg_close = mbox_close_message,
+ .mbox_open = mbox_mbox_open,
+ .mbox_open_append = mbox_mbox_open_append,
+ .mbox_check = mbox_mbox_check,
+ .mbox_sync = mbox_mbox_sync,
+ .mbox_close = mbox_mbox_close,
+ .msg_open = mbox_msg_open,
+ .msg_open_new = mbox_msg_open_new,
+ .msg_commit = mmdf_msg_commit,
+ .msg_close = mbox_msg_close,
.tags_edit = NULL,
.tags_commit = NULL,
};
mh_sort_natural(ctx, md);
}
-static int mh_close_mailbox(struct Context *ctx)
+static int mh_mbox_close(struct Context *ctx)
{
FREE(&ctx->data);
return 0;
}
-static int maildir_open_mailbox(struct Context *ctx)
+static int maildir_mbox_open(struct Context *ctx)
{
return maildir_read_dir(ctx);
}
-static int maildir_open_mailbox_append(struct Context *ctx, int flags)
+static int maildir_mbox_open_append(struct Context *ctx, int flags)
{
if (!(flags & MUTT_APPENDNEW))
{
return 0;
}
-static int mh_open_mailbox(struct Context *ctx)
+static int mh_mbox_open(struct Context *ctx)
{
return mh_read_dir(ctx, NULL);
}
-static int mh_open_mailbox_append(struct Context *ctx, int flags)
+static int mh_mbox_open_append(struct Context *ctx, int flags)
{
if (!(flags & MUTT_APPENDNEW))
{
* Open a new (temporary) message in an MH folder.
*/
-static int mh_open_new_message(struct Context *ctx, struct Message *msg, struct Header *hdr)
+static int mh_msg_open_new(struct Context *ctx, struct Message *msg, struct Header *hdr)
{
return mh_mkstemp(ctx, &msg->fp, &msg->path);
}
return 0;
}
-static int maildir_open_message(struct Context *ctx, struct Message *msg, int msgno)
+static int maildir_msg_open(struct Context *ctx, struct Message *msg, int msgno)
{
return maildir_mh_open_message(ctx, msg, msgno, 1);
}
-static int mh_open_message(struct Context *ctx, struct Message *msg, int msgno)
+static int mh_msg_open(struct Context *ctx, struct Message *msg, int msgno)
{
return maildir_mh_open_message(ctx, msg, msgno, 0);
}
-static int mh_close_message(struct Context *ctx, struct Message *msg)
+static int mh_msg_close(struct Context *ctx, struct Message *msg)
{
return mutt_file_fclose(&msg->fp);
}
/**
- * maildir_open_new_message - Open a new message in a maildir folder
+ * maildir_msg_open_new - Open a new message in a maildir folder
*
* Open a new (temporary) message in a maildir folder.
*
* Note that this uses _almost_ the maildir file name format,
* but with a {cur,new} prefix.
*/
-static int maildir_open_new_message(struct Context *ctx, struct Message *msg,
+static int maildir_msg_open_new(struct Context *ctx, struct Message *msg,
struct Header *hdr)
{
int fd;
*
* tmp/{cur,new}.neomutt-HOSTNAME-PID-COUNTER:flags
*
- * See also maildir_open_new_message().
+ * See also maildir_msg_open_new().
*/
static int md_commit_message(struct Context *ctx, struct Message *msg, struct Header *hdr)
{
}
}
-static int maildir_commit_message(struct Context *ctx, struct Message *msg)
+static int maildir_msg_commit(struct Context *ctx, struct Message *msg)
{
return md_commit_message(ctx, msg, NULL);
}
return 0;
}
-static int mh_commit_message(struct Context *ctx, struct Message *msg)
+static int mh_msg_commit(struct Context *ctx, struct Message *msg)
{
return mh_commit_msg(ctx, msg, NULL, 1);
}
}
/**
- * maildir_check_mailbox - Check for new mail
+ * maildir_mbox_check - Check for new mail
*
* This function handles arrival of new mail and reopening of maildir folders.
* The basic idea here is we check to see if either the new or cur
* already knew about. We don't treat either subdirectory differently, as mail
* could be copied directly into the cur directory from another agent.
*/
-static int maildir_check_mailbox(struct Context *ctx, int *index_hint)
+static int maildir_mbox_check(struct Context *ctx, int *index_hint)
{
struct stat st_new; /* status of the "new" subdirectory */
struct stat st_cur; /* status of the "cur" subdirectory */
}
/**
- * mh_check_mailbox - Check for new mail
+ * mh_mbox_check - Check for new mail
*
* This function handles arrival of new mail and reopening of mh/maildir
* folders. Things are getting rather complex because we don't have a
*
* Don't change this code unless you _really_ understand what happens.
*/
-static int mh_check_mailbox(struct Context *ctx, int *index_hint)
+static int mh_mbox_check(struct Context *ctx, int *index_hint)
{
char buf[_POSIX_PATH_MAX];
struct stat st, st_cur;
return 0;
}
-static int mh_sync_mailbox(struct Context *ctx, int *index_hint)
+static int mh_mbox_sync(struct Context *ctx, int *index_hint)
{
int i, j;
#ifdef USE_HCACHE
struct Progress progress;
if (ctx->magic == MUTT_MH)
- i = mh_check_mailbox(ctx, index_hint);
+ i = mh_mbox_check(ctx, index_hint);
else
- i = maildir_check_mailbox(ctx, index_hint);
+ i = maildir_mbox_check(ctx, index_hint);
if (i != 0)
return i;
// clang-format off
struct MxOps mx_maildir_ops = {
- .mbox_open = maildir_open_mailbox,
- .mbox_open_append = maildir_open_mailbox_append,
- .mbox_check = maildir_check_mailbox,
- .mbox_sync = mh_sync_mailbox,
- .mbox_close = mh_close_mailbox,
- .msg_open = maildir_open_message,
- .msg_open_new = maildir_open_new_message,
- .msg_commit = maildir_commit_message,
- .msg_close = mh_close_message,
+ .mbox_open = maildir_mbox_open,
+ .mbox_open_append = maildir_mbox_open_append,
+ .mbox_check = maildir_mbox_check,
+ .mbox_sync = mh_mbox_sync,
+ .mbox_close = mh_mbox_close,
+ .msg_open = maildir_msg_open,
+ .msg_open_new = maildir_msg_open_new,
+ .msg_commit = maildir_msg_commit,
+ .msg_close = mh_msg_close,
.tags_edit = NULL,
.tags_commit = NULL,
};
struct MxOps mx_mh_ops = {
- .mbox_open = mh_open_mailbox,
- .mbox_open_append = mh_open_mailbox_append,
- .mbox_check = mh_check_mailbox,
- .mbox_sync = mh_sync_mailbox,
- .mbox_close = mh_close_mailbox,
- .msg_open = mh_open_message,
- .msg_open_new = mh_open_new_message,
- .msg_commit = mh_commit_message,
- .msg_close = mh_close_message,
+ .mbox_open = mh_mbox_open,
+ .mbox_open_append = mh_mbox_open_append,
+ .mbox_check = mh_mbox_check,
+ .mbox_sync = mh_mbox_sync,
+ .mbox_close = mh_mbox_close,
+ .msg_open = mh_msg_open,
+ .msg_open_new = mh_msg_open_new,
+ .msg_commit = mh_msg_commit,
+ .msg_close = mh_msg_close,
.tags_edit = NULL,
.tags_commit = NULL,
};
if (newpath)
{
- /* remember that file has been moved -- nm_sync_mailbox() will update the DB */
+ /* remember that file has been moved -- nm_mbox_sync() will update the DB */
struct NmHdrData *hd = (struct NmHdrData *) h->data;
if (hd)
}
/**
- * nm_edit_message_tags - Prompt new messages tags
+ * nm_tags_edit - Prompt new messages tags
* @param ctx Mailbox
* @param tags Existing tags (UNUSED)
* @param buf Buffer for message tags
* @retval 0 No valid user input
* @retval 1 Buffer set
*/
-static int nm_edit_message_tags(struct Context *ctx, const char *tags, char *buf, size_t buflen)
+static int nm_tags_edit(struct Context *ctx, const char *tags, char *buf, size_t buflen)
{
*buf = '\0';
if (mutt_get_field("Add/remove labels: ", buf, buflen, MUTT_NM_TAG) != 0)
}
/**
- * nm_commit_message_tags - Save the tags to a message
+ * nm_tags_commit - Save the tags to a message
* @param ctx Mailbox
* @param hdr Email Header
* @param buf Buffer containing tags
* @retval 0 Success
* @retval -1 Failure
*/
-static int nm_commit_message_tags(struct Context *ctx, struct Header *hdr, char *buf)
+static int nm_tags_commit(struct Context *ctx, struct Header *hdr, char *buf)
{
struct NmCtxData *data = get_ctxdata(ctx);
notmuch_database_t *db = NULL;
}
/**
- * nm_open_mailbox - Open a notmuch virtual mailbox
+ * nm_mbox_open - Open a notmuch virtual mailbox
* @param ctx Mailbox
* @retval 0 Success
* @retval -1 Error
*/
-static int nm_open_mailbox(struct Context *ctx)
+static int nm_mbox_open(struct Context *ctx)
{
notmuch_query_t *q = NULL;
struct NmCtxData *data = NULL;
}
/**
- * nm_close_mailbox - Close a notmuch virtual mailbox
+ * nm_mbox_close - Close a notmuch virtual mailbox
* @param ctx Mailbox
* @retval 0 Success
* @retval -1 Error
*/
-static int nm_close_mailbox(struct Context *ctx)
+static int nm_mbox_close(struct Context *ctx)
{
if (!ctx || (ctx->magic != MUTT_NOTMUCH))
return -1;
}
/**
- * nm_check_mailbox - Check a notmuch mailbox for new mail
+ * nm_mbox_check - Check a notmuch mailbox for new mail
* @param ctx Mailbox
* @param index_hint Remember our place in the index
* @retval -1 Error
* @retval #MUTT_REOPENED Mailbox closed and reopened
* @retval #MUTT_FLAGS Flags have changed
*/
-static int nm_check_mailbox(struct Context *ctx, int *index_hint)
+static int nm_mbox_check(struct Context *ctx, int *index_hint)
{
struct NmCtxData *data = get_ctxdata(ctx);
time_t mtime = 0;
}
/**
- * nm_sync_mailbox - Sync a notmuch mailbox
+ * nm_mbox_sync - Sync a notmuch mailbox
* @param ctx Mailbox
* @param index_hint Remember our place in the index
* @retval 0 Success
* @retval -1 Failure
*/
-static int nm_sync_mailbox(struct Context *ctx, int *index_hint)
+static int nm_mbox_sync(struct Context *ctx, int *index_hint)
{
struct NmCtxData *data = get_ctxdata(ctx);
int rc = 0;
}
/**
- * nm_open_message - Open a message from a notmuch mailbox
+ * nm_msg_open - Open a message from a notmuch mailbox
* @param ctx Mailbox
* @param msg Message to open
* @param msgno Index of message to open
* @retval 0 Success
* @retval 1 Error
*/
-static int nm_open_message(struct Context *ctx, struct Message *msg, int msgno)
+static int nm_msg_open(struct Context *ctx, struct Message *msg, int msgno)
{
if (!ctx || !msg)
return 1;
}
/**
- * nm_close_message - Close a message
+ * nm_msg_close - Close a message
* @param ctx Mailbox
* @param msg Message to close
* @retval 0 Success
* @retval 1 Error
*/
-static int nm_close_message(struct Context *ctx, struct Message *msg)
+static int nm_msg_close(struct Context *ctx, struct Message *msg)
{
if (!msg)
return 1;
}
/**
- * nm_commit_message - Save the changes to a message
+ * nm_msg_commit - Save the changes to a message
* @param ctx Mailbox
* @param msg Message to commit
* @retval -1 Always
*/
-static int nm_commit_message(struct Context *ctx, struct Message *msg)
+static int nm_msg_commit(struct Context *ctx, struct Message *msg)
{
mutt_error(_("Can't write to virtual folder."));
return -1;
* These functions are common to all mailbox types.
*/
struct MxOps mx_notmuch_ops = {
- .mbox_open = nm_open_mailbox, /* calls init_context() */
+ .mbox_open = nm_mbox_open, /* calls init_context() */
.mbox_open_append = NULL,
- .mbox_check = nm_check_mailbox,
- .mbox_sync = nm_sync_mailbox,
- .mbox_close = nm_close_mailbox,
- .msg_open = nm_open_message,
+ .mbox_check = nm_mbox_check,
+ .mbox_sync = nm_mbox_sync,
+ .mbox_close = nm_mbox_close,
+ .msg_open = nm_msg_open,
.msg_open_new = NULL,
- .msg_commit = nm_commit_message,
- .msg_close = nm_close_message,
- .tags_edit = nm_edit_message_tags,
- .tags_commit = nm_commit_message_tags,
+ .msg_commit = nm_msg_commit,
+ .msg_close = nm_msg_close,
+ .tags_edit = nm_tags_edit,
+ .tags_commit = nm_tags_commit,
};
// clang-format on
}
/**
- * nntp_open_mailbox - Open newsgroup
+ * nntp_mbox_open - Open newsgroup
* @param ctx Mailbox
* @retval 0 Success
* @retval -1 Failure
*/
-static int nntp_open_mailbox(struct Context *ctx)
+static int nntp_mbox_open(struct Context *ctx)
{
struct NntpServer *nserv = NULL;
struct NntpData *nntp_data = NULL;
}
/**
- * nntp_open_message - Fetch message
+ * nntp_msg_open - Fetch message
* @param ctx Mailbox
* @param msg Message to fetch
* @param msgno Message number
* @retval 0 Success
* @retval -1 Failure
*/
-static int nntp_open_message(struct Context *ctx, struct Message *msg, int msgno)
+static int nntp_msg_open(struct Context *ctx, struct Message *msg, int msgno)
{
struct NntpData *nntp_data = ctx->data;
struct Header *hdr = ctx->hdrs[msgno];
}
/**
- * nntp_close_message - Close message
+ * nntp_msg_close - Close message
* @param ctx Mailbox
* @param msg Message to close
* @retval 0 Success
* @retval EOF Error, see errno
*/
-static int nntp_close_message(struct Context *ctx, struct Message *msg)
+static int nntp_msg_close(struct Context *ctx, struct Message *msg)
{
return mutt_file_fclose(&msg->fp);
}
}
/**
- * nntp_check_mailbox - Check current newsgroup for new articles
+ * nntp_mbox_check - Check current newsgroup for new articles
* @param ctx Mailbox
* @param index_hint Current message (UNUSED)
* @retval #MUTT_REOPENED Articles have been renumbered or removed from server
* @retval 0 No change
* @retval -1 Lost connection
*/
-static int nntp_check_mailbox(struct Context *ctx, int *index_hint)
+static int nntp_mbox_check(struct Context *ctx, int *index_hint)
{
int ret = check_mailbox(ctx);
if (ret == 0)
}
/**
- * nntp_sync_mailbox - Save changes to .newsrc and cache
+ * nntp_mbox_sync - Save changes to .newsrc and cache
* @param ctx Mailbox
* @param index_hint Current message (UNUSED)
* @retval 0 Success
*
* @note May also return values from check_mailbox()
*/
-static int nntp_sync_mailbox(struct Context *ctx, int *index_hint)
+static int nntp_mbox_sync(struct Context *ctx, int *index_hint)
{
struct NntpData *nntp_data = ctx->data;
int rc;
}
/**
- * nntp_close_mailbox - Free up memory associated with the newsgroup context
+ * nntp_mbox_close - Free up memory associated with the newsgroup context
* @param ctx Mailbox
* @retval 0 Always
*/
-static int nntp_close_mailbox(struct Context *ctx)
+static int nntp_mbox_close(struct Context *ctx)
{
struct NntpData *nntp_data = ctx->data, *nntp_tmp = NULL;
// clang-format off
struct MxOps mx_nntp_ops = {
- .mbox_open = nntp_open_mailbox,
+ .mbox_open = nntp_mbox_open,
.mbox_open_append = NULL,
- .mbox_check = nntp_check_mailbox,
- .mbox_sync = nntp_sync_mailbox,
- .mbox_close = nntp_close_mailbox,
- .msg_open = nntp_open_message,
+ .mbox_check = nntp_mbox_check,
+ .mbox_sync = nntp_mbox_sync,
+ .mbox_close = nntp_mbox_close,
+ .msg_open = nntp_msg_open,
.msg_open_new = NULL,
.msg_commit = NULL,
- .msg_close = nntp_close_message,
+ .msg_close = nntp_msg_close,
.tags_edit = NULL,
.tags_commit = NULL,
};