break;
case 'n':
- if (Context && Context->mailbox->data == folder->ff->nd)
+ if (Context && Context->mailbox->mdata == folder->ff->nd)
{
snprintf(fmt, sizeof(fmt), "%%%sd", prec);
snprintf(buf, buflen, fmt, Context->new);
group_index_format_str, data, flags);
}
}
- else if (Context && Context->mailbox->data == folder->ff->nd)
+ else if (Context && Context->mailbox->mdata == folder->ff->nd)
{
snprintf(fmt, sizeof(fmt), "%%%sd", prec);
snprintf(buf, buflen, fmt, Context->mailbox->msg_unread);
CHECK_ATTACH
if (Context && Context->mailbox->magic == MUTT_NNTP)
{
- struct NntpMboxData *mdata = Context->mailbox->data;
+ struct NntpMboxData *mdata = Context->mailbox->mdata;
if (mutt_newsgroup_catchup(Context, mdata->adata, mdata->group))
menu->redraw = REDRAW_INDEX | REDRAW_STATUS;
}
_("Reply by mail as poster prefers?")) != MUTT_YES)
{
if (Context && Context->mailbox->magic == MUTT_NNTP &&
- !((struct NntpMboxData *) Context->mailbox->data)->allowed && query_quadoption(PostModerated, _("Posting to this group not allowed, may be moderated. Continue?")) != MUTT_YES)
+ !((struct NntpMboxData *) Context->mailbox->mdata)->allowed && query_quadoption(PostModerated, _("Posting to this group not allowed, may be moderated. Continue?")) != MUTT_YES)
{
break;
}
}
else
{
- adata = mailbox->data;
+ adata = mailbox->mdata;
}
imap_munge_mbox_name(adata, mbox, sizeof(mbox), mx->mbox);
goto fail;
/* once again the context is new */
- ctx->mailbox->data = adata;
+ ctx->mailbox->mdata = adata;
/* Clean up path and replace the one in the mailbox */
imap_fix_path(adata, mx.mbox, buf, sizeof(buf));
return -1;
}
- ctx->mailbox->data = adata;
+ ctx->mailbox->mdata = adata;
imap_fix_path(adata, mx.mbox, mailbox, sizeof(mailbox));
if (!*mailbox)
{
if (!m || (m->magic != MUTT_IMAP))
return NULL;
- return m->data;
+ return m->mdata;
}
/**
return;
FREE(&(*mailbox)->desc);
- if ((*mailbox)->data && (*mailbox)->free_data)
- (*mailbox)->free_data(&(*mailbox)->data);
+ if ((*mailbox)->mdata && (*mailbox)->free_mdata)
+ (*mailbox)->free_mdata(&(*mailbox)->mdata);
FREE(mailbox);
}
struct timespec last_visited; /**< time of last exit from this mailbox */
struct timespec stats_last_checked; /**< mtime of mailbox the last time stats where checked. */
- void *data; /**< driver specific data */
- void (*free_data)(void **); /**< driver-specific data free function */
const struct MxOps *mx_ops;
bool changed : 1; /**< mailbox has been modified */
struct Hash *label_hash; /**< hash table for x-labels */
int flags; /**< e.g. #MB_NORMAL */
+
+ void *mdata; /**< driver specific data */
+ void (*free_mdata)(void **); /**< driver-specific data free function */
};
/**
{
if (!m || ((m->magic != MUTT_MAILDIR) && (m->magic != MUTT_MH)))
return NULL;
- return m->data;
+ return m->mdata;
}
/**
mutt_progress_init(&progress, msgbuf, MUTT_PROGRESS_MSG, ReadInc, 0);
}
- if (!ctx->mailbox->data)
+ if (!ctx->mailbox->mdata)
{
- ctx->mailbox->data = mutt_mem_calloc(1, sizeof(struct MaildirMboxData));
+ ctx->mailbox->mdata = mutt_mem_calloc(1, sizeof(struct MaildirMboxData));
}
struct MaildirMboxData *mdata = maildir_get_mdata(ctx->mailbox);
*/
static int mh_mbox_close(struct Context *ctx)
{
- FREE(&ctx->mailbox->data);
+ FREE(&ctx->mailbox->mdata);
return 0;
}
if (!mailbox || (mailbox->magic != MUTT_MBOX))
return -1;
- if (mailbox->data)
+ if (mailbox->mdata)
return 0;
- mailbox->data = new_mboxdata();
- if (!mailbox->data)
+ mailbox->mdata = new_mboxdata();
+ if (!mailbox->mdata)
return -1;
- mailbox->free_data = free_mboxdata;
+ mailbox->free_mdata = free_mboxdata;
return 0;
}
{
if (!m || (m->magic != MUTT_MBOX))
return NULL;
- return m->data;
+ return m->mdata;
}
/**
#ifdef USE_NNTP
if (ctx->mailbox->msg_unread && ctx->mailbox->magic == MUTT_NNTP)
{
- struct NntpMboxData *mdata = ctx->mailbox->data;
+ struct NntpMboxData *mdata = ctx->mailbox->mdata;
if (mdata && mdata->adata && mdata->group)
{
*/
void nntp_newsrc_gen_entries(struct Context *ctx)
{
- struct NntpMboxData *mdata = ctx->mailbox->data;
+ struct NntpMboxData *mdata = ctx->mailbox->mdata;
anum_t last = 0, first = 1;
bool series;
int save_sort = SORT_ORDER;
*/
void nntp_article_status(struct Mailbox *mailbox, struct Email *e, char *group, anum_t anum)
{
- struct NntpMboxData *mdata = mailbox->data;
+ struct NntpMboxData *mdata = mailbox->mdata;
if (group)
mdata = mutt_hash_find(mdata->adata->groups_hash, group);
mdata->newsrc_ent[0].last = mdata->last_message;
}
mdata->unread = 0;
- if (ctx && ctx->mailbox->data == mdata)
+ if (ctx && ctx->mailbox->mdata == mdata)
{
for (unsigned int i = 0; i < ctx->mailbox->msg_count; i++)
mutt_set_flag(ctx, ctx->mailbox->hdrs[i], MUTT_READ, 1);
mdata->newsrc_ent[0].first = 1;
mdata->newsrc_ent[0].last = mdata->first_message - 1;
}
- if (ctx && ctx->mailbox->data == mdata)
+ if (ctx && ctx->mailbox->mdata == mdata)
{
mdata->unread = ctx->mailbox->msg_count;
for (unsigned int i = 0; i < ctx->mailbox->msg_count; i++)
continue;
if ((mailbox->magic == MUTT_NNTP) &&
- (mutt_str_strcmp(mdata->group, ((struct NntpMboxData *) mailbox->data)->group) == 0))
+ (mutt_str_strcmp(mdata->group, ((struct NntpMboxData *) mailbox->mdata)->group) == 0))
{
unsigned int unread = 0;
*/
static void nntp_parse_xref(struct Mailbox *mailbox, struct Email *e)
{
- struct NntpMboxData *mdata = mailbox->data;
+ struct NntpMboxData *mdata = mailbox->mdata;
char *buf = mutt_str_strdup(e->env->xref);
char *p = buf;
{
struct FetchCtx *fc = data;
struct Context *ctx = fc->ctx;
- struct NntpMboxData *mdata = ctx->mailbox->data;
+ struct NntpMboxData *mdata = ctx->mailbox->mdata;
struct Email *e = NULL;
char *header = NULL, *field = NULL;
bool save = true;
static int nntp_fetch_headers(struct Context *ctx, void *hc, anum_t first,
anum_t last, int restore)
{
- struct NntpMboxData *mdata = ctx->mailbox->data;
+ struct NntpMboxData *mdata = ctx->mailbox->mdata;
struct FetchCtx fc;
struct Email *e = NULL;
char buf[HUGE_STRING];
*/
static int check_mailbox(struct Context *ctx)
{
- struct NntpMboxData *mdata = ctx->mailbox->data;
+ struct NntpMboxData *mdata = ctx->mailbox->mdata;
struct NntpAccountData *adata = mdata->adata;
time_t now = time(NULL);
int rc, ret = 0;
char buf[LONG_STRING];
if (mailbox && (mailbox->magic == MUTT_NNTP))
- mdata = mailbox->data;
+ mdata = mailbox->mdata;
else
{
CurrentNewsSrv = nntp_select_server(mailbox, NewsServer, false);
if (Context && (Context->mailbox->magic == MUTT_NNTP))
{
buf[0] = '\0';
- if (nntp_query(Context->mailbox->data, buf, sizeof(buf)) < 0)
+ if (nntp_query(Context->mailbox->mdata, buf, sizeof(buf)) < 0)
return -1;
}
}
return -1;
tmp_mdata.adata = adata;
if (Context && (Context->mailbox->magic == MUTT_NNTP))
- tmp_mdata.group = ((struct NntpMboxData *) Context->mailbox->data)->group;
+ tmp_mdata.group = ((struct NntpMboxData *) Context->mailbox->mdata)->group;
else
tmp_mdata.group = NULL;
i = adata->groups_num;
*/
int nntp_check_msgid(struct Context *ctx, const char *msgid)
{
- struct NntpMboxData *mdata = ctx->mailbox->data;
+ struct NntpMboxData *mdata = ctx->mailbox->mdata;
char buf[LONG_STRING];
FILE *fp = mutt_file_mkstemp();
*/
int nntp_check_children(struct Context *ctx, const char *msgid)
{
- struct NntpMboxData *mdata = ctx->mailbox->data;
+ struct NntpMboxData *mdata = ctx->mailbox->mdata;
struct ChildCtx cc;
char buf[STRING];
int rc;
}
time(&adata->check_time);
- ctx->mailbox->data = mdata;
+ ctx->mailbox->mdata = mdata;
if (!mdata->bcache && (mdata->newsrc_ent || mdata->subscribed || SaveUnsubscribed))
mdata->bcache = mutt_bcache_open(&adata->conn->account, mdata->group);
int ret = check_mailbox(ctx);
if (ret == 0)
{
- struct NntpMboxData *mdata = ctx->mailbox->data;
+ struct NntpMboxData *mdata = ctx->mailbox->mdata;
struct NntpAccountData *adata = mdata->adata;
nntp_newsrc_close(adata);
}
*/
static int nntp_mbox_sync(struct Context *ctx, int *index_hint)
{
- struct NntpMboxData *mdata = ctx->mailbox->data;
+ struct NntpMboxData *mdata = ctx->mailbox->mdata;
int rc;
#ifdef USE_HCACHE
header_cache_t *hc = NULL;
*/
static int nntp_mbox_close(struct Context *ctx)
{
- struct NntpMboxData *mdata = ctx->mailbox->data, *tmp_mdata = NULL;
+ struct NntpMboxData *mdata = ctx->mailbox->mdata, *tmp_mdata = NULL;
if (!mdata)
return 0;
*/
static int nntp_msg_open(struct Context *ctx, struct Message *msg, int msgno)
{
- struct NntpMboxData *mdata = ctx->mailbox->data;
+ struct NntpMboxData *mdata = ctx->mailbox->mdata;
struct Email *e = ctx->mailbox->hdrs[msgno];
char article[16];
static struct NmMboxData *get_mboxdata(struct Mailbox *mailbox)
{
if (mailbox && (mailbox->magic == MUTT_NOTMUCH))
- return mailbox->data;
+ return mailbox->mdata;
return NULL;
}
if (!mailbox || (mailbox->magic != MUTT_NOTMUCH))
return -1;
- if (mailbox->data)
+ if (mailbox->mdata)
return 0;
- mailbox->data = new_mboxdata(mailbox->path);
- if (!mailbox->data)
+ mailbox->mdata = new_mboxdata(mailbox->path);
+ if (!mailbox->mdata)
return -1;
- mailbox->free_data = free_mboxdata;
+ mailbox->free_mdata = free_mboxdata;
return 0;
}
return false;
tmp_mbox.magic = MUTT_NOTMUCH;
- tmp_mbox.data = tmp_mdata;
+ tmp_mbox.mdata = tmp_mdata;
mutt_debug(2, "#1 () -> db_query: %s\n", tmp_mdata->db_query);
CHECK_MODE(IsHeader(extra) && !IsAttach(extra));
CHECK_ATTACH;
if (extra->ctx && extra->ctx->mailbox->magic == MUTT_NNTP &&
- !((struct NntpMboxData *) extra->ctx->mailbox->data)->allowed && query_quadoption(PostModerated, _("Posting to this group not allowed, may be moderated. Continue?")) != MUTT_YES)
+ !((struct NntpMboxData *) extra->ctx->mailbox->mdata)->allowed && query_quadoption(PostModerated, _("Posting to this group not allowed, may be moderated. Continue?")) != MUTT_YES)
{
break;
}
CHECK_MODE(IsHeader(extra) || IsMsgAttach(extra));
CHECK_ATTACH;
if (extra->ctx && extra->ctx->mailbox->magic == MUTT_NNTP &&
- !((struct NntpMboxData *) extra->ctx->mailbox->data)->allowed && query_quadoption(PostModerated, _("Posting to this group not allowed, may be moderated. Continue?")) != MUTT_YES)
+ !((struct NntpMboxData *) extra->ctx->mailbox->mdata)->allowed && query_quadoption(PostModerated, _("Posting to this group not allowed, may be moderated. Continue?")) != MUTT_YES)
{
break;
}
_("Reply by mail as poster prefers?")) != MUTT_YES)
{
if (extra->ctx && extra->ctx->mailbox->magic == MUTT_NNTP &&
- !((struct NntpMboxData *) extra->ctx->mailbox->data)->allowed && query_quadoption(PostModerated, _("Posting to this group not allowed, may be moderated. Continue?")) != MUTT_YES)
+ !((struct NntpMboxData *) extra->ctx->mailbox->mdata)->allowed && query_quadoption(PostModerated, _("Posting to this group not allowed, may be moderated. Continue?")) != MUTT_YES)
{
break;
}
struct PopMboxData *mdata = new_mboxdata();
mdata->conn = conn;
- ctx->mailbox->data = mdata;
- ctx->mailbox->free_data = free_mboxdata;
+ ctx->mailbox->mdata = mdata;
+ ctx->mailbox->free_mdata = free_mboxdata;
if (pop_open_connection(mdata) < 0)
return -1;
{
if (!m || (m->magic != MUTT_POP))
return NULL;
- return m->data;
+ return m->mdata;
}
if ((flags & SEND_NEWS) && ctx && ctx->mailbox->magic == MUTT_NNTP &&
!msg->env->newsgroups)
msg->env->newsgroups =
- mutt_str_strdup(((struct NntpMboxData *) ctx->mailbox->data)->group);
+ mutt_str_strdup(((struct NntpMboxData *) ctx->mailbox->mdata)->group);
#endif
if (!(flags & (SEND_MAILX | SEND_BATCH)) && !(Autoedit && EditHeaders) &&