mutt_list_free(&(*e)->chain);
#endif
driver_tags_free(&(*e)->tags);
- if ((*e)->data && (*e)->free_data)
- (*e)->free_data(&(*e)->data);
+ if ((*e)->edata && (*e)->free_edata)
+ (*e)->free_edata(&(*e)->edata);
FREE(e);
}
struct TagHead tags; /**< for drivers that support server tagging */
- void *data; /**< driver-specific data */
- void (*free_data)(void **); /**< driver-specific data free function */
-
char *maildir_flags; /**< unknown maildir flags */
+
+ void *edata; /**< driver-specific data */
+ void (*free_edata)(void **); /**< driver-specific data free function */
};
bool mutt_email_cmp_strict(const struct Email *e1, const struct Email *e2);
#ifdef MIXMASTER
STAILQ_INIT(&nh.chain);
#endif
- nh.data = NULL;
+ nh.edata = NULL;
memcpy(d + *off, &nh, sizeof(struct Email));
*off += sizeof(struct Email);
*/
static bool compare_flags_for_copy(struct Email *e)
{
- struct ImapEmailData *edata = e->data;
+ struct ImapEmailData *edata = e->edata;
if (e->read != edata->read)
return true;
mutt_hash_int_delete(adata->uid_hash, IMAP_EDATA(e)->uid, e);
- imap_free_emaildata((void **) &e->data);
+ imap_free_emaildata((void **) &e->edata);
}
else
{
}
/* mailbox->hdrs[msgno]->received is restored from mutt_hcache_restore */
- ctx->mailbox->hdrs[idx]->data = h.data;
+ ctx->mailbox->hdrs[idx]->edata = h.data;
STAILQ_INIT(&ctx->mailbox->hdrs[idx]->tags);
driver_tags_replace(&ctx->mailbox->hdrs[idx]->tags,
mutt_str_strdup(h.data->flags_remote));
mx_alloc_memory(ctx->mailbox);
struct ImapEmailData *edata = new_emaildata();
- e->data = edata;
- e->free_data = imap_free_emaildata;
+ e->edata = edata;
+ e->free_edata = imap_free_emaildata;
e->index = ctx->mailbox->msg_count;
e->active = true;
ctx->mailbox->hdrs[idx]->flagged = h.data->flagged;
ctx->mailbox->hdrs[idx]->replied = h.data->replied;
ctx->mailbox->hdrs[idx]->received = h.received;
- ctx->mailbox->hdrs[idx]->data = (void *) (h.data);
+ ctx->mailbox->hdrs[idx]->edata = (void *) (h.data);
STAILQ_INIT(&ctx->mailbox->hdrs[idx]->tags);
driver_tags_replace(&ctx->mailbox->hdrs[idx]->tags,
mutt_str_strdup(h.data->flags_remote));
local_changes = e->changed;
- struct ImapEmailData *edata = e->data;
+ struct ImapEmailData *edata = e->edata;
newh.data = edata;
memcpy(&old_edata, edata, sizeof(old_edata));
long content_length;
};
-#define IMAP_EDATA(email) ((struct ImapEmailData *) ((email)->data))
+#define IMAP_EDATA(email) ((struct ImapEmailData *) ((email)->edata))
#endif /* MUTT_IMAP_MESSAGE_H */
e = mutt_hcache_restore(hdata);
ctx->mailbox->hdrs[ctx->mailbox->msg_count] = e;
mutt_hcache_free(fc->hc, &hdata);
- e->data = NULL;
+ e->edata = NULL;
e->read = false;
e->old = false;
e->read = false;
e->old = false;
e->deleted = false;
- e->data = new_emaildata();
- e->free_data = free_emaildata;
+ e->edata = new_emaildata();
+ e->free_edata = free_emaildata;
NNTP_EDATA(e)->article_num = anum;
if (fc->restore)
e->changed = true;
e = mutt_hcache_restore(hdata);
ctx->mailbox->hdrs[ctx->mailbox->msg_count] = e;
mutt_hcache_free(fc.hc, &hdata);
- e->data = NULL;
+ e->edata = NULL;
/* skip header marked as deleted in cache */
if (e->deleted && !restore)
e->read = false;
e->old = false;
e->deleted = false;
- e->data = new_emaildata();
- e->free_data = free_emaildata;
+ e->edata = new_emaildata();
+ e->free_edata = free_emaildata;
NNTP_EDATA(e)->article_num = current;
if (restore)
e->changed = true;
mutt_debug(2, "#1 mutt_hcache_fetch %s\n", buf);
e = mutt_hcache_restore(hdata);
mutt_hcache_free(hc, &hdata);
- e->data = NULL;
+ e->edata = NULL;
deleted = e->deleted;
flagged = e->flagged;
mutt_email_free(&e);
e = mutt_hcache_restore(hdata);
ctx->mailbox->hdrs[ctx->mailbox->msg_count] = e;
mutt_hcache_free(hc, &hdata);
- e->data = NULL;
+ e->edata = NULL;
if (e->deleted)
{
mutt_email_free(&e);
ctx->mailbox->msg_count++;
e->read = false;
e->old = false;
- e->data = new_emaildata();
- e->free_data = free_emaildata;
+ e->edata = new_emaildata();
+ e->free_edata = free_emaildata;
NNTP_EDATA(e)->article_num = anum;
nntp_article_status(ctx->mailbox, e, NULL, anum);
if (!e->read)
mx_alloc_memory(ctx->mailbox);
ctx->mailbox->hdrs[ctx->mailbox->msg_count] = mutt_email_new();
struct Email *e = ctx->mailbox->hdrs[ctx->mailbox->msg_count];
- e->data = new_emaildata();
- e->free_data = free_emaildata;
+ e->edata = new_emaildata();
+ e->free_edata = free_emaildata;
e->env = mutt_rfc822_read_header(fp, e, false, false);
mutt_file_fclose(&fp);
NNTP_BYE
};
-#define NNTP_EDATA(email) ((struct NntpEmailData *) ((email)->data))
+#define NNTP_EDATA(email) ((struct NntpEmailData *) ((email)->edata))
void nntp_acache_free(struct NntpMboxData *mdata);
int nntp_active_save_cache(struct NntpAccountData *adata);
*/
static char *email_get_id(struct Email *e)
{
- return (e && e->data) ? ((struct NmEmailData *) e->data)->virtual_id : NULL;
+ return (e && e->edata) ? ((struct NmEmailData *) e->edata)->virtual_id : NULL;
}
/**
*/
static int update_email_tags(struct Email *e, notmuch_message_t *msg)
{
- struct NmEmailData *edata = e->data;
+ struct NmEmailData *edata = e->edata;
char *new_tags = NULL;
char *old_tags = NULL;
*/
static int update_message_path(struct Email *e, const char *path)
{
- struct NmEmailData *edata = e->data;
+ struct NmEmailData *edata = e->edata;
mutt_debug(2, "nm: path update requested path=%s, (%s)\n", path, edata->virtual_id);
*/
static int init_email(struct Email *e, const char *path, notmuch_message_t *msg)
{
- if (e->data)
+ if (e->edata)
return 0;
struct NmEmailData *edata = new_emaildata();
- e->data = edata;
- e->free_data = free_emaildata;
+ e->edata = edata;
+ e->free_edata = free_emaildata;
/* Notmuch ensures that message Id exists (if not notmuch Notmuch will
* generate an ID), so it's more safe than use neomutt Email->env->id
const char *id = notmuch_message_get_message_id(msg);
edata->virtual_id = mutt_str_strdup(id);
- mutt_debug(2, "nm: [e=%p, data=%p] (%s)\n", (void *) e, (void *) e->data, id);
+ mutt_debug(2, "nm: [e=%p, edata=%p] (%s)\n", (void *) e, (void *) e->edata, id);
if (!e->env->message_id)
e->env->message_id = nm2mutt_message_id(id);
if (newpath)
{
/* remember that file has been moved -- nm_mbox_sync() will update the DB */
- struct NmEmailData *edata = e->data;
+ struct NmEmailData *edata = e->edata;
if (edata)
{
*/
char *nm_email_get_folder(struct Email *e)
{
- return (e && e->data) ? ((struct NmEmailData *) e->data)->folder : NULL;
+ return (e && e->edata) ? ((struct NmEmailData *) e->edata)->folder : NULL;
}
/**
if (!mdata || !new)
return -1;
- if (!old && e && e->data)
+ if (!old && e && e->edata)
{
email_get_fullpath(e, buf, sizeof(buf));
old = buf;
{
char old[PATH_MAX], new[PATH_MAX];
struct Email *e = ctx->mailbox->hdrs[i];
- struct NmEmailData *edata = e->data;
+ struct NmEmailData *edata = e->edata;
if (!ctx->mailbox->quiet)
mutt_progress_update(&progress, i, -1);
int i;
for (i = 0; i < mailbox->msg_count; i++)
{
- struct PopEmailData *edata = mailbox->hdrs[i]->data;
+ struct PopEmailData *edata = mailbox->hdrs[i]->edata;
if (mutt_str_strcmp(line, edata->uid) == 0)
break;
}
mailbox->msg_count++;
mailbox->hdrs[i] = mutt_email_new();
- mailbox->hdrs[i]->data = new_emaildata(line);
- mailbox->hdrs[i]->free_data = free_emaildata;
+ mailbox->hdrs[i]->edata = new_emaildata(line);
+ mailbox->hdrs[i]->free_edata = free_emaildata;
}
else if (mailbox->hdrs[i]->index != index - 1)
mdata->clear_cache = true;
for (int i = 0; i < mailbox->msg_count; i++)
{
- struct PopEmailData *edata = mailbox->hdrs[i]->data;
+ struct PopEmailData *edata = mailbox->hdrs[i]->edata;
/* if the id we get is known for a header: done (i.e. keep in cache) */
if (edata->uid && (mutt_str_strcmp(edata->uid, id) == 0))
return 0;
{
if (!ctx->mailbox->quiet)
mutt_progress_update(&progress, i + 1 - old_count, -1);
- struct PopEmailData *edata = ctx->mailbox->hdrs[i]->data;
+ struct PopEmailData *edata = ctx->mailbox->hdrs[i]->edata;
#ifdef USE_HCACHE
void *data = mutt_hcache_fetch(hc, edata->uid, strlen(edata->uid));
if (data)
{
/* Detach the private data */
- ctx->mailbox->hdrs[i]->data = NULL;
+ ctx->mailbox->hdrs[i]->edata = NULL;
int refno = ctx->mailbox->hdrs[i]->refno;
int index = ctx->mailbox->hdrs[i]->index;
ctx->mailbox->hdrs[i]->index = index;
/* Reattach the private data */
- ctx->mailbox->hdrs[i]->data = edata;
- ctx->mailbox->hdrs[i]->free_data = free_emaildata;
+ ctx->mailbox->hdrs[i]->edata = edata;
+ ctx->mailbox->hdrs[i]->free_edata = free_emaildata;
ret = 0;
hcached = true;
}
for (i = 0, j = 0, ret = 0; ret == 0 && i < ctx->mailbox->msg_count; i++)
{
- struct PopEmailData *edata = ctx->mailbox->hdrs[i]->data;
+ struct PopEmailData *edata = ctx->mailbox->hdrs[i]->edata;
if (ctx->mailbox->hdrs[i]->deleted && ctx->mailbox->hdrs[i]->refno != -1)
{
j++;
struct Progress progressbar;
struct PopMboxData *mdata = pop_get_mdata(ctx->mailbox);
struct Email *e = ctx->mailbox->hdrs[msgno];
- struct PopEmailData *edata = e->data;
+ struct PopEmailData *edata = e->edata;
bool bcache = true;
/* see if we already have the message in body cache */
rewind(msg->fp);
/* Detach the private data */
- e->data = NULL;
+ e->edata = NULL;
/* we replace envelope, key in subj_hash has to be updated as well */
if (ctx->mailbox->subj_hash && e->env->real_subj)
mutt_label_hash_add(ctx->mailbox, e);
/* Reattach the private data */
- e->data = edata;
- e->free_data = free_emaildata;
+ e->edata = edata;
+ e->free_edata = free_emaildata;
e->lines = 0;
fgets(buf, sizeof(buf), msg->fp);
struct Mailbox *mailbox = data;
for (int i = 0; i < mailbox->msg_count; i++)
{
- struct PopEmailData *edata = mailbox->hdrs[i]->data;
+ struct PopEmailData *edata = mailbox->hdrs[i]->edata;
if (mutt_str_strcmp(edata->uid, line) == 0)
{
mailbox->hdrs[i]->refno = index;