[PATCH] s/PROG_/M_PROGRESS_/
Hi,
as suggested/requested by Brendan, attached is a patch against CVS HEAD
which brings the PROG_(SIZE|MSG) #defines in line with mutt coding style
by renaming them to M_PROGRESS_(SIZE|MSG).
bye, Rocco
--
:wq!
diff --git a/curs_lib.c b/curs_lib.c
index 96c5b9b..169168e 100644
--- a/curs_lib.c
+++ b/curs_lib.c
@@ -353,7 +353,7 @@ void mutt_progress_update (progress_t* progress, long pos)
{
if (progress->size)
{
- if (progress->flags & PROG_SIZE)
+ if (progress->flags & M_PROGRESS_SIZE)
mutt_pretty_size (progress->sizestr, sizeof (progress->sizestr),
progress->size);
else
snprintf (progress->sizestr, sizeof (progress->sizestr), "%ld",
progress->size);
@@ -365,7 +365,7 @@ void mutt_progress_update (progress_t* progress, long pos)
if (!progress->inc)
return;
- if (progress->flags & PROG_SIZE)
+ if (progress->flags & M_PROGRESS_SIZE)
{
if (pos >= progress->pos + (progress->inc << 10))
{
diff --git a/imap/message.c b/imap/message.c
index 11bfcaf..586d362 100644
--- a/imap/message.c
+++ b/imap/message.c
@@ -135,7 +135,7 @@ int imap_read_headers (IMAP_DATA* idata, int msgbegin, int
msgend)
if (evalhc)
{
mutt_progress_init (&progress, _("Evaluating cache..."),
- PROG_MSG, ReadInc, msgend + 1);
+ M_PROGRESS_MSG, ReadInc, msgend + 1);
snprintf (buf, sizeof (buf),
"UID FETCH 1:%u (UID FLAGS)", *uidnext - 1);
@@ -214,7 +214,7 @@ int imap_read_headers (IMAP_DATA* idata, int msgbegin, int
msgend)
#endif /* USE_HCACHE */
mutt_progress_init (&progress, _("Fetching message headers..."),
- PROG_MSG, ReadInc, msgend + 1);
+ M_PROGRESS_MSG, ReadInc, msgend + 1);
for (msgno = msgbegin; msgno <= msgend ; msgno++)
{
@@ -458,7 +458,7 @@ int imap_fetch_message (MESSAGE *msg, CONTEXT *ctx, int
msgno)
goto bail;
}
mutt_progress_init (&progressbar, _("Fetching message..."),
- PROG_SIZE, NetInc, bytes);
+ M_PROGRESS_SIZE, NetInc, bytes);
if (imap_read_literal (msg->fp, idata, bytes, &progressbar) < 0)
goto bail;
/* pick up trailing line */
@@ -596,7 +596,7 @@ int imap_append_message (CONTEXT *ctx, MESSAGE *msg)
rewind (fp);
mutt_progress_init (&progressbar, _("Uploading message..."),
- PROG_SIZE, NetInc, len);
+ M_PROGRESS_SIZE, NetInc, len);
imap_munge_mbox_name (mbox, sizeof (mbox), mailbox);
snprintf (buf, sizeof (buf), "APPEND %s (%s%s%s%s%s) {%lu}", mbox,
diff --git a/mbox.c b/mbox.c
index 2b32ba6..af3c7fb 100644
--- a/mbox.c
+++ b/mbox.c
@@ -119,7 +119,7 @@ int mmdf_parse_mailbox (CONTEXT *ctx)
buf[sizeof (buf) - 1] = 0;
snprintf (msgbuf, sizeof (msgbuf), _("Reading %s..."), ctx->path);
- mutt_progress_init (&progress, msgbuf, PROG_MSG, ReadInc, 0);
+ mutt_progress_init (&progress, msgbuf, M_PROGRESS_MSG, ReadInc, 0);
FOREVER
{
@@ -269,7 +269,7 @@ int mbox_parse_mailbox (CONTEXT *ctx)
tz = mutt_local_tz (0);
snprintf (msgbuf, sizeof (msgbuf), _("Reading %s..."), ctx->path);
- mutt_progress_init (&progress, msgbuf, PROG_MSG, ReadInc, 0);
+ mutt_progress_init (&progress, msgbuf, M_PROGRESS_MSG, ReadInc, 0);
loc = ftello (ctx->fp);
while (fgets (buf, sizeof (buf), ctx->fp) != NULL)
@@ -783,7 +783,7 @@ int mbox_sync_mailbox (CONTEXT *ctx, int *index_hint)
oldOffset = safe_calloc (ctx->msgcount - first, sizeof (struct m_update_t));
snprintf (msgbuf, sizeof (msgbuf), _("Writing %s..."), ctx->path);
- mutt_progress_init (&progress, msgbuf, PROG_MSG, WriteInc, ctx->msgcount);
+ mutt_progress_init (&progress, msgbuf, M_PROGRESS_MSG, WriteInc,
ctx->msgcount);
for (i = first, j = 0; i < ctx->msgcount; i++)
{
diff --git a/mh.c b/mh.c
index ec8408e..1447d14 100644
--- a/mh.c
+++ b/mh.c
@@ -1022,7 +1022,7 @@ int mh_read_dir (CONTEXT * ctx, const char *subdir)
memset (&mhs, 0, sizeof (mhs));
snprintf (msgbuf, sizeof (msgbuf), _("Reading %s..."), ctx->path);
- mutt_progress_init (&progress, msgbuf, PROG_MSG, ReadInc, 0);
+ mutt_progress_init (&progress, msgbuf, M_PROGRESS_MSG, ReadInc, 0);
maildir_update_mtime (ctx);
@@ -1524,7 +1524,7 @@ int mh_sync_mailbox (CONTEXT * ctx, int *index_hint)
#endif /* USE_HCACHE */
snprintf (msgbuf, sizeof (msgbuf), _("Writing %s..."), ctx->path);
- mutt_progress_init (&progress, msgbuf, PROG_MSG, WriteInc, ctx->msgcount);
+ mutt_progress_init (&progress, msgbuf, M_PROGRESS_MSG, WriteInc,
ctx->msgcount);
for (i = 0; i < ctx->msgcount; i++)
{
diff --git a/mutt_curses.h b/mutt_curses.h
index ac7915e..94c1a69 100644
--- a/mutt_curses.h
+++ b/mutt_curses.h
@@ -141,8 +141,8 @@ typedef struct color_line
struct color_line *next;
} COLOR_LINE;
-#define PROG_SIZE (1<<0) /* traffic-based progress */
-#define PROG_MSG (1<<1) /* message-based progress */
+#define M_PROGRESS_SIZE (1<<0) /* traffic-based progress */
+#define M_PROGRESS_MSG (1<<1) /* message-based progress */
typedef struct
{
diff --git a/pattern.c b/pattern.c
index 0a6abfc..c10f92d 100644
--- a/pattern.c
+++ b/pattern.c
@@ -1289,7 +1289,7 @@ int mutt_pattern_func (int op, char *prompt)
#endif
mutt_progress_init (&progress, _("Executing command on matching
messages..."),
- PROG_MSG, ReadInc,
+ M_PROGRESS_MSG, ReadInc,
(op == M_LIMIT) ? Context->msgcount : Context->vcount);
#define THIS_BODY Context->hdrs[i]->content
@@ -1437,7 +1437,7 @@ int mutt_search_command (int cur, int op)
if (op == OP_SEARCH_OPPOSITE)
incr = -incr;
- mutt_progress_init (&progress, _("Searching..."), PROG_MSG,
+ mutt_progress_init (&progress, _("Searching..."), M_PROGRESS_MSG,
ReadInc, Context->vcount);
for (i = cur + incr, j = 0 ; j != Context->vcount; j++)
diff --git a/pop.c b/pop.c
index 80c7398..ba2841f 100644
--- a/pop.c
+++ b/pop.c
@@ -237,7 +237,7 @@ static int pop_fetch_headers (CONTEXT *ctx)
}
mutt_progress_init (&progress, _("Fetching message headers..."),
- PROG_MSG, ReadInc, new_count - old_count);
+ M_PROGRESS_MSG, ReadInc, new_count - old_count);
if (ret == 0)
{
@@ -510,7 +510,7 @@ int pop_fetch_message (MESSAGE* msg, CONTEXT* ctx, int
msgno)
}
mutt_progress_init (&progressbar, _("Fetching message..."),
- PROG_SIZE, NetInc, h->content->length +
h->content->offset - 1);
+ M_PROGRESS_SIZE, NetInc, h->content->length +
h->content->offset - 1);
/* see if we can put in body cache; use our cache as fallback */
if (!(msg->fp = mutt_bcache_put (pop_data->bcache, h->data)))
@@ -609,7 +609,7 @@ int pop_sync_mailbox (CONTEXT *ctx, int *index_hint)
return -1;
mutt_progress_init (&progress, _("Marking messages deleted..."),
- PROG_MSG, WriteInc, ctx->deleted);
+ M_PROGRESS_MSG, WriteInc, ctx->deleted);
#if USE_HCACHE
hc = mutt_hcache_open (HeaderCache, ctx->path);
diff --git a/pop_lib.c b/pop_lib.c
index 7956f16..2c133d2 100644
--- a/pop_lib.c
+++ b/pop_lib.c
@@ -551,7 +551,7 @@ int pop_reconnect (CONTEXT *ctx)
int i;
mutt_progress_init (&progressbar, _("Verifying message indexes..."),
- PROG_SIZE, NetInc, 0);
+ M_PROGRESS_SIZE, NetInc, 0);
for (i = 0; i < ctx->msgcount; i++)
ctx->hdrs[i]->refno = -1;