va_end(ap);
}
-void mutt_progress_init(progress_t *progress, const char *msg,
+void mutt_progress_init(struct Progress *progress, const char *msg,
unsigned short flags, unsigned short inc, long size)
{
struct timeval tv = { 0, 0 };
if (option(OPTNOCURSES))
return;
- memset(progress, 0, sizeof(progress_t));
+ memset(progress, 0, sizeof(struct Progress));
progress->inc = inc;
progress->flags = flags;
progress->msg = msg;
mutt_refresh();
}
-void mutt_progress_update(progress_t *progress, long pos, int percent)
+void mutt_progress_update(struct Progress *progress, long pos, int percent)
{
char posstr[SHORT_STRING];
short update = 0;
if (tag)
{
char msgbuf[STRING];
- progress_t progress;
+ struct Progress progress;
int px;
if (!Context->quiet)
/* imap_read_literal: read bytes bytes from server into file. Not explicitly
* buffered, relies on FILE buffering. NOTE: strips \r from \r\n.
* Apparently even literals use \r\n-terminated strings ?! */
-int imap_read_literal(FILE *fp, IMAP_DATA *idata, long bytes, progress_t *pbar)
+int imap_read_literal(FILE *fp, IMAP_DATA *idata, long bytes, struct Progress *pbar)
{
long pos;
char c;
int imap_open_connection(IMAP_DATA *idata);
void imap_close_connection(IMAP_DATA *idata);
IMAP_DATA *imap_conn_find(const struct Account *account, int flags);
-int imap_read_literal(FILE *fp, IMAP_DATA *idata, long bytes, progress_t *pbar);
+int imap_read_literal(FILE *fp, IMAP_DATA *idata, long bytes, struct Progress *pbar);
void imap_expunge_mailbox(IMAP_DATA *idata);
void imap_logout(IMAP_DATA **idata);
int imap_sync_message(IMAP_DATA *idata, struct Header *hdr, struct Buffer *cmd, int *err_continue);
"DATE FROM SUBJECT TO CC MESSAGE-ID REFERENCES CONTENT-TYPE "
"CONTENT-DESCRIPTION IN-REPLY-TO REPLY-TO LINES LIST-POST X-LABEL "
"X-KEYWORDS X-MOZILLA-KEYS KEYWORDS X-ORIGINAL-TO";
- progress_t progress;
+ struct Progress progress;
int retval = -1;
#ifdef USE_HCACHE
char path[_POSIX_PATH_MAX];
char *pc = NULL;
long bytes;
- progress_t progressbar;
+ struct Progress progressbar;
int uid;
int cacheno;
IMAP_CACHE *cache = NULL;
char internaldate[IMAP_DATELEN];
char imap_flags[SHORT_STRING];
size_t len;
- progress_t progressbar;
+ struct Progress progressbar;
size_t sent;
int c, last;
IMAP_MBOX mx;
#ifdef NFS_ATTRIBUTE_HACK
struct utimbuf newtime;
#endif
- progress_t progress;
+ struct Progress progress;
char msgbuf[STRING];
if (stat(ctx->path, &sb) == -1)
#ifdef NFS_ATTRIBUTE_HACK
struct utimbuf newtime;
#endif
- progress_t progress;
+ struct Progress progress;
char msgbuf[STRING];
/* Save information about the folder at the time we opened it. */
struct m_update_t *newOffset = NULL;
struct m_update_t *oldOffset = NULL;
FILE *fp = NULL;
- progress_t progress;
+ struct Progress progress;
char msgbuf[STRING];
struct Buffy *tmp = NULL;
}
static int maildir_parse_dir(struct Context *ctx, struct maildir ***last,
- const char *subdir, int *count, progress_t *progress)
+ const char *subdir, int *count, struct Progress *progress)
{
DIR *dirp = NULL;
struct dirent *de = NULL;
/*
* This function does the second parsing pass
*/
-static void maildir_delayed_parsing(struct Context *ctx, struct maildir **md, progress_t *progress)
+static void maildir_delayed_parsing(struct Context *ctx, struct maildir **md, struct Progress *progress)
{
struct maildir *p, *last = NULL;
char fn[_POSIX_PATH_MAX];
struct mh_data *data = NULL;
int count;
char msgbuf[STRING];
- progress_t progress;
+ struct Progress progress;
memset(&mhs, 0, sizeof(mhs));
if (!ctx->quiet)
header_cache_t *hc = NULL;
#endif /* USE_HCACHE */
char msgbuf[STRING];
- progress_t progress;
+ struct Progress progress;
if (ctx->magic == MUTT_MH)
i = mh_check_mailbox(ctx, index_hint);
#define MUTT_PROGRESS_SIZE (1 << 0) /* traffic-based progress */
#define MUTT_PROGRESS_MSG (1 << 1) /* message-based progress */
-typedef struct
+struct Progress
{
unsigned short inc;
unsigned short flags;
long size;
unsigned int timestamp;
char sizestr[SHORT_STRING];
-} progress_t;
+};
-void mutt_progress_init(progress_t *progress, const char *msg,
+void mutt_progress_init(struct Progress *progress, const char *msg,
unsigned short flags, unsigned short inc, long size);
/* If percent is positive, it is displayed as percentage, otherwise
* percentage is calculated from progress->size and pos if progress
* was initialized with positive size, otherwise no percentage is shown */
-void mutt_progress_update(progress_t *progress, long pos, int percent);
+void mutt_progress_update(struct Progress *progress, long pos, int percent);
/* Windows for different parts of the screen */
struct MuttWindow
struct uri_tag *query_items;
- progress_t progress; /**< A progress bar */
+ struct Progress progress; /**< A progress bar */
int oldmsgcount;
int ignmsgcount; /**< Ignored messages */
struct nm_ctxdata *data = get_ctxdata(ctx);
int i, rc = 0;
char msgbuf[STRING];
- progress_t progress;
+ struct Progress progress;
char *uri = ctx->path;
int changed = 0;
char *line = NULL;
unsigned int lines = 0;
size_t off = 0;
- progress_t progress;
+ struct Progress progress;
if (msg)
mutt_progress_init(&progress, msg, MUTT_PROGRESS_MSG, ReadInc, -1);
anum_t last;
int restore;
unsigned char *messages;
- progress_t progress;
+ struct Progress progress;
#ifdef USE_HCACHE
header_cache_t *hc;
#endif
if (option(OPTLOADDESC))
{
unsigned int count = 0;
- progress_t progress;
+ struct Progress progress;
mutt_progress_init(&progress, _("Loading descriptions..."),
MUTT_PROGRESS_MSG, ReadInc, nserv->groups_num - i);
char buf[LONG_STRING] = "", *simple = NULL;
struct Buffer err;
int i;
- progress_t progress;
+ struct Progress progress;
strfcpy(buf, NONULL(Context->pattern), sizeof(buf));
if (prompt || op != MUTT_LIMIT)
char temp[LONG_STRING];
int incr;
struct Header *h = NULL;
- progress_t progress;
+ struct Progress progress;
const char *msg = NULL;
if (!*LastSearch || (op != OP_SEARCH_NEXT && op != OP_SEARCH_OPPOSITE))
int i, ret, old_count, new_count, deleted;
unsigned short hcached = 0, bcached;
POP_DATA *pop_data = (POP_DATA *) ctx->data;
- progress_t progress;
+ struct Progress progress;
#ifdef USE_HCACHE
header_cache_t *hc = NULL;
void *uidl = NULL;
char buf[LONG_STRING];
char path[_POSIX_PATH_MAX];
- progress_t progressbar;
+ struct Progress progressbar;
POP_DATA *pop_data = (POP_DATA *) ctx->data;
POP_CACHE *cache = NULL;
struct Header *h = ctx->hdrs[msgno];
int i, j, ret = 0;
char buf[LONG_STRING];
POP_DATA *pop_data = (POP_DATA *) ctx->data;
- progress_t progress;
+ struct Progress progress;
#ifdef USE_HCACHE
header_cache_t *hc = NULL;
#endif
int pop_connect(POP_DATA *pop_data);
int pop_open_connection(POP_DATA *pop_data);
int pop_query_d(POP_DATA *pop_data, char *buf, size_t buflen, char *msg);
-int pop_fetch_data(POP_DATA *pop_data, char *query, progress_t *progressbar,
+int pop_fetch_data(POP_DATA *pop_data, char *query, struct Progress *progressbar,
int (*funct)(char *, void *), void *data);
int pop_reconnect(struct Context *ctx);
void pop_logout(struct Context *ctx);
* -2 - invalid command or execution error,
* -3 - error in funct(*line, *data)
*/
-int pop_fetch_data(POP_DATA *pop_data, char *query, progress_t *progressbar,
+int pop_fetch_data(POP_DATA *pop_data, char *query, struct Progress *progressbar,
int (*funct)(char *, void *), void *data)
{
char buf[LONG_STRING];
{
int ret;
POP_DATA *pop_data = (POP_DATA *) ctx->data;
- progress_t progressbar;
+ struct Progress progressbar;
if (pop_data->status == POP_CONNECTED)
return 0;
{
char buf[1024];
FILE *fp = NULL;
- progress_t progress;
+ struct Progress progress;
struct stat st;
int r, term = 0;
size_t buflen = 0;