m->readonly = true;
}
- m->hdrmax = count;
+ m->email_max = count;
m->emails = mutt_mem_calloc(count, sizeof(struct Email *));
m->v2r = mutt_mem_calloc(count, sizeof(int));
m->msg_count = 0;
mdata->max_msn = MAX(mdata->max_msn, msn);
mdata->msn_index[msn - 1] = e;
- if (m->msg_count >= m->hdrmax)
+ if (m->msg_count >= m->email_max)
mx_alloc_memory(m);
struct ImapEmailData *edata = imap_edata_new();
fetch_msn_end = mdata->max_msn;
msn_begin = mdata->max_msn + 1;
msn_end = mdata->new_mail_count;
- while (msn_end > m->hdrmax)
+ while (msn_end > m->email_max)
mx_alloc_memory(m);
alloc_msn_index(adata, msn_end);
mdata->reopen &= ~IMAP_NEWMAIL_PENDING;
return -1;
/* make sure context has room to hold the mailbox */
- while (msn_end > m->hdrmax)
+ while (msn_end > m->email_max)
mx_alloc_memory(m);
alloc_msn_index(adata, msn_end);
imap_alloc_uid_hash(adata, msn_end);
*/
void index_make_entry(char *buf, size_t buflen, struct Menu *menu, int line)
{
- if (!Context || !menu || (line < 0) || (line >= Context->mailbox->hdrmax))
+ if (!Context || !menu || (line < 0) || (line >= Context->mailbox->email_max))
return;
struct Email *e = Context->mailbox->emails[Context->mailbox->v2r[line]];
int msg_tagged; /**< how many messages are tagged? */
struct Email **emails;
- int hdrmax; /**< number of pointers in emails */
+ int email_max; /**< number of pointers in emails */
int *v2r; /**< mapping from virtual to real msgno */
int vcount; /**< the number of virtual messages */
if (!m->emails)
{
/* Allocate some memory to get started */
- m->hdrmax = m->msg_count;
+ m->email_max = m->msg_count;
m->msg_count = 0;
m->vcount = 0;
mx_alloc_memory(m);
md->email->flagged ? "f" : "", md->email->deleted ? "D" : "",
md->email->replied ? "r" : "", md->email->old ? "O" : "",
md->email->read ? "R" : "");
- if (m->msg_count == m->hdrmax)
+ if (m->msg_count == m->email_max)
mx_alloc_memory(m);
m->emails[m->msg_count] = md->email;
if (!m->quiet)
mutt_progress_update(&progress, count, (int) (loc / (m->size / 100 + 1)));
- if (m->msg_count == m->hdrmax)
+ if (m->msg_count == m->email_max)
mx_alloc_memory(m);
e = mutt_email_new();
m->emails[m->msg_count] = e;
if (!m->emails)
{
/* Allocate some memory to get started */
- m->hdrmax = m->msg_count;
+ m->email_max = m->msg_count;
m->msg_count = 0;
m->msg_unread = 0;
m->vcount = 0;
(int) (ftello(adata->fp) / (m->size / 100 + 1)));
}
- if (m->msg_count == m->hdrmax)
+ if (m->msg_count == m->email_max)
mx_alloc_memory(m);
m->emails[m->msg_count] = mutt_email_new();
m->emails = NULL;
}
- m->hdrmax = 0; /* force allocation of new headers */
+ m->email_max = 0; /* force allocation of new headers */
m->msg_count = 0;
m->vcount = 0;
ctx->vsize = 0;
{
size_t s = MAX(sizeof(struct Email *), sizeof(int));
- if ((m->hdrmax + 25) * s < m->hdrmax * s)
+ if ((m->email_max + 25) * s < m->email_max * s)
{
mutt_error(_("Out of memory"));
mutt_exit(1);
}
- m->hdrmax += 25;
+ m->email_max += 25;
if (m->emails)
{
- mutt_mem_realloc(&m->emails, sizeof(struct Email *) * m->hdrmax);
- mutt_mem_realloc(&m->v2r, sizeof(int) * m->hdrmax);
+ mutt_mem_realloc(&m->emails, sizeof(struct Email *) * m->email_max);
+ mutt_mem_realloc(&m->v2r, sizeof(int) * m->email_max);
}
else
{
- m->emails = mutt_mem_calloc(m->hdrmax, sizeof(struct Email *));
- m->v2r = mutt_mem_calloc(m->hdrmax, sizeof(int));
+ m->emails = mutt_mem_calloc(m->email_max, sizeof(struct Email *));
+ m->v2r = mutt_mem_calloc(m->email_max, sizeof(int));
}
- for (int i = m->msg_count; i < m->hdrmax; i++)
+ for (int i = m->msg_count; i < m->email_max; i++)
{
m->emails[i] = NULL;
m->v2r[i] = -1;
rewind(fp);
/* allocate memory for headers */
- if (m->msg_count >= m->hdrmax)
+ if (m->msg_count >= m->email_max)
mx_alloc_memory(m);
/* parse header */
if (!m->emails)
{
/* Allocate some memory to get started */
- m->hdrmax = m->msg_count;
+ m->email_max = m->msg_count;
m->msg_count = 0;
m->vcount = 0;
mx_alloc_memory(m);
continue;
/* allocate memory for headers */
- if (m->msg_count >= m->hdrmax)
+ if (m->msg_count >= m->email_max)
mx_alloc_memory(m);
#ifdef USE_HCACHE
if (hdata)
{
mutt_debug(2, "#2 mutt_hcache_fetch %s\n", buf);
- if (m->msg_count >= m->hdrmax)
+ if (m->msg_count >= m->email_max)
mx_alloc_memory(m);
e = mutt_hcache_restore(hdata);
}
/* parse header */
- if (m->msg_count == m->hdrmax)
+ if (m->msg_count == m->email_max)
mx_alloc_memory(m);
m->emails[m->msg_count] = mutt_email_new();
struct Email *e = m->emails[m->msg_count];
mutt_debug(2, "nm: appending message, i=%d, id=%s, path=%s\n", m->msg_count,
notmuch_message_get_message_id(msg), path);
- if (m->msg_count >= m->hdrmax)
+ if (m->msg_count >= m->email_max)
{
mutt_debug(2, "nm: allocate mx memory\n");
mx_alloc_memory(m);
if (!m->emails)
{
/* Allocate some memory to get started */
- m->hdrmax = m->msg_count;
+ m->email_max = m->msg_count;
m->msg_count = 0;
m->vcount = 0;
m->size = 0;
{
mutt_debug(1, "new header %d %s\n", index, line);
- if (i >= m->hdrmax)
+ if (i >= m->email_max)
mx_alloc_memory(m);
m->msg_count++;
if (!m->emails)
{
/* Allocate some memory to get started */
- m->hdrmax = m->msg_count;
+ m->email_max = m->msg_count;
m->msg_count = 0;
m->msg_unread = 0;
m->vcount = 0;