From: Richard Russon Date: Wed, 26 Sep 2018 23:14:57 +0000 (+0100) Subject: menu: rename functions X-Git-Tag: 2019-10-25~634^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c6abb10c651f8a54e5b8f3ad128f0bf80dc750c0;p=neomutt menu: rename functions --- diff --git a/addrbook.c b/addrbook.c index 5ea5f50af..daa2a5032 100644 --- a/addrbook.c +++ b/addrbook.c @@ -105,13 +105,13 @@ static const char *alias_format_str(char *buf, size_t buflen, size_t col, int co } /** - * alias_entry - Format a menu item for the alias list + * alias_make_entry - Format a menu item for the alias list * @param[out] buf Buffer in which to save string * @param[in] buflen Buffer length * @param[in] menu Menu containing aliases * @param[in] num Index into the menu */ -static void alias_entry(char *buf, size_t buflen, struct Menu *menu, int num) +static void alias_make_entry(char *buf, size_t buflen, struct Menu *menu, int num) { mutt_expando_format(buf, buflen, 0, MuttIndexWindow->cols, NONULL(AliasFormat), alias_format_str, (unsigned long) ((struct Alias **) menu->data)[num], @@ -211,7 +211,7 @@ void mutt_alias_menu(char *buf, size_t buflen, struct AliasList *aliases) } menu = mutt_menu_new(MENU_ALIAS); - menu->menu_make_entry = alias_entry; + menu->menu_make_entry = alias_make_entry; menu->menu_tag = alias_tag; menu->title = _("Aliases"); menu->help = mutt_compile_help(helpstr, sizeof(helpstr), MENU_ALIAS, AliasHelp); diff --git a/browser.c b/browser.c index eb27fad0d..054bc5b57 100644 --- a/browser.c +++ b/browser.c @@ -1065,13 +1065,13 @@ static int select_vfolder_search(struct Menu *menu, regex_t *re, int n) #endif /** - * folder_entry - Format a menu item for the folder browser + * folder_make_entry - Format a menu item for the folder browser * @param[out] buf Buffer in which to save string * @param[in] buflen Buffer length * @param[in] menu Menu containing aliases * @param[in] num Index into the menu */ -static void folder_entry(char *buf, size_t buflen, struct Menu *menu, int num) +static void folder_make_entry(char *buf, size_t buflen, struct Menu *menu, int num) { struct Folder folder; @@ -1096,13 +1096,13 @@ static void folder_entry(char *buf, size_t buflen, struct Menu *menu, int num) #ifdef USE_NOTMUCH /** - * vfolder_entry - Format a menu item for the virtual folder list + * vfolder_make_entry - Format a menu item for the virtual folder list * @param[out] buf Buffer in which to save string * @param[in] buflen Buffer length * @param[in] menu Menu containing aliases * @param[in] num Index into the menu */ -static void vfolder_entry(char *buf, size_t buflen, struct Menu *menu, int num) +static void vfolder_make_entry(char *buf, size_t buflen, struct Menu *menu, int num) { struct Folder folder; @@ -1505,7 +1505,7 @@ void mutt_select_file(char *file, size_t filelen, int flags, char ***files, int goto bail; } menu = mutt_menu_new(MENU_FOLDER); - menu->menu_make_entry = folder_entry; + menu->menu_make_entry = folder_make_entry; menu->menu_search = select_file_search; menu->title = title; menu->data = state.entry; @@ -1515,12 +1515,12 @@ void mutt_select_file(char *file, size_t filelen, int flags, char ***files, int #ifdef USE_NOTMUCH if (flags & MUTT_SEL_VFOLDER) { - menu->menu_make_entry = vfolder_entry; + menu->menu_make_entry = vfolder_make_entry; menu->menu_search = select_vfolder_search; } else #endif - menu->menu_make_entry = folder_entry; + menu->menu_make_entry = folder_make_entry; menu->help = mutt_compile_help(helpstr, sizeof(helpstr), MENU_FOLDER, #ifdef USE_NNTP diff --git a/compose.c b/compose.c index 7b23c8dc5..97cefd80e 100644 --- a/compose.c +++ b/compose.c @@ -248,13 +248,13 @@ static void init_header_padding(void) } /** - * snd_entry - Format a menu item for the attachment list + * snd_make_entry - Format a menu item for the attachment list * @param[out] buf Buffer in which to save string * @param[in] buflen Buffer length * @param[in] menu Menu containing aliases * @param[in] num Index into the menu */ -static void snd_entry(char *buf, size_t buflen, struct Menu *menu, int num) +static void snd_make_entry(char *buf, size_t buflen, struct Menu *menu, int num) { struct AttachCtx *actx = menu->data; @@ -678,10 +678,10 @@ static void compose_status_line(char *buf, size_t buflen, size_t col, int cols, struct Menu *menu, const char *p); /** - * compose_menu_redraw - Redraw the compose menu + * compose_custom_redraw - Redraw the compose menu * @param menu Current menu */ -static void compose_menu_redraw(struct Menu *menu) +static void compose_custom_redraw(struct Menu *menu) { struct ComposeRedrawData *rd = menu->redraw_data; @@ -916,15 +916,15 @@ int mutt_compose_menu(struct Email *msg, char *fcc, size_t fcclen, struct Email struct Menu *menu = mutt_menu_new(MENU_COMPOSE); menu->offset = HDR_ATTACH; - menu->menu_make_entry = snd_entry; - menu->menu_tag = mutt_tag_attach; + menu->menu_make_entry = snd_make_entry; + menu->menu_tag = attach_tag; #ifdef USE_NNTP if (news) menu->help = mutt_compile_help(helpstr, sizeof(helpstr), MENU_COMPOSE, ComposeNewsHelp); else #endif menu->help = mutt_compile_help(helpstr, sizeof(helpstr), MENU_COMPOSE, ComposeHelp); - menu->menu_custom_redraw = compose_menu_redraw; + menu->menu_custom_redraw = compose_custom_redraw; menu->redraw_data = &rd; mutt_menu_push_current(menu); diff --git a/curs_main.c b/curs_main.c index 97ea47c61..724a1a5c8 100644 --- a/curs_main.c +++ b/curs_main.c @@ -901,10 +901,10 @@ struct Mapping IndexNewsHelp[] = { #endif /** - * index_menu_redraw - Redraw the index + * index_custom_redraw - Redraw the index * @param menu Current Menu */ -static void index_menu_redraw(struct Menu *menu) +static void index_custom_redraw(struct Menu *menu) { if (menu->redraw & REDRAW_FULL) { @@ -987,7 +987,7 @@ int mutt_index_menu(void) IndexNewsHelp : #endif IndexHelp); - menu->menu_custom_redraw = index_menu_redraw; + menu->menu_custom_redraw = index_custom_redraw; mutt_menu_push_current(menu); if (!attach_msg) @@ -1136,7 +1136,7 @@ int mutt_index_menu(void) if (menu->menu == MENU_MAIN) { - index_menu_redraw(menu); + index_custom_redraw(menu); /* give visual indication that the next command is a tag- command */ if (tag) diff --git a/menu.c b/menu.c index 9544a4548..b2096163f 100644 --- a/menu.c +++ b/menu.c @@ -943,14 +943,14 @@ static int default_color(int i) } /** - * menu_search_generic - Search a menu for a item matching a regex + * generic_search - Search a menu for a item matching a regex * @param m Menu to search * @param re Regex to match * @param n Index number * @retval 0 Success - * @retval >0 Error, e.g. REG_BADPAT + * @retval >0 Error, e.g. REG_NOMATCH */ -static int menu_search_generic(struct Menu *m, regex_t *re, int n) +static int generic_search(struct Menu *m, regex_t *re, int n) { char buf[LONG_STRING]; @@ -990,7 +990,7 @@ struct Menu *mutt_menu_new(int menu) p->helpwin = MuttHelpWindow; p->messagewin = MuttMessageWindow; p->menu_color = default_color; - p->menu_search = menu_search_generic; + p->menu_search = generic_search; return p; } diff --git a/mutt_attach.h b/mutt_attach.h index 1b106513b..5f95b15c7 100644 --- a/mutt_attach.h +++ b/mutt_attach.h @@ -33,7 +33,7 @@ struct Menu; struct Email; struct Body; -int mutt_tag_attach(struct Menu *menu, int n, int m); +int attach_tag(struct Menu *menu, int n, int m); int mutt_attach_display_loop(struct Menu *menu, int op, struct Email *e, struct AttachCtx *actx, bool recv); diff --git a/mutt_history.c b/mutt_history.c index fc8521062..1ac22f6c6 100644 --- a/mutt_history.c +++ b/mutt_history.c @@ -65,13 +65,13 @@ static const char *history_format_str(char *buf, size_t buflen, size_t col, int } /** - * history_entry - Format a menu item for the history list + * history_make_entry - Format a menu item for the history list * @param[out] buf Buffer in which to save string * @param[in] buflen Buffer length * @param[in] menu Menu containing aliases * @param[in] num Index into the menu */ -static void history_entry(char *buf, size_t buflen, struct Menu *menu, int num) +static void history_make_entry(char *buf, size_t buflen, struct Menu *menu, int num) { char *entry = ((char **) menu->data)[num]; @@ -95,7 +95,7 @@ static void history_menu(char *buf, size_t buflen, char **matches, int match_cou snprintf(title, sizeof(title), _("History '%s'"), buf); struct Menu *menu = mutt_menu_new(MENU_GENERIC); - menu->menu_make_entry = history_entry; + menu->menu_make_entry = history_make_entry; menu->title = title; menu->help = mutt_compile_help(helpstr, sizeof(helpstr), MENU_GENERIC, HistoryHelp); mutt_menu_push_current(menu); diff --git a/ncrypt/crypt_gpgme.c b/ncrypt/crypt_gpgme.c index fb0cdb717..4188a5e3b 100644 --- a/ncrypt/crypt_gpgme.c +++ b/ncrypt/crypt_gpgme.c @@ -3150,13 +3150,13 @@ static const char *crypt_format_str(char *buf, size_t buflen, size_t col, int co } /** - * crypt_entry - Format a menu item for the key selection list + * crypt_make_entry - Format a menu item for the key selection list * @param[out] buf Buffer in which to save string * @param[in] buflen Buffer length * @param[in] menu Menu containing aliases * @param[in] num Index into the menu */ -static void crypt_entry(char *buf, size_t buflen, struct Menu *menu, int num) +static void crypt_make_entry(char *buf, size_t buflen, struct Menu *menu, int num) { struct CryptKeyInfo **key_table = menu->data; struct CryptEntry entry; @@ -4357,7 +4357,7 @@ static struct CryptKeyInfo *crypt_select_key(struct CryptKeyInfo *keys, struct Menu *menu = mutt_menu_new(menu_to_use); menu->max = i; - menu->menu_make_entry = crypt_entry; + menu->menu_make_entry = crypt_make_entry; menu->help = helpstr; menu->data = key_table; mutt_menu_push_current(menu); diff --git a/ncrypt/pgpkey.c b/ncrypt/pgpkey.c index 047b1e16f..5daf747b0 100644 --- a/ncrypt/pgpkey.c +++ b/ncrypt/pgpkey.c @@ -326,13 +326,13 @@ static const char *pgp_entry_fmt(char *buf, size_t buflen, size_t col, int cols, } /** - * pgp_entry - Format a menu item for the pgp key list + * pgp_make_entry - Format a menu item for the pgp key list * @param[out] buf Buffer in which to save string * @param[in] buflen Buffer length * @param[in] menu Menu containing aliases * @param[in] num Index into the menu */ -static void pgp_entry(char *buf, size_t buflen, struct Menu *menu, int num) +static void pgp_make_entry(char *buf, size_t buflen, struct Menu *menu, int num) { struct PgpUid **KeyTable = menu->data; struct PgpEntry entry; @@ -675,7 +675,7 @@ static struct PgpKeyInfo *pgp_select_key(struct PgpKeyInfo *keys, menu = mutt_menu_new(MENU_PGP); menu->max = i; - menu->menu_make_entry = pgp_entry; + menu->menu_make_entry = pgp_make_entry; menu->help = helpstr; menu->data = KeyTable; mutt_menu_push_current(menu); diff --git a/ncrypt/smime.c b/ncrypt/smime.c index 9b66f6cde..12275a943 100644 --- a/ncrypt/smime.c +++ b/ncrypt/smime.c @@ -435,13 +435,13 @@ static char *smime_key_flags(int flags) } /** - * smime_entry - Format a menu item for the smime key list + * smime_make_entry - Format a menu item for the smime key list * @param[out] buf Buffer in which to save string * @param[in] buflen Buffer length * @param[in] menu Menu containing aliases * @param[in] num Index into the menu */ -static void smime_entry(char *buf, size_t buflen, struct Menu *menu, int num) +static void smime_make_entry(char *buf, size_t buflen, struct Menu *menu, int num) { struct SmimeKey **Table = menu->data; struct SmimeKey *this = Table[num]; @@ -567,7 +567,7 @@ static struct SmimeKey *smime_select_key(struct SmimeKey *keys, char *query) /* Create the menu */ menu = mutt_menu_new(MENU_SMIME); menu->max = table_index; - menu->menu_make_entry = smime_entry; + menu->menu_make_entry = smime_make_entry; menu->help = helpstr; menu->data = table; menu->title = title; diff --git a/pager.c b/pager.c index 3d99cc12c..661e1edc7 100644 --- a/pager.c +++ b/pager.c @@ -1885,10 +1885,10 @@ struct PagerRedrawData }; /** - * pager_menu_redraw - Redraw the pager window + * pager_custom_redraw - Redraw the pager window * @param pager_menu Pager Menu */ -static void pager_menu_redraw(struct Menu *pager_menu) +static void pager_custom_redraw(struct Menu *pager_menu) { struct PagerRedrawData *rd = pager_menu->redraw_data; char buffer[LONG_STRING]; @@ -2291,7 +2291,7 @@ int mutt_pager(const char *banner, const char *fname, int flags, struct Pager *e rd.pager_window = mutt_mem_calloc(1, sizeof(struct MuttWindow)); pager_menu = mutt_menu_new(MENU_PAGER); - pager_menu->menu_custom_redraw = pager_menu_redraw; + pager_menu->menu_custom_redraw = pager_custom_redraw; pager_menu->redraw_data = &rd; mutt_menu_push_current(pager_menu); @@ -2299,7 +2299,7 @@ int mutt_pager(const char *banner, const char *fname, int flags, struct Pager *e { mutt_curs_set(0); - pager_menu_redraw(pager_menu); + pager_custom_redraw(pager_menu); if (BrailleFriendly) { diff --git a/postpone.c b/postpone.c index 122ecec58..1d10d72ca 100644 --- a/postpone.c +++ b/postpone.c @@ -187,13 +187,13 @@ void mutt_update_num_postponed(void) } /** - * post_entry - Format a menu item for the email list + * post_make_entry - Format a menu item for the email list * @param[out] buf Buffer in which to save string * @param[in] buflen Buffer length * @param[in] menu Menu containing aliases * @param[in] num Index into the menu */ -static void post_entry(char *buf, size_t buflen, struct Menu *menu, int num) +static void post_make_entry(char *buf, size_t buflen, struct Menu *menu, int num) { struct Context *ctx = menu->data; @@ -212,7 +212,7 @@ static struct Email *select_msg(void) char helpstr[LONG_STRING]; struct Menu *menu = mutt_menu_new(MENU_POST); - menu->menu_make_entry = post_entry; + menu->menu_make_entry = post_make_entry; menu->max = PostContext->mailbox->msg_count; menu->title = _("Postponed Messages"); menu->data = PostContext; diff --git a/query.c b/query.c index be08ee0c6..d9508136a 100644 --- a/query.c +++ b/query.c @@ -292,13 +292,13 @@ static const char *query_format_str(char *buf, size_t buflen, size_t col, int co } /** - * query_entry - Format a menu item for the query list + * query_make_entry - Format a menu item for the query list * @param[out] buf Buffer in which to save string * @param[in] buflen Buffer length * @param[in] menu Menu containing aliases * @param[in] num Index into the menu */ -static void query_entry(char *buf, size_t buflen, struct Menu *menu, int num) +static void query_make_entry(char *buf, size_t buflen, struct Menu *menu, int num) { struct Entry *entry = &((struct Entry *) menu->data)[num]; @@ -352,7 +352,7 @@ static void query_menu(char *buf, size_t buflen, struct Query *results, bool ret snprintf(title, sizeof(title), _("Query '%s'"), buf); menu = mutt_menu_new(MENU_QUERY); - menu->menu_make_entry = query_entry; + menu->menu_make_entry = query_make_entry; menu->menu_search = query_search; menu->menu_tag = query_tag; menu->title = title; @@ -407,7 +407,7 @@ static void query_menu(char *buf, size_t buflen, struct Query *results, bool ret mutt_menu_pop_current(menu); mutt_menu_destroy(&menu); menu = mutt_menu_new(MENU_QUERY); - menu->menu_make_entry = query_entry; + menu->menu_make_entry = query_make_entry; menu->menu_search = query_search; menu->menu_tag = query_tag; menu->title = title; diff --git a/recvattach.c b/recvattach.c index 605ba2fea..a3936512a 100644 --- a/recvattach.c +++ b/recvattach.c @@ -416,13 +416,13 @@ const char *attach_format_str(char *buf, size_t buflen, size_t col, int cols, } /** - * attach_entry - Format a menu item for the attachment list + * attach_make_entry - Format a menu item for the attachment list * @param[out] buf Buffer in which to save string * @param[in] buflen Buffer length * @param[in] menu Menu containing aliases * @param[in] num Index into the menu */ -static void attach_entry(char *buf, size_t buflen, struct Menu *menu, int num) +static void attach_make_entry(char *buf, size_t buflen, struct Menu *menu, int num) { struct AttachCtx *actx = menu->data; @@ -432,13 +432,13 @@ static void attach_entry(char *buf, size_t buflen, struct Menu *menu, int num) } /** - * mutt_tag_attach - Tag an attachment + * attach_tag - Tag an attachment * @param menu Menu listing attachments * @param n Index number of the attachment * @param m Action: 0 untag, 1 tag, -1 toggle * @retval num Net change in number of tagged attachments */ -int mutt_tag_attach(struct Menu *menu, int n, int m) +int attach_tag(struct Menu *menu, int n, int m) { struct AttachCtx *actx = menu->data; struct Body *cur = actx->idx[actx->v2r[n]]->content; @@ -1325,8 +1325,8 @@ void mutt_view_attachments(struct Email *e) struct Menu *menu = mutt_menu_new(MENU_ATTACH); menu->title = _("Attachments"); - menu->menu_make_entry = attach_entry; - menu->menu_tag = mutt_tag_attach; + menu->menu_make_entry = attach_make_entry; + menu->menu_tag = attach_tag; menu->help = mutt_compile_help(helpstr, sizeof(helpstr), MENU_ATTACH, AttachHelp); mutt_menu_push_current(menu);