]> granicus.if.org Git - neomutt/commitdiff
tidy: rename functions
authorRichard Russon <rich@flatcap.org>
Fri, 19 Feb 2016 04:32:06 +0000 (04:32 +0000)
committerRichard Russon <rich@flatcap.org>
Sun, 6 Mar 2016 00:44:21 +0000 (00:44 +0000)
buffy.c
compose.c
curs_main.c
flags.c
main.c
menu.c
mx.c
pager.c
sidebar.c
sidebar.h

diff --git a/buffy.c b/buffy.c
index 78f54fe1e7da0de49733cf7971bf9797b4b2f7df..6182766847eeb65c782cecffa82c5f2b60895866 100644 (file)
--- a/buffy.c
+++ b/buffy.c
@@ -606,27 +606,27 @@ int mutt_buffy_check (int force)
       {
       case M_MBOX:
       case M_MMDF:
-       if (sidebar_should_refresh()) {
+       if (sb_should_refresh()) {
          buffy_mbox_update (tmp, &sb);
-         sidebar_updated();
+         sb_set_update_time();
        }
        if (buffy_mbox_hasnew (tmp, &sb) > 0)
          BuffyCount++;
        break;
 
       case M_MAILDIR:
-       if (sidebar_should_refresh()) {
+       if (sb_should_refresh()) {
          buffy_maildir_update (tmp);
-         sidebar_updated();
+         sb_set_update_time();
        }
        if (buffy_maildir_hasnew (tmp) > 0)
          BuffyCount++;
        break;
 
       case M_MH:
-       if (sidebar_should_refresh()) {
+       if (sb_should_refresh()) {
          mh_buffy_update (tmp->path, &tmp->msgcount, &tmp->msg_unread, &tmp->msg_flagged, &tmp->sb_last_checked);
-         sidebar_updated();
+         sb_set_update_time();
        }
        mh_buffy(tmp);
        if (tmp->new)
index 640b8dc79eda683596f5bce5b6f79ea6963565eb..dcc7423ba21f25eb4742180dd34f7422499e68a9 100644 (file)
--- a/compose.c
+++ b/compose.c
@@ -249,7 +249,7 @@ static void draw_envelope_addr (int line, ADDRESS *addr)
 
 static void draw_envelope (HEADER *msg, char *fcc)
 {
-  draw_sidebar();
+  sb_draw();
   draw_envelope_addr (HDR_FROM, msg->env->from);
   draw_envelope_addr (HDR_TO, msg->env->to);
   draw_envelope_addr (HDR_CC, msg->env->cc);
index 530b2447a43e91c8253826070f3cbabdadd0afc7..d52a5d06f5d1e4c463b06eeef1fc5f4bab0e0032 100644 (file)
@@ -618,10 +618,10 @@ int mutt_index_menu (void)
     if (menu->redraw & REDRAW_FULL)
     {
       menu_redraw_full (menu);
-      draw_sidebar();
+      sb_draw();
       mutt_show_error ();
     } else if (menu->redraw & REDRAW_SIDEBAR) {
-      draw_sidebar();
+      sb_draw();
       menu->redraw &= ~REDRAW_SIDEBAR;
     }
 
@@ -651,7 +651,7 @@ int mutt_index_menu (void)
         SidebarWidth = sw; /* Restore the sidebar width */
        move (option (OPTSTATUSONTOP) ? 0 : LINES-2, 0);
        SETCOLOR (MT_COLOR_STATUS);
-       set_buffystats (Context);
+       sb_set_buffystats (Context);
        mutt_paddstr (COLS, buf);
        NORMAL_COLOR;
        menu->redraw &= ~REDRAW_STATUS;
@@ -1228,7 +1228,7 @@ int mutt_index_menu (void)
        }
 
        mutt_expand_path (buf, sizeof (buf));
-       set_curbuffy (buf);
+       sb_set_open_buffy (buf);
        if (mx_get_magic (buf) <= 0)
        {
          mutt_error (_("%s is not a mailbox."), buf);
@@ -2325,7 +2325,7 @@ int mutt_index_menu (void)
       case OP_SIDEBAR_PREV:
       case OP_SIDEBAR_NEXT_NEW:
       case OP_SIDEBAR_PREV_NEW:
-        scroll_sidebar (op);
+        sb_change_mailbox (op);
         break;
       default:
        if (menu->menu == MENU_MAIN)
diff --git a/flags.c b/flags.c
index bf5f88a9c6824dcfae4e66903e35349ef21e544f..cd5fe4fa535fd8e516cceaff7c3c45365d51baae 100644 (file)
--- a/flags.c
+++ b/flags.c
@@ -264,7 +264,7 @@ void _mutt_set_flag (CONTEXT *ctx, HEADER *h, int flag, int bf, int upd_ctx)
    */
   if (h->searched && (changed != h->changed || deleted != ctx->deleted || tagged != ctx->tagged || flagged != ctx->flagged))
     h->searched = 0;
-  draw_sidebar();
+  sb_draw();
 }
 
 void mutt_tag_set_flag (int flag, int bf)
diff --git a/main.c b/main.c
index 4a6698d30ddfeafffdbf12fde6afe5b1b5787ab0..41136129a099b2ac3b3b0883b70d9c1358f65a95 100644 (file)
--- a/main.c
+++ b/main.c
@@ -1066,7 +1066,7 @@ int main (int argc, char **argv)
     if((Context = mx_open_mailbox (folder, ((flags & M_RO) || option (OPTREADONLY)) ? M_READONLY : 0, NULL))
        || !explicit_folder)
     {
-      set_curbuffy (folder);
+      sb_set_open_buffy (folder);
       mutt_index_menu ();
       if (Context)
        FREE (&Context);
diff --git a/menu.c b/menu.c
index 1b979f20545eba586fd0e0d7ea2d50794fb06b17..b44d44b3d277f277aeae3a79736c8ea192b9cead 100644 (file)
--- a/menu.c
+++ b/menu.c
@@ -240,7 +240,7 @@ void menu_redraw_index (MUTTMENU *menu)
   int do_color;
   int attr;
 
-  draw_sidebar();
+  sb_draw();
   for (i = menu->top; i < menu->top + menu->pagelen; i++)
   {
     if (i < menu->max)
diff --git a/mx.c b/mx.c
index e55b4bc0a5d374a899f92ce361d459ae5b80784f..bd46cd39ee8785ce9234ca5c038163b872bcce92 100644 (file)
--- a/mx.c
+++ b/mx.c
@@ -733,7 +733,7 @@ void mx_fastclose_mailbox (CONTEXT *ctx)
   for (i = 0; i < ctx->msgcount; i++)
     mutt_free_header (&ctx->hdrs[i]);
   ctx->msgcount -= ctx->deleted;
-  set_buffystats (ctx);
+  sb_set_buffystats (ctx);
   FREE (&ctx->hdrs);
   FREE (&ctx->v2r);
   FREE (&ctx->path);
diff --git a/pager.c b/pager.c
index bdce8be4526b3e9e543d2a25dd4feeddff703270..c7ccdddaf00d9c5e1688b8e3ec7018f4c8dfe049 100644 (file)
--- a/pager.c
+++ b/pager.c
@@ -1846,7 +1846,7 @@ mutt_pager (const char *banner, const char *fname, int flags, pager_t *extra)
       /* redraw the pager_index indicator, because the
        * flags for this message might have changed. */
       menu_redraw_current (index);
-      draw_sidebar();
+      sb_draw();
 
       /* print out the index status bar */
       menu_status_line (buffer, sizeof (buffer), index, NONULL(Status));
@@ -1860,7 +1860,7 @@ mutt_pager (const char *banner, const char *fname, int flags, pager_t *extra)
 
     /* if we're not using the index, update every time */
     if (index == 0)
-      draw_sidebar();
+      sb_draw();
 
     redraw = 0;
 
@@ -2802,7 +2802,7 @@ search_next:
       case OP_SIDEBAR_PREV_NEW:
       case OP_SIDEBAR_SCROLL_DOWN:
       case OP_SIDEBAR_SCROLL_UP:
-       scroll_sidebar (ch);
+       sb_change_mailbox (ch);
        break;
 
       default:
index 90add9cfe2ac60fd92588928cc4c0c90b764d5d2..88fadc6a91e86bc46fa471d08140911a74a7662f 100644 (file)
--- a/sidebar.c
+++ b/sidebar.c
@@ -129,7 +129,7 @@ calc_boundaries (void)
 }
 
 static const char *
-sidebar_format_str (char *dest, size_t destlen, size_t col, char op, const char *src,
+cb_format_str (char *dest, size_t destlen, size_t col, char op, const char *src,
        const char *prefix, const char *ifstring, const char *elsestring,
        unsigned long data, format_flag flags)
 {
@@ -191,9 +191,9 @@ sidebar_format_str (char *dest, size_t destlen, size_t col, char op, const char
        }
 
        if (optional)
-               mutt_FormatString (dest, destlen, col, ifstring,   sidebar_format_str, (unsigned long) sbe, flags);
+               mutt_FormatString (dest, destlen, col, ifstring,   cb_format_str, (unsigned long) sbe, flags);
        else if (flags & M_FORMAT_OPTIONAL)
-               mutt_FormatString (dest, destlen, col, elsestring, sidebar_format_str, (unsigned long) sbe, flags);
+               mutt_FormatString (dest, destlen, col, elsestring, cb_format_str, (unsigned long) sbe, flags);
 
        /* We return the format string, unchanged */
        return src;
@@ -219,7 +219,7 @@ make_sidebar_entry (char *buf, unsigned int buflen, int width, char *box,
        /* Temporarily lie about the screen width */
        int oc = COLS;
        COLS = width + SidebarWidth;
-       mutt_FormatString (buf, buflen, 0, NONULL(SidebarFormat), sidebar_format_str, (unsigned long) &sbe, 0);
+       mutt_FormatString (buf, buflen, 0, NONULL(SidebarFormat), cb_format_str, (unsigned long) &sbe, 0);
        COLS = oc;
 
        /* Force string to be exactly the right width */
@@ -238,7 +238,7 @@ make_sidebar_entry (char *buf, unsigned int buflen, int width, char *box,
 
 
 void
-draw_sidebar (void)
+sb_draw (void)
 {
 #ifndef USE_SLANG_CURSES
        attr_t attrs;
@@ -442,7 +442,7 @@ draw_sidebar (void)
 }
 
 int
-sidebar_should_refresh (void)
+sb_should_refresh (void)
 {
        if (option (OPTSIDEBAR) && (SidebarRefresh > 0)) {
                if ((time (NULL) - SidebarLastRefresh) >= SidebarRefresh) {
@@ -453,7 +453,7 @@ sidebar_should_refresh (void)
 }
 
 void
-scroll_sidebar (int op)
+sb_change_mailbox (int op)
 {
        BUFFY *b;
        if ((SidebarWidth == 0) || !CurBuffy)
@@ -508,11 +508,11 @@ scroll_sidebar (int op)
                        return;
        }
        calc_boundaries();
-       draw_sidebar();
+       sb_draw();
 }
 
 void
-set_buffystats (const CONTEXT *ctx)
+sb_set_buffystats (const CONTEXT *ctx)
 {
        /* Even if the sidebar's hidden,
         * we should take note of the new data. */
@@ -532,7 +532,7 @@ set_buffystats (const CONTEXT *ctx)
 }
 
 void
-set_curbuffy (char *path)
+sb_set_open_buffy (char *path)
 {
        BUFFY *b = CurBuffy = Incoming;
 
@@ -549,7 +549,7 @@ set_curbuffy (char *path)
 }
 
 void
-sidebar_updated (void)
+sb_set_update_time (void)
 {
        SidebarLastRefresh = time (NULL);
 }
index 20150b9aee77acae7b2839e7e13bc50f798a11d3..8eb13afdabfbe3a9f3ecdd5bc057199d49caf9ba 100644 (file)
--- a/sidebar.h
+++ b/sidebar.h
 
 typedef struct _context CONTEXT;
 
-void draw_sidebar (void);
-void scroll_sidebar (int op);
-void set_buffystats (const CONTEXT *ctx);
-void set_curbuffy (char *path);
-int  sidebar_should_refresh (void);
-void sidebar_updated (void);
+void         sb_change_mailbox (int op);
+void         sb_draw (void);
+void         sb_set_buffystats (const CONTEXT *ctx);
+void         sb_set_open_buffy (char *path);
+void         sb_set_update_time (void);
+int          sb_should_refresh (void);
 
 #endif /* SIDEBAR_H */