}
/**
- * 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
+ * alias_make_entry - Format a menu item for the alias list - Implements Menu::menu_make_entry()
*/
-static void alias_make_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 line)
{
mutt_expando_format(buf, buflen, 0, MuttIndexWindow->cols, NONULL(AliasFormat), alias_format_str,
- (unsigned long) ((struct Alias **) menu->data)[num],
+ (unsigned long) ((struct Alias **) menu->data)[line],
MUTT_FORMAT_ARROWCURSOR);
}
/**
- * alias_tag - Tag some aliases
- * @param menu Menu
- * @param n Current selection
- * @param m Current number of tagged aliases
- * @retval num How man more aliases are now tagged?
+ * alias_tag - Tag some aliases - Implements Menu::menu_tag()
*/
-static int alias_tag(struct Menu *menu, int n, int m)
+static int alias_tag(struct Menu *menu, int sel, int act)
{
- struct Alias *cur = ((struct Alias **) menu->data)[n];
+ struct Alias *cur = ((struct Alias **) menu->data)[sel];
bool ot = cur->tagged;
- cur->tagged = (m >= 0 ? m : !cur->tagged);
+ cur->tagged = ((act >= 0) ? act : !cur->tagged);
return cur->tagged - ot;
}
}
/**
- * select_file_search - Menu search callback for matching files
- * @param menu Current menu
- * @param re Regex to match
- * @param n Index of menu entry to match
- * @retval 0 Success
- * @retval 1 No match
+ * select_file_search - Menu search callback for matching files - Implements Menu::menu_search()
*/
-static int select_file_search(struct Menu *menu, regex_t *re, int n)
+static int select_file_search(struct Menu *menu, regex_t *rx, int line)
{
#ifdef USE_NNTP
if (OptNews)
- return regexec(re, ((struct FolderFile *) menu->data)[n].desc, 0, NULL, 0);
+ return regexec(rx, ((struct FolderFile *) menu->data)[line].desc, 0, NULL, 0);
#endif
- return regexec(re, ((struct FolderFile *) menu->data)[n].name, 0, NULL, 0);
+ return regexec(rx, ((struct FolderFile *) menu->data)[line].name, 0, NULL, 0);
}
#ifdef USE_NOTMUCH
/**
- * select_vfolder_search - Menu search callback for virtual folders
- * @param menu Current menu
- * @param re Regex to match
- * @param n Index of menu entry to match
- * @retval 0 Success
- * @retval 1 No match
+ * select_vfolder_search - Menu search callback for virtual folders - Implements Menu::menu_search()
*/
-static int select_vfolder_search(struct Menu *menu, regex_t *re, int n)
+static int select_vfolder_search(struct Menu *menu, regex_t *rx, int line)
{
- return regexec(re, ((struct FolderFile *) menu->data)[n].desc, 0, NULL, 0);
+ return regexec(rx, ((struct FolderFile *) menu->data)[line].desc, 0, NULL, 0);
}
#endif
/**
- * 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
+ * folder_make_entry - Format a menu item for the folder browser - Implements Menu::menu_make_entry()
*/
-static void folder_make_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 line)
{
struct Folder folder;
- folder.ff = &((struct FolderFile *) menu->data)[num];
- folder.num = num;
+ folder.ff = &((struct FolderFile *) menu->data)[line];
+ folder.num = line;
#ifdef USE_NNTP
if (OptNews)
#ifdef USE_NOTMUCH
/**
- * 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
+ * vfolder_make_entry - Format a menu item for the virtual folder list - Implements Menu::menu_make_entry()
*/
-static void vfolder_make_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 line)
{
struct Folder folder;
- folder.ff = &((struct FolderFile *) menu->data)[num];
- folder.num = num;
+ folder.ff = &((struct FolderFile *) menu->data)[line];
+ folder.num = line;
mutt_expando_format(buf, buflen, 0, MuttIndexWindow->cols, NONULL(VfolderFormat),
folder_format_str, (unsigned long) &folder, MUTT_FORMAT_ARROWCURSOR);
}
/**
- * file_tag - Tag an entry in the menu
- * @param menu Current menu
- * @param n Index of menu entry to tag
- * @param m If >=0 then multiple tags are allowed
- * @retval num Number of tagged menu items
+ * file_tag - Tag an entry in the menu - Implements Menu::menu_tag()
*/
-static int file_tag(struct Menu *menu, int n, int m)
+static int file_tag(struct Menu *menu, int sel, int act)
{
- struct FolderFile *ff = &(((struct FolderFile *) menu->data)[n]);
+ struct FolderFile *ff = &(((struct FolderFile *) menu->data)[sel]);
if (S_ISDIR(ff->mode) || (S_ISLNK(ff->mode) && link_is_dir(LastDir, ff->name)))
{
mutt_error(_("Can't attach a directory"));
}
bool ot = ff->tagged;
- ff->tagged = (m >= 0 ? m : !ff->tagged);
+ ff->tagged = ((act >= 0) ? act : !ff->tagged);
return ff->tagged - ot;
}
}
/**
- * 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
+ * snd_make_entry - Format a menu item for the attachment list - Implements Menu::menu_make_entry()
*/
-static void snd_make_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 line)
{
struct AttachCtx *actx = menu->data;
mutt_expando_format(buf, buflen, 0, MuttIndexWindow->cols, NONULL(AttachFormat),
- attach_format_str, (unsigned long) (actx->idx[actx->v2r[num]]),
+ attach_format_str, (unsigned long) (actx->idx[actx->v2r[line]]),
MUTT_FORMAT_STAT_FILE | MUTT_FORMAT_ARROWCURSOR);
}
struct Menu *menu, const char *p);
/**
- * compose_custom_redraw - Redraw the compose menu
- * @param menu Current menu
+ * compose_custom_redraw - Redraw the compose menu - Implements Menu::menu_custom_redraw()
*/
static void compose_custom_redraw(struct Menu *menu)
{
}
/**
- * index_make_entry - Format a menu item for the index 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
+ * index_make_entry - Format a menu item for the index list - Implements Menu::menu_make_entry()
*/
-void index_make_entry(char *buf, size_t buflen, struct Menu *menu, int num)
+void index_make_entry(char *buf, size_t buflen, struct Menu *menu, int line)
{
- if (!Context || !menu || (num < 0) || (num >= Context->mailbox->hdrmax))
+ if (!Context || !menu || (line < 0) || (line >= Context->mailbox->hdrmax))
return;
- struct Email *e = Context->mailbox->hdrs[Context->mailbox->v2r[num]];
+ struct Email *e = Context->mailbox->hdrs[Context->mailbox->v2r[line]];
if (!e)
return;
}
/**
- * index_color - Calculate the colour for a line of the index
- * @param index_no Index line number
- * @retval >0 Colour pair
- * @retval 0 No colour
+ * index_color - Calculate the colour for a line of the index - Implements Menu::menu_color()
*/
-int index_color(int index_no)
+int index_color(int line)
{
- if (!Context || (index_no < 0))
+ if (!Context || (line < 0))
return 0;
- struct Email *e = Context->mailbox->hdrs[Context->mailbox->v2r[index_no]];
+ struct Email *e = Context->mailbox->hdrs[Context->mailbox->v2r[line]];
if (e && e->pair)
return e->pair;
#endif
/**
- * index_custom_redraw - Redraw the index
- * @param menu Current Menu
+ * index_custom_redraw - Redraw the index - Implements Menu::menu_custom_redraw()
*/
static void index_custom_redraw(struct Menu *menu)
{
extern bool UncollapseJump;
extern bool UncollapseNew;
-int index_color(int index_no);
-void index_make_entry(char *buf, size_t buflen, struct Menu *menu, int num);
+int index_color(int line);
+void index_make_entry(char *buf, size_t buflen, struct Menu *menu, int line);
void mutt_draw_statusline(int cols, const char *buf, size_t buflen);
int mutt_index_menu(void);
void mutt_set_header_color(struct Context *ctx, struct Email *curhdr);
}
/**
- * default_color - Get the default colour
- * @param i Colour index (UNUSED)
- * @retval num Colour pair in an integer
+ * default_color - Get the default colour for a line of the menu - Implements Menu::menu_color()
*/
-static int default_color(int i)
+static int default_color(int line)
{
return ColorDefs[MT_COLOR_NORMAL];
}
/**
- * 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_NOMATCH
+ * generic_search - Search a menu for a item matching a regex - Implements Menu::menu_search()
*/
-static int generic_search(struct Menu *m, regex_t *re, int n)
+static int generic_search(struct Menu *menu, regex_t *rx, int line)
{
char buf[LONG_STRING];
- menu_make_entry(buf, sizeof(buf), m, n);
- return regexec(re, buf, 0, NULL, 0);
+ menu_make_entry(buf, sizeof(buf), menu, line);
+ return regexec(rx, buf, 0, NULL, 0);
}
/**
struct Email;
struct Body;
-int attach_tag(struct Menu *menu, int n, int m);
+int attach_tag(struct Menu *menu, int sel, int act);
int mutt_attach_display_loop(struct Menu *menu, int op, struct Email *e,
struct AttachCtx *actx, bool recv);
}
/**
- * 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
+ * history_make_entry - Format a menu item for the history list - Implements Menu::menu_make_entry()
*/
-static void history_make_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 line)
{
- char *entry = ((char **) menu->data)[num];
+ char *entry = ((char **) menu->data)[line];
mutt_expando_format(buf, buflen, 0, MuttIndexWindow->cols, "%s", history_format_str,
(unsigned long) entry, MUTT_FORMAT_ARROWCURSOR);
}
/**
- * 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
+ * crypt_make_entry - Format a menu item for the key selection list - Implements Menu::menu_make_entry()
*/
-static void crypt_make_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 line)
{
struct CryptKeyInfo **key_table = menu->data;
struct CryptEntry entry;
- entry.key = key_table[num];
- entry.num = num + 1;
+ entry.key = key_table[line];
+ entry.num = line + 1;
mutt_expando_format(buf, buflen, 0, MuttIndexWindow->cols, NONULL(PgpEntryFormat),
crypt_format_str, (unsigned long) &entry, MUTT_FORMAT_ARROWCURSOR);
}
/**
- * 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
+ * pgp_make_entry - Format a menu item for the pgp key list - Implements Menu::menu_make_entry()
*/
-static void pgp_make_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 line)
{
struct PgpUid **KeyTable = menu->data;
struct PgpEntry entry;
- entry.uid = KeyTable[num];
- entry.num = num + 1;
+ entry.uid = KeyTable[line];
+ entry.num = line + 1;
mutt_expando_format(buf, buflen, 0, MuttIndexWindow->cols, NONULL(PgpEntryFormat),
pgp_entry_fmt, (unsigned long) &entry, MUTT_FORMAT_ARROWCURSOR);
}
/**
- * 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
+ * smime_make_entry - Format a menu item for the smime key list - Implements Menu::menu_make_entry()
*/
-static void smime_make_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 line)
{
struct SmimeKey **Table = menu->data;
- struct SmimeKey *this = Table[num];
+ struct SmimeKey *this = Table[line];
char *truststate = NULL;
switch (this->trust)
{
};
/**
- * pager_custom_redraw - Redraw the pager window
- * @param pager_menu Pager Menu
+ * pager_custom_redraw - Redraw the pager window - Implements Menu::menu_custom_redraw()
*/
static void pager_custom_redraw(struct Menu *pager_menu)
{
}
/**
- * 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
+ * post_make_entry - Format a menu item for the email list - Implements Menu::menu_make_entry()
*/
-static void post_make_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 line)
{
struct Context *ctx = menu->data;
mutt_make_string_flags(buf, buflen, NONULL(IndexFormat), ctx,
- ctx->mailbox->hdrs[num], MUTT_FORMAT_ARROWCURSOR);
+ ctx->mailbox->hdrs[line], MUTT_FORMAT_ARROWCURSOR);
}
/**
}
/**
- * query_search - Search a Address menu item
- * @param m Current Menu
- * @param re Regex to match
- * @param n Index of menu item to test
- * @retval 0 Success
- * @retval -1 Error, or no match
+ * query_search - Search a Address menu item - Implements Menu::menu_search()
*
* Try to match various Address fields.
*/
-static int query_search(struct Menu *m, regex_t *re, int n)
+static int query_search(struct Menu *menu, regex_t *rx, int line)
{
- struct Entry *table = m->data;
+ struct Entry *table = menu->data;
- if (table[n].data->name && !regexec(re, table[n].data->name, 0, NULL, 0))
+ if (table[line].data->name && !regexec(rx, table[line].data->name, 0, NULL, 0))
return 0;
- if (table[n].data->other && !regexec(re, table[n].data->other, 0, NULL, 0))
+ if (table[line].data->other && !regexec(rx, table[line].data->other, 0, NULL, 0))
return 0;
- if (table[n].data->addr)
+ if (table[line].data->addr)
{
- if (table[n].data->addr->personal &&
- !regexec(re, table[n].data->addr->personal, 0, NULL, 0))
+ if (table[line].data->addr->personal &&
+ !regexec(rx, table[line].data->addr->personal, 0, NULL, 0))
{
return 0;
}
- if (table[n].data->addr->mailbox &&
- !regexec(re, table[n].data->addr->mailbox, 0, NULL, 0))
+ if (table[line].data->addr->mailbox &&
+ !regexec(rx, table[line].data->addr->mailbox, 0, NULL, 0))
{
return 0;
}
}
/**
- * 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
+ * query_make_entry - Format a menu item for the query list - Implements Menu::menu_make_entry()
*/
-static void query_make_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 line)
{
- struct Entry *entry = &((struct Entry *) menu->data)[num];
+ struct Entry *entry = &((struct Entry *) menu->data)[line];
- entry->data->num = num;
+ entry->data->num = line;
mutt_expando_format(buf, buflen, 0, MuttIndexWindow->cols, NONULL(QueryFormat),
query_format_str, (unsigned long) entry, MUTT_FORMAT_ARROWCURSOR);
}
/**
- * query_tag - Tag an entry in the Query Menu
- * @param menu Current Menu
- * @param n Index of menu entry to tag
- * @param m If >=0 then multiple tags are allowed
- * @retval num Number of tagged menu items
+ * query_tag - Tag an entry in the Query Menu - Implements Menu::menu_tag()
*/
-static int query_tag(struct Menu *menu, int n, int m)
+static int query_tag(struct Menu *menu, int sel, int act)
{
- struct Entry *cur = &((struct Entry *) menu->data)[n];
+ struct Entry *cur = &((struct Entry *) menu->data)[sel];
bool ot = cur->tagged;
- cur->tagged = m >= 0 ? m : !cur->tagged;
+ cur->tagged = ((act >= 0) ? act : !cur->tagged);
return cur->tagged - ot;
}
}
/**
- * 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
+ * attach_make_entry - Format a menu item for the attachment list - Implements Menu::menu_make_entry()
*/
-static void attach_make_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 line)
{
struct AttachCtx *actx = menu->data;
mutt_expando_format(buf, buflen, 0, MuttIndexWindow->cols, NONULL(AttachFormat),
- attach_format_str, (unsigned long) (actx->idx[actx->v2r[num]]),
+ attach_format_str, (unsigned long) (actx->idx[actx->v2r[line]]),
MUTT_FORMAT_ARROWCURSOR);
}
/**
- * 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
+ * attach_tag - Tag an attachment - Implements Menu::menu_tag()
*/
-int attach_tag(struct Menu *menu, int n, int m)
+int attach_tag(struct Menu *menu, int sel, int act)
{
struct AttachCtx *actx = menu->data;
- struct Body *cur = actx->idx[actx->v2r[n]]->content;
+ struct Body *cur = actx->idx[actx->v2r[sel]]->content;
bool ot = cur->tagged;
- cur->tagged = (m >= 0 ? m : !cur->tagged);
+ cur->tagged = ((act >= 0) ? act : !cur->tagged);
return cur->tagged - ot;
}