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));
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);
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);
struct Context;
struct Email;
struct ImapEmailData;
-struct ImapMbox;
struct Mailbox;
struct Message;
struct Progress;
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);
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
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