struct Mailbox *m_comp = NULL;
if (ctx_save->mailbox->compress_info)
{
- m_comp = mutt_find_mailbox(ctx_save->mailbox->realpath);
+ m_comp = mutt_mailbox_find(ctx_save->mailbox->realpath);
}
/* We probably haven't been opened yet */
if (m_comp && (m_comp->msg_count == 0))
{
first = true; /* clear input if user types a real key later */
mutt_mb_wcstombs(buf, buflen, state->wbuf, state->curpos);
- mutt_mailbox(Context ? Context->mailbox : NULL, buf, buflen);
+ mutt_mailbox_next(Context ? Context->mailbox : NULL, buf, buflen);
state->curpos = state->lastchar =
mutt_mb_mbstowcs(&state->wbuf, &state->wbuflen, 0, buf);
break;
{
// Try to see if the buffer matches a description before we bail.
// We'll receive a non-null pointer if there is a corresponding mailbox.
- m = mutt_find_mailbox_desc(buf);
+ m = mutt_mailbox_find_desc(buf);
if (m)
{
magic = m->magic;
{
mutt_buffer_strcpy(folderbuf, mutt_b2s(Context->mailbox->pathbuf));
mutt_buffer_pretty_mailbox(folderbuf);
- mutt_buffer_mailbox(Context ? Context->mailbox : NULL, folderbuf);
+ mutt_mailbox_next_buffer(Context ? Context->mailbox : NULL, folderbuf);
if (mutt_buffer_is_empty(folderbuf))
{
mutt_error(_("No mailboxes have new mail"));
{
/* By default, fill buf with the next mailbox that contains unread
* mail */
- mutt_buffer_mailbox(Context ? Context->mailbox : NULL, folderbuf);
+ mutt_mailbox_next_buffer(Context ? Context->mailbox : NULL, folderbuf);
}
if (mutt_buffer_enter_fname(cp, folderbuf, true) == -1)
if (C_CheckMboxSize)
{
- struct Mailbox *m = mutt_find_mailbox(path);
+ struct Mailbox *m = mutt_mailbox_find(path);
if (m && !m->has_new)
- mutt_update_mailbox(m);
+ mutt_mailbox_update(m);
}
else
{
}
/**
- * mutt_find_mailbox - Find the mailbox with a given path
+ * mutt_mailbox_find - Find the mailbox with a given path
* @param path Path to match
* @retval ptr Matching Mailbox
*/
-struct Mailbox *mutt_find_mailbox(const char *path)
+struct Mailbox *mutt_mailbox_find(const char *path)
{
if (!path)
return NULL;
}
/**
- * mutt_find_mailbox_desc - Find the mailbox with a given description
+ * mutt_mailbox_find_desc - Find the mailbox with a given description
* @param desc Description to match
* @retval ptr Matching Mailbox
* @retval NULL No matching mailbox found
*/
-struct Mailbox *mutt_find_mailbox_desc(const char *desc)
+struct Mailbox *mutt_mailbox_find_desc(const char *desc)
{
if (!desc)
return NULL;
}
/**
- * mutt_update_mailbox - Get the mailbox's current size
+ * mutt_mailbox_update - Get the mailbox's current size
* @param m Mailbox to check
*/
-void mutt_update_mailbox(struct Mailbox *m)
+void mutt_mailbox_update(struct Mailbox *m)
{
struct stat sb;
}
/**
- * mutt_mailbox_setnotified - Note when the user was last notified of new mail
+ * mutt_mailbox_set_notified - Note when the user was last notified of new mail
* @param m Mailbox
*/
-void mutt_mailbox_setnotified(struct Mailbox *m)
+void mutt_mailbox_set_notified(struct Mailbox *m)
{
if (!m)
return;
}
/**
- * mutt_buffer_mailbox - incoming folders completion routine
+ * mutt_mailbox_next_buffer - incoming folders completion routine
* @param m_cur Current Mailbox
* @param s Buffer containing name of current mailbox
*
* Given a folder name, find the next incoming folder with new mail.
*/
-void mutt_buffer_mailbox(struct Mailbox *m_cur, struct Buffer *s)
+void mutt_mailbox_next_buffer(struct Mailbox *m_cur, struct Buffer *s)
{
mutt_buffer_expand_path(s);
if (np->mailbox->magic == MUTT_NOTMUCH) /* only match real mailboxes */
continue;
mutt_buffer_expand_path(np->mailbox->pathbuf);
- if ((found || pass) && np->mailbox->has_new)
+ if ((found || (pass > 0)) && np->mailbox->has_new)
{
mutt_buffer_strcpy(s, mutt_b2s(np->mailbox->pathbuf));
mutt_buffer_pretty_mailbox(s);
}
/**
- * mutt_mailbox - incoming folders completion routine
+ * mutt_mailbox_next - incoming folders completion routine
* @param m_cur Current Mailbox
* @param s Buffer containing name of current mailbox
* @param slen Buffer length
*
* Given a folder name, find the next incoming folder with new mail.
*/
-void mutt_mailbox(struct Mailbox *m_cur, char *s, size_t slen)
+void mutt_mailbox_next(struct Mailbox *m_cur, char *s, size_t slen)
{
struct Buffer *s_buf = mutt_buffer_pool_get();
mutt_buffer_addstr(s_buf, NONULL(s));
- mutt_buffer_mailbox(m_cur, s_buf);
+ mutt_mailbox_next_buffer(m_cur, s_buf);
mutt_str_strfcpy(s, mutt_b2s(s_buf), slen);
mutt_buffer_pool_release(&s_buf);
#define MUTT_ACL_ALL ((1 << 11) - 1)
+/* force flags passed to mutt_mailbox_check() */
+#define MUTT_MAILBOX_CHECK_FORCE (1 << 0)
+#define MUTT_MAILBOX_CHECK_FORCE_STATS (1 << 1)
+
/**
* struct Mailbox - A mailbox
*/
extern struct MailboxList AllMailboxes; ///< List of all Mailboxes
-struct Mailbox *mailbox_new(void);
-void mailbox_free(struct Mailbox **ptr);
-
-struct Mailbox *mutt_find_mailbox(const char *path);
-struct Mailbox *mutt_find_mailbox_desc(const char *desc);
-void mutt_update_mailbox(struct Mailbox *m);
-
-void mutt_mailbox_cleanup(const char *path, struct stat *st);
-
-/** mark mailbox just left as already notified */
-void mutt_mailbox_setnotified(struct Mailbox *m);
-
-/* force flags passed to mutt_mailbox_check() */
-#define MUTT_MAILBOX_CHECK_FORCE (1 << 0)
-#define MUTT_MAILBOX_CHECK_FORCE_STATS (1 << 1)
-
-void mutt_buffer_mailbox(struct Mailbox *m_cur, struct Buffer *s);
-void mutt_mailbox(struct Mailbox *m_cur, char *s, size_t slen);
-bool mutt_mailbox_list(void);
-int mutt_mailbox_check(struct Mailbox *m_cur, int force);
-bool mutt_mailbox_notify(struct Mailbox *m_cur);
-void mutt_mailbox_changed(struct Mailbox *m, enum MailboxNotification action);
-
-void mutt_mailbox_size_add(struct Mailbox *m, const struct Email *e);
-void mutt_mailbox_size_sub(struct Mailbox *m, const struct Email *e);
+void mailbox_free (struct Mailbox **ptr);
+struct Mailbox *mailbox_new (void);
+void mutt_mailbox_changed (struct Mailbox *m, enum MailboxNotification action);
+int mutt_mailbox_check (struct Mailbox *m_cur, int force);
+void mutt_mailbox_cleanup (const char *path, struct stat *st);
+struct Mailbox *mutt_mailbox_find (const char *path);
+struct Mailbox *mutt_mailbox_find_desc (const char *desc);
+bool mutt_mailbox_list (void);
+void mutt_mailbox_next_buffer (struct Mailbox *m_cur, struct Buffer *s);
+void mutt_mailbox_next (struct Mailbox *m_cur, char *s, size_t slen);
+bool mutt_mailbox_notify (struct Mailbox *m_cur);
+void mutt_mailbox_set_notified(struct Mailbox *m);
+void mutt_mailbox_size_add (struct Mailbox *m, const struct Email *e);
+void mutt_mailbox_size_sub (struct Mailbox *m, const struct Email *e);
+void mutt_mailbox_update (struct Mailbox *m);
#endif /* MUTT_MAILBOX_H */
goto main_curses; // TEST37: neomutt -Z (no new mail)
}
mutt_buffer_reset(folder);
- mutt_buffer_mailbox(Context ? Context->mailbox : NULL, folder);
+ mutt_mailbox_next_buffer(Context ? Context->mailbox : NULL, folder);
#ifdef USE_IMAP
C_ImapPassive = passive;
#endif
if (C_Spoolfile)
{
// Check if C_Spoolfile corresponds a mailboxes' description.
- struct Mailbox *desc_m = mutt_find_mailbox_desc(C_Spoolfile);
+ struct Mailbox *desc_m = mutt_mailbox_find_desc(C_Spoolfile);
if (desc_m)
mutt_buffer_strcpy(folder, desc_m->realpath);
else
if (C_CheckMboxSize)
{
- struct Mailbox *tmp = mutt_find_mailbox(mutt_b2s(m->pathbuf));
+ struct Mailbox *tmp = mutt_mailbox_find(mutt_b2s(m->pathbuf));
if (tmp && !tmp->has_new)
- mutt_update_mailbox(tmp);
+ mutt_mailbox_update(tmp);
}
return 0; /* signal success */
}
else
{
- if (mutt_find_mailbox(Context->mailbox->realpath))
+ if (mutt_mailbox_find(Context->mailbox->realpath))
{
rc = 1;
goto cleanup;
/* never announce that a mailbox we've just left has new mail. #3290
* TODO: really belongs in mx_mbox_close, but this is a nice hook point */
if (!m->peekonly)
- mutt_mailbox_setnotified(m);
+ mutt_mailbox_set_notified(m);
if (m->mx_ops)
m->mx_ops->mbox_close(m);