From: Mehdi Abaakouk Date: Wed, 14 Nov 2018 08:47:28 +0000 (+0100) Subject: imap: remove ImapMbox and imap_parse_path() X-Git-Tag: 2019-10-25~529^2~12 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fd2cc415b2392c2fa51e7caeb2e96f7be618c243;p=neomutt imap: remove ImapMbox and imap_parse_path() --- diff --git a/imap/imap.c b/imap/imap.c index 7e5a00982..b0f9d926e 100644 --- a/imap/imap.c +++ b/imap/imap.c @@ -2073,9 +2073,6 @@ int imap_ac_add(struct Account *a, struct Mailbox *m) if (m->magic != MUTT_IMAP) return -1; - // NOTE(sileht): The goal is to use ImapMbox and imap_parse_path() only here - // So we can remove it at this end. - if (!a->adata) { struct ConnAccount *conn_account = mutt_mem_calloc(1, sizeof(struct ConnAccount)); diff --git a/imap/imap.h b/imap/imap.h index 96d37b657..4ffda85e7 100644 --- a/imap/imap.h +++ b/imap/imap.h @@ -75,15 +75,6 @@ extern bool ImapServernoise; extern char *ImapDelimChars; extern short ImapPipelineDepth; -/** - * struct ImapMbox - An IMAP mailbox - */ -struct ImapMbox -{ - struct ConnAccount account; - char *mbox; -}; - /* imap.c */ int imap_access(const char *path); int imap_check_mailbox(struct Mailbox *m, bool force); @@ -112,7 +103,6 @@ int imap_copy_messages(struct Context *ctx, struct Email *e, char *dest, bool de void imap_logout_all(void); /* util.c */ -int imap_parse_path(const char *path, struct ImapMbox *mx); int imap_parse_path2(const char *path, struct ConnAccount *account, char *mailbox, size_t mailboxlen); void imap_pretty_mailbox(char *path, const char *folder); diff --git a/imap/imap_private.h b/imap/imap_private.h index b8791a468..9a61329a6 100644 --- a/imap/imap_private.h +++ b/imap/imap_private.h @@ -37,7 +37,6 @@ struct Context; struct Email; struct ImapEmailData; -struct ImapMbox; struct Mailbox; struct Message; struct Progress; @@ -371,7 +370,6 @@ int imap_get_literal_count(const char *buf, unsigned int *bytes); char *imap_get_qualifier(char *buf); int imap_mxcmp(const char *mx1, const char *mx2); char *imap_next_word(char *s); -void imap_qualify_path(char *buf, size_t buflen, struct ImapMbox *mx, char *path); void imap_qualify_path2(char *buf, size_t buflen, struct ConnAccount *conn_account, char *path); void imap_quote_string(char *dest, size_t dlen, const char *src, bool quote_backtick); void imap_unquote_string(char *s); diff --git a/imap/util.c b/imap/util.c index 13e654776..55a363c2a 100644 --- a/imap/util.c +++ b/imap/util.c @@ -673,12 +673,6 @@ int imap_parse_path2(const char *path, struct ConnAccount *account, char *mailbo return 0; } -int imap_parse_path(const char *path, struct ImapMbox *mx) -{ - memset(&mx->account, 0, sizeof(mx->account)); - mx->mbox = mutt_mem_calloc(1, sizeof(char) * LONG_STRING); - return imap_parse_path2(path, &mx->account, mx->mbox, sizeof(char) * LONG_STRING); -} /** * imap_mxcmp - Compare mailbox names, giving priority to INBOX @@ -965,25 +959,6 @@ char *imap_next_word(char *s) return s; } -/** - * imap_qualify_path - Make an absolute IMAP folder target - * @param buf Buffer for the result - * @param buflen Length of buffer - * @param mx Imap mailbox - * @param path Path relative to the mailbox - * - * given ImapMbox and relative path. - */ -void imap_qualify_path(char *buf, size_t buflen, struct ImapMbox *mx, char *path) -{ - struct Url url; - - mutt_account_tourl(&mx->account, &url); - url.path = path; - - url_tostring(&url, buf, buflen, 0); -} - /** * imap_qualify_path2 - Make an absolute IMAP folder target * @param buf Buffer for the result