Commit 2ffbb3b8 authored by Kevin J. McCarthy's avatar Kevin J. McCarthy

Add "mutt_" prefix to global sidebar functions.

Also, remove unused sb_init declaration.
parent 237cc214
......@@ -244,7 +244,7 @@ int mutt_parse_mailboxes (BUFFER *path, BUFFER *s, unsigned long data, BUFFER *e
{
tmp1=(*tmp)->next;
#ifdef USE_SIDEBAR
sb_notify_mailbox (*tmp, 0);
mutt_sb_notify_mailbox (*tmp, 0);
#endif
buffy_free (tmp);
*tmp=tmp1;
......@@ -280,7 +280,7 @@ int mutt_parse_mailboxes (BUFFER *path, BUFFER *s, unsigned long data, BUFFER *e
{
tmp1=(*tmp)->next;
#ifdef USE_SIDEBAR
sb_notify_mailbox (*tmp, 0);
mutt_sb_notify_mailbox (*tmp, 0);
#endif
buffy_free (tmp);
*tmp=tmp1;
......@@ -291,7 +291,7 @@ int mutt_parse_mailboxes (BUFFER *path, BUFFER *s, unsigned long data, BUFFER *e
if (!*tmp) {
*tmp = buffy_new (buf);
#ifdef USE_SIDEBAR
sb_notify_mailbox (*tmp, 1);
mutt_sb_notify_mailbox (*tmp, 1);
#endif
}
......@@ -582,7 +582,7 @@ int mutt_buffy_check (int force)
}
#ifdef USE_SIDEBAR
int should_refresh = sb_should_refresh();
int should_refresh = mutt_sb_should_refresh();
#endif
for (tmp = Incoming; tmp; tmp = tmp->next)
{
......@@ -657,7 +657,7 @@ int mutt_buffy_check (int force)
if (should_refresh)
{
SidebarNeedsRedraw = 1;
sb_set_update_time();
mutt_sb_set_update_time();
}
#endif
......
......@@ -623,7 +623,7 @@ int mutt_index_menu (void)
#ifdef USE_SIDEBAR
if (menu->redraw & REDRAW_SIDEBAR || SidebarNeedsRedraw)
{
sb_set_buffystats (Context);
mutt_sb_set_buffystats (Context);
menu_redraw_sidebar (menu);
}
#endif
......@@ -1198,7 +1198,7 @@ int mutt_index_menu (void)
#ifdef USE_SIDEBAR
else if (op == OP_SIDEBAR_OPEN)
{
const char *path = sb_get_highlight();
const char *path = mutt_sb_get_highlight();
if (!path || !*path)
break;
strncpy (buf, path, sizeof (buf));
......@@ -1227,7 +1227,7 @@ int mutt_index_menu (void)
mutt_expand_path (buf, sizeof (buf));
#ifdef USE_SIDEBAR
sb_set_open_buffy (buf);
mutt_sb_set_open_buffy (buf);
#endif
if (mx_get_magic (buf) <= 0)
{
......@@ -2347,7 +2347,7 @@ int mutt_index_menu (void)
case OP_SIDEBAR_PAGE_UP:
case OP_SIDEBAR_PREV:
case OP_SIDEBAR_PREV_NEW:
sb_change_mailbox (op);
mutt_sb_change_mailbox (op);
break;
case OP_SIDEBAR_TOGGLE_VISIBLE:
......
......@@ -1234,7 +1234,7 @@ int main (int argc, char **argv)
|| !explicit_folder)
{
#ifdef USE_SIDEBAR
sb_set_open_buffy (folder);
mutt_sb_set_open_buffy (folder);
#endif
mutt_index_menu ();
if (Context)
......
......@@ -238,7 +238,7 @@ void menu_redraw_status (MUTTMENU *menu)
void menu_redraw_sidebar (MUTTMENU *menu)
{
SidebarNeedsRedraw = 0;
sb_draw ();
mutt_sb_draw ();
}
#endif
......
......@@ -745,7 +745,7 @@ void mx_fastclose_mailbox (CONTEXT *ctx)
mutt_free_header (&ctx->hdrs[i]);
#ifdef USE_SIDEBAR
ctx->msgcount -= ctx->deleted;
sb_set_buffystats (ctx);
mutt_sb_set_buffystats (ctx);
#endif
FREE (&ctx->hdrs);
FREE (&ctx->v2r);
......
......@@ -1789,7 +1789,7 @@ mutt_pager (const char *banner, const char *fname, int flags, pager_t *extra)
if ((redraw & REDRAW_SIDEBAR) || SidebarNeedsRedraw)
{
SidebarNeedsRedraw = 0;
sb_draw ();
mutt_sb_draw ();
}
#endif
......@@ -2837,7 +2837,7 @@ search_next:
case OP_SIDEBAR_PAGE_UP:
case OP_SIDEBAR_PREV:
case OP_SIDEBAR_PREV_NEW:
sb_change_mailbox (ch);
mutt_sb_change_mailbox (ch);
break;
case OP_SIDEBAR_TOGGLE_VISIBLE:
......
......@@ -723,12 +723,12 @@ static void draw_sidebar (int num_rows, int num_cols, int div_width)
/**
* sb_draw - Completely redraw the sidebar
* mutt_sb_draw - Completely redraw the sidebar
*
* Completely refresh the sidebar region. First draw the divider; then, for
* each BUFFY, call make_sidebar_entry; finally blank out any remaining space.
*/
void sb_draw (void)
void mutt_sb_draw (void)
{
if (!option (OPTSIDEBAR))
return;
......@@ -753,7 +753,7 @@ void sb_draw (void)
}
/**
* sb_should_refresh - Check if the sidebar is due to be refreshed
* mutt_sb_should_refresh - Check if the sidebar is due to be refreshed
*
* The "sidebar_refresh_time" config option allows the user to limit the frequency
* with which the sidebar is refreshed.
......@@ -762,7 +762,7 @@ void sb_draw (void)
* 1 Yes, refresh is due
* 0 No, refresh happened recently
*/
int sb_should_refresh (void)
int mutt_sb_should_refresh (void)
{
if (!option (OPTSIDEBAR))
return 0;
......@@ -776,7 +776,7 @@ int sb_should_refresh (void)
}
/**
* sb_change_mailbox - Change the selected mailbox
* mutt_sb_change_mailbox - Change the selected mailbox
* @op: Operation code
*
* Change the selected mailbox, e.g. "Next mailbox", "Previous Mailbox
......@@ -790,7 +790,7 @@ int sb_should_refresh (void)
* OP_SIDEBAR_PAGE_DOWN, OP_SIDEBAR_PAGE_UP, OP_SIDEBAR_PREV,
* OP_SIDEBAR_PREV_NEW.
*/
void sb_change_mailbox (int op)
void mutt_sb_change_mailbox (int op)
{
if (!option (OPTSIDEBAR))
return;
......@@ -846,13 +846,13 @@ void sb_change_mailbox (int op)
}
/**
* sb_set_buffystats - Update the BUFFY's message counts from the CONTEXT
* mutt_sb_set_buffystats - Update the BUFFY's message counts from the CONTEXT
* @ctx: A mailbox CONTEXT
*
* Given a mailbox CONTEXT, find a matching mailbox BUFFY and copy the message
* counts into it.
*/
void sb_set_buffystats (const CONTEXT *ctx)
void mutt_sb_set_buffystats (const CONTEXT *ctx)
{
/* Even if the sidebar's hidden,
* we should take note of the new data. */
......@@ -874,14 +874,14 @@ void sb_set_buffystats (const CONTEXT *ctx)
}
/**
* sb_get_highlight - Get the BUFFY that's highlighted in the sidebar
* mutt_sb_get_highlight - Get the BUFFY that's highlighted in the sidebar
*
* Get the path of the mailbox that's highlighted in the sidebar.
*
* Returns:
* Mailbox path
*/
const char *sb_get_highlight (void)
const char *mutt_sb_get_highlight (void)
{
if (!option (OPTSIDEBAR))
return NULL;
......@@ -893,13 +893,13 @@ const char *sb_get_highlight (void)
}
/**
* sb_set_open_buffy - Set the OpnBuffy based on a mailbox path
* mutt_sb_set_open_buffy - Set the OpnBuffy based on a mailbox path
* @path: Mailbox path
*
* Search through the list of mailboxes. If a BUFFY has a matching path, set
* OpnBuffy to it.
*/
BUFFY *sb_set_open_buffy (const char *path)
BUFFY *mutt_sb_set_open_buffy (const char *path)
{
/* Even if the sidebar is hidden */
......@@ -925,12 +925,12 @@ BUFFY *sb_set_open_buffy (const char *path)
}
/**
* sb_set_update_time - Note the time that the sidebar was updated
* mutt_sb_set_update_time - Note the time that the sidebar was updated
*
* Update the timestamp representing the last sidebar update. If the user
* configures "sidebar_refresh_time", this will help to reduce traffic.
*/
void sb_set_update_time (void)
void mutt_sb_set_update_time (void)
{
/* XXX - should this be public? */
......@@ -938,7 +938,7 @@ void sb_set_update_time (void)
}
/**
* sb_notify_mailbox - The state of a BUFFY is about to change
* mutt_sb_notify_mailbox - The state of a BUFFY is about to change
*
* We receive a notification:
* After a new BUFFY has been created
......@@ -946,7 +946,7 @@ void sb_set_update_time (void)
*
* Before a deletion, check that our pointers won't be invalidated.
*/
void sb_notify_mailbox (BUFFY *b, int created)
void mutt_sb_notify_mailbox (BUFFY *b, int created)
{
if (!b)
return;
......
......@@ -23,14 +23,13 @@
#include "mutt.h"
#include "buffy.h"
void sb_change_mailbox (int op);
void sb_draw (void);
const char * sb_get_highlight (void);
void sb_init (void);
void sb_notify_mailbox (BUFFY *b, int created);
void sb_set_buffystats (const CONTEXT *ctx);
BUFFY * sb_set_open_buffy (const char *path);
void sb_set_update_time (void);
int sb_should_refresh (void);
void mutt_sb_change_mailbox (int op);
void mutt_sb_draw (void);
const char * mutt_sb_get_highlight (void);
void mutt_sb_notify_mailbox (BUFFY *b, int created);
void mutt_sb_set_buffystats (const CONTEXT *ctx);
BUFFY * mutt_sb_set_open_buffy (const char *path);
void mutt_sb_set_update_time (void);
int mutt_sb_should_refresh (void);
#endif /* SIDEBAR_H */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment