From: Richard Russon Date: Tue, 16 May 2017 13:18:30 +0000 (+0100) Subject: replace 'IMAP_MBOX' with 'struct ImapMbox' X-Git-Tag: neomutt-20170526~21^2~16 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8a2c6b929ab0b9bafb60e423b8c7c0e8a4fdb6d1;p=neomutt replace 'IMAP_MBOX' with 'struct ImapMbox' --- diff --git a/browser.c b/browser.c index 0f01958bf..2c006c1a3 100644 --- a/browser.c +++ b/browser.c @@ -1518,7 +1518,7 @@ void _mutt_select_file(char *f, size_t flen, int flags, char ***files, int *numf else { char msg[SHORT_STRING]; - IMAP_MBOX mx; + struct ImapMbox mx; int nentry = menu->current; imap_parse_path(state.entry[nentry].name, &mx); diff --git a/imap/browse.c b/imap/browse.c index 3fbe3c13f..90d3cfe45 100644 --- a/imap/browse.c +++ b/imap/browse.c @@ -36,7 +36,7 @@ static void imap_add_folder(char delim, char *folder, int noselect, int noinferi { char tmp[LONG_STRING]; char relpath[LONG_STRING]; - IMAP_MBOX mx; + struct ImapMbox mx; struct Buffy *b = NULL; if (imap_parse_path(state->folder, &mx)) @@ -112,7 +112,7 @@ static int browse_add_list_result(struct ImapData *idata, const char *cmd, struct browser_state *state, short isparent) { struct ImapList list; - IMAP_MBOX mx; + struct ImapMbox mx; int rc; if (imap_parse_path(state->folder, &mx)) @@ -161,7 +161,7 @@ int imap_browse(char *path, struct browser_state *state) char ctmp; short showparents = 0; int save_lsub; - IMAP_MBOX mx; + struct ImapMbox mx; if (imap_parse_path(path, &mx)) { @@ -316,7 +316,7 @@ fail: int imap_mailbox_create(const char *folder) { struct ImapData *idata = NULL; - IMAP_MBOX mx; + struct ImapMbox mx; char buf[LONG_STRING]; short n; @@ -370,7 +370,7 @@ fail: int imap_mailbox_rename(const char *mailbox) { struct ImapData *idata = NULL; - IMAP_MBOX mx; + struct ImapMbox mx; char buf[LONG_STRING]; char newname[SHORT_STRING]; diff --git a/imap/command.c b/imap/command.c index 3a4e069df..1f2a07371 100644 --- a/imap/command.c +++ b/imap/command.c @@ -485,7 +485,7 @@ static void cmd_parse_status(struct ImapData *idata, char *s) char *mailbox = NULL; char *value = NULL; struct Buffy *inc = NULL; - IMAP_MBOX mx; + struct ImapMbox mx; int count; IMAP_STATUS *status = NULL; unsigned int olduv, oldun; diff --git a/imap/imap.c b/imap/imap.c index 44c341f1a..3e7be3d71 100644 --- a/imap/imap.c +++ b/imap/imap.c @@ -53,7 +53,7 @@ static void imap_set_flag(struct ImapData *idata, int aclbit, int flag, int imap_access(const char *path, int flags) { struct ImapData *idata = NULL; - IMAP_MBOX mx; + struct ImapMbox mx; char buf[LONG_STRING]; char mailbox[LONG_STRING]; char mbox[LONG_STRING]; @@ -123,7 +123,7 @@ int imap_create_mailbox(struct ImapData *idata, char *mailbox) return 0; } -int imap_rename_mailbox(struct ImapData *idata, IMAP_MBOX *mx, const char *newname) +int imap_rename_mailbox(struct ImapData *idata, struct ImapMbox *mx, const char *newname) { char oldmbox[LONG_STRING]; char newmbox[LONG_STRING]; @@ -140,7 +140,7 @@ int imap_rename_mailbox(struct ImapData *idata, IMAP_MBOX *mx, const char *newna return 0; } -int imap_delete_mailbox(struct Context *ctx, IMAP_MBOX *mx) +int imap_delete_mailbox(struct Context *ctx, struct ImapMbox *mx) { char buf[LONG_STRING], mbox[LONG_STRING]; struct ImapData *idata = NULL; @@ -556,7 +556,7 @@ static int imap_open_mailbox(struct Context *ctx) char buf[LONG_STRING]; char bufout[LONG_STRING]; int count = 0; - IMAP_MBOX mx, pmx; + struct ImapMbox mx, pmx; int rc; if (imap_parse_path(ctx->path, &mx)) @@ -770,7 +770,7 @@ static int imap_open_mailbox_append(struct Context *ctx, int flags) struct ImapData *idata = NULL; char buf[LONG_STRING]; char mailbox[LONG_STRING]; - IMAP_MBOX mx; + struct ImapMbox mx; int rc; if (imap_parse_path(ctx->path, &mx)) @@ -1470,7 +1470,7 @@ static int imap_check_mailbox_reopen(struct Context *ctx, int *index_hint) /* split path into (idata,mailbox name) */ static int imap_get_mailbox(const char *path, struct ImapData **hidata, char *buf, size_t blen) { - IMAP_MBOX mx; + struct ImapMbox mx; if (imap_parse_path(path, &mx)) { @@ -1855,7 +1855,7 @@ int imap_subscribe(char *path, int subscribe) char mbox[LONG_STRING]; char errstr[STRING]; struct Buffer err, token; - IMAP_MBOX mx; + struct ImapMbox mx; if (!mx_is_imap(path) || imap_parse_path(path, &mx) || !mx.mbox) { @@ -1981,7 +1981,7 @@ int imap_complete(char *dest, size_t dlen, char *path) char completion[LONG_STRING]; int clen, matchlen = 0; int completions = 0; - IMAP_MBOX mx; + struct ImapMbox mx; int rc; if (imap_parse_path(path, &mx)) @@ -2071,7 +2071,7 @@ int imap_fast_trash(struct Context *ctx, char *dest) char mmbox[LONG_STRING]; char prompt[LONG_STRING]; int rc; - IMAP_MBOX mx; + struct ImapMbox mx; int triedcreate = 0; idata = ctx->data; diff --git a/imap/imap.h b/imap/imap.h index 590b01e36..9052ffcc4 100644 --- a/imap/imap.h +++ b/imap/imap.h @@ -24,16 +24,16 @@ #include "mailbox.h" /* -- data structures -- */ -typedef struct +struct ImapMbox { struct Account account; char *mbox; -} IMAP_MBOX; +}; /* imap.c */ int imap_access(const char *, int); int imap_check_mailbox(struct Context *ctx, int force); -int imap_delete_mailbox(struct Context *ctx, IMAP_MBOX *mx); +int imap_delete_mailbox(struct Context *ctx, struct ImapMbox *mx); int imap_sync_mailbox(struct Context *ctx, int expunge); int imap_close_mailbox(struct Context *ctx); int imap_buffy_check(int force, int check_stats); @@ -62,7 +62,7 @@ void imap_logout_all(void); /* util.c */ int imap_expand_path(char *path, size_t len); -int imap_parse_path(const char *path, IMAP_MBOX *mx); +int imap_parse_path(const char *path, struct ImapMbox *mx); void imap_pretty_mailbox(char *path); int imap_wait_keepalive(pid_t pid); diff --git a/imap/imap_private.h b/imap/imap_private.h index 08ad4e016..d2092558c 100644 --- a/imap/imap_private.h +++ b/imap/imap_private.h @@ -231,7 +231,7 @@ struct ImapData /* imap.c */ int imap_check(struct ImapData *idata, int force); int imap_create_mailbox(struct ImapData *idata, char *mailbox); -int imap_rename_mailbox(struct ImapData *idata, IMAP_MBOX *mx, const char *newname); +int imap_rename_mailbox(struct ImapData *idata, struct ImapMbox *mx, const char *newname); IMAP_STATUS *imap_mboxcache_get(struct ImapData *idata, const char *mbox, int create); void imap_mboxcache_free(struct ImapData *idata); int imap_exec_msgset(struct ImapData *idata, const char *pre, const char *post, @@ -290,7 +290,7 @@ int imap_mxcmp(const char *mx1, const char *mx2); char *imap_next_word(char *s); time_t imap_parse_date(char *s); void imap_make_date(char *buf, time_t timestamp); -void imap_qualify_path(char *dest, size_t len, IMAP_MBOX *mx, char *path); +void imap_qualify_path(char *dest, size_t len, struct ImapMbox *mx, char *path); void imap_quote_string(char *dest, size_t slen, const char *src); void imap_unquote_string(char *s); void imap_munge_mbox_name(struct ImapData *idata, char *dest, size_t dlen, const char *src); diff --git a/imap/message.c b/imap/message.c index b9dca6fe8..7d49d8bbb 100644 --- a/imap/message.c +++ b/imap/message.c @@ -920,7 +920,7 @@ int imap_append_message(struct Context *ctx, struct Message *msg) struct Progress progressbar; size_t sent; int c, last; - IMAP_MBOX mx; + struct ImapMbox mx; int rc; idata = ctx->data; @@ -1054,7 +1054,7 @@ int imap_copy_messages(struct Context *ctx, struct Header *h, char *dest, int de char prompt[LONG_STRING]; int rc; int n; - IMAP_MBOX mx; + struct ImapMbox mx; int err_continue = MUTT_NO; int triedcreate = 0; diff --git a/imap/util.c b/imap/util.c index 7368369ea..c01a2167c 100644 --- a/imap/util.c +++ b/imap/util.c @@ -47,7 +47,7 @@ * fails, which it might if there isn't enough room in the buffer. */ int imap_expand_path(char *path, size_t len) { - IMAP_MBOX mx; + struct ImapMbox mx; struct ImapData *idata = NULL; struct CissUrl url; char fixedpath[LONG_STRING]; @@ -118,7 +118,7 @@ void imap_get_parent(char *output, const char *mbox, size_t olen, char delim) */ void imap_get_parent_path(char *output, const char *path, size_t olen) { - IMAP_MBOX mx; + struct ImapMbox mx; struct ImapData *idata = NULL; char mbox[LONG_STRING] = ""; @@ -151,7 +151,7 @@ void imap_get_parent_path(char *output, const char *path, size_t olen) */ void imap_clean_path(char *path, size_t plen) { - IMAP_MBOX mx; + struct ImapMbox mx; struct ImapData *idata = NULL; char mbox[LONG_STRING] = ""; @@ -177,7 +177,7 @@ static int imap_hcache_namer(const char *path, char *dest, size_t dlen) header_cache_t *imap_hcache_open(struct ImapData *idata, const char *path) { - IMAP_MBOX mx; + struct ImapMbox mx; struct CissUrl url; char cachepath[LONG_STRING]; char mbox[LONG_STRING]; @@ -258,7 +258,7 @@ int imap_hcache_del(struct ImapData *idata, unsigned int uid) /* imap_parse_path: given an IMAP mailbox name, return host, port * and a path IMAP servers will recognize. * mx.mbox is malloc'd, caller must free it */ -int imap_parse_path(const char *path, IMAP_MBOX *mx) +int imap_parse_path(const char *path, struct ImapMbox *mx) { static unsigned short ImapPort = 0; static unsigned short ImapsPort = 0; @@ -394,7 +394,7 @@ int imap_mxcmp(const char *mx1, const char *mx2) * look nice. */ void imap_pretty_mailbox(char *path) { - IMAP_MBOX home, target; + struct ImapMbox home, target; struct CissUrl url; char *delim = NULL; int tlen; @@ -686,9 +686,9 @@ void imap_make_date(char *buf, time_t timestamp) tm->tm_min, tm->tm_sec, (int) tz / 60, (int) abs((int) tz) % 60); } -/* imap_qualify_path: make an absolute IMAP folder target, given IMAP_MBOX +/* imap_qualify_path: make an absolute IMAP folder target, given ImapMbox * and relative path. */ -void imap_qualify_path(char *dest, size_t len, IMAP_MBOX *mx, char *path) +void imap_qualify_path(char *dest, size_t len, struct ImapMbox *mx, char *path) { struct CissUrl url;