Consistent variable naming makes the code easier to read.
char internaldate[IMAP_DATELEN];
char imap_flags[128];
size_t len;
- struct Progress progressbar;
+ struct Progress progress;
size_t sent;
int c, last;
int rc;
}
rewind(fp);
- mutt_progress_init(&progressbar, _("Uploading message..."),
- MUTT_PROGRESS_SIZE, C_NetInc, len);
+ mutt_progress_init(&progress, _("Uploading message..."), MUTT_PROGRESS_SIZE, C_NetInc, len);
mutt_date_make_imap(internaldate, sizeof(internaldate), msg->received);
{
sent += len;
flush_buffer(buf, &len, adata->conn);
- mutt_progress_update(&progressbar, sent, -1);
+ mutt_progress_update(&progress, sent, -1);
}
}
char buf[1024];
char *pc = NULL;
unsigned int bytes;
- struct Progress progressbar;
+ struct Progress progress;
unsigned int uid;
bool retried = false;
bool read;
}
if (output_progress)
{
- mutt_progress_init(&progressbar, _("Fetching message..."),
+ mutt_progress_init(&progress, _("Fetching message..."),
MUTT_PROGRESS_SIZE, C_NetInc, bytes);
}
- if (imap_read_literal(msg->fp, adata, bytes,
- output_progress ? &progressbar : NULL) < 0)
+ if (imap_read_literal(msg->fp, adata, bytes, output_progress ? &progress : NULL) < 0)
{
goto bail;
}
{
if (a->description)
{
- snprintf(desc, sizeof(desc),
- _("---Command: %-20.20s Description: %s"), cmd, a->description);
+ snprintf(desc, sizeof(desc), _("---Command: %-20.20s Description: %s"),
+ cmd, a->description);
}
else
{
- snprintf(desc, sizeof(desc),
- _("---Command: %-30.30s Attachment: %s"), cmd, type);
+ snprintf(desc, sizeof(desc), _("---Command: %-30.30s Attachment: %s"), cmd, type);
}
}
char buf[1024];
char path[PATH_MAX];
- struct Progress progressbar;
+ struct Progress progress;
struct PopAccountData *adata = pop_adata_get(m);
struct Email *e = m->emails[msgno];
struct PopEmailData *edata = e->edata;
return -1;
}
- mutt_progress_init(&progressbar, _("Fetching message..."), MUTT_PROGRESS_SIZE,
+ mutt_progress_init(&progress, _("Fetching message..."), MUTT_PROGRESS_SIZE,
C_NetInc, e->content->length + e->content->offset - 1);
/* see if we can put in body cache; use our cache as fallback */
snprintf(buf, sizeof(buf), "RETR %d\r\n", e->refno);
- const int ret = pop_fetch_data(adata, buf, &progressbar, fetch_message, msg->fp);
+ const int ret = pop_fetch_data(adata, buf, &progress, fetch_message, msg->fp);
if (ret == 0)
break;
/**
* pop_fetch_data - Read Headers with callback function
- * @param adata POP Account data
- * @param query POP query to send to server
- * @param progressbar Progress bar
- * @param func Function called for each header read
- * @param data Data to pass to the callback
+ * @param adata POP Account data
+ * @param query POP query to send to server
+ * @param progress Progress bar
+ * @param func Function called for each header read
+ * @param data Data to pass to the callback
* @retval 0 Successful
* @retval -1 Connection lost
* @retval -2 Invalid command or execution error
* func(NULL, *data) if rewind(*data) needs, exits when fail or done.
*/
int pop_fetch_data(struct PopAccountData *adata, const char *query,
- struct Progress *progressbar, int (*func)(char *, void *), void *data)
+ struct Progress *progress, int (*func)(char *, void *), void *data)
{
char buf[1024];
long pos = 0;
}
else
{
- if (progressbar)
- mutt_progress_update(progressbar, pos, -1);
+ if (progress)
+ mutt_progress_update(progress, pos, -1);
if ((ret == 0) && (func(inbuf, data) < 0))
ret = -3;
lenbuf = 0;
int ret = pop_open_connection(adata);
if (ret == 0)
{
- struct Progress progressbar;
- mutt_progress_init(&progressbar, _("Verifying message indexes..."),
+ struct Progress progress;
+ mutt_progress_init(&progress, _("Verifying message indexes..."),
MUTT_PROGRESS_SIZE, C_NetInc, 0);
for (int i = 0; i < m->msg_count; i++)
m->emails[i]->refno = -1;
- ret = pop_fetch_data(adata, "UIDL\r\n", &progressbar, check_uidl, m);
+ ret = pop_fetch_data(adata, "UIDL\r\n", &progress, check_uidl, m);
if (ret == -2)
{
mutt_error("%s", adata->err_msg);
int pop_connect(struct PopAccountData *adata);
int pop_open_connection(struct PopAccountData *adata);
int pop_query_d(struct PopAccountData *adata, char *buf, size_t buflen, char *msg);
-int pop_fetch_data(struct PopAccountData *adata, const char *query, struct Progress *progressbar,
- int (*func)(char *, void *), void *data);
+int pop_fetch_data(struct PopAccountData *adata, const char *query,
+ struct Progress *progress, int (*func)(char *, void *), void *data);
int pop_reconnect(struct Mailbox *m);
void pop_logout(struct Mailbox *m);
struct PopAccountData *pop_adata_get(struct Mailbox *m);