Commit cec651a6 authored by Thomas Roessler's avatar Thomas Roessler

Add search code to the remailer chain selecting menu. [This is

pretty generic - should we add that code to menu.c?]
parent cf06a8c0
......@@ -26,6 +26,7 @@
#include "mutt.h"
#include "mutt_curses.h"
#include "mutt_menu.h"
#include "mutt_regex.h"
#include "mapping.h"
#include "remailer.h"
......@@ -48,9 +49,10 @@ struct coord
static REMAILER **mix_type2_list (size_t *l);
static REMAILER *mix_new_remailer (void);
static const char *mix_format_caps (REMAILER *r);
static int mix_chain_add (MIXCHAIN *chain, const char *s, REMAILER **type2_list);
static int mix_get_caps (const char *capstr);
static int mix_search (MUTTMENU *, regex_t *, int);
static void mix_add_entry (REMAILER ***, REMAILER *, size_t *, size_t *);
static int mix_chain_add (MIXCHAIN *chain, const char *s, REMAILER **type2_list);
static void mix_entry (char *b, size_t blen, MUTTMENU *menu, int num);
static void mix_free_remailer (REMAILER **r);
static void mix_free_type2_list (REMAILER ***ttlp);
......@@ -373,6 +375,14 @@ static void mix_entry (char *b, size_t blen, MUTTMENU *menu, int num)
NONULL (type2_list[num]->addr));
}
static int mix_search (MUTTMENU *m, regex_t *re, int n)
{
char buf[LONG_STRING];
mix_entry (buf, sizeof (buf), m, n);
return (regexec (re, buf, 0, NULL, 0));
}
static int mix_chain_add (MIXCHAIN *chain, const char *s,
REMAILER **type2_list)
{
......@@ -463,6 +473,7 @@ void mix_make_chain (LIST **chainp, int *redraw)
menu->menu = MENU_MIX;
menu->max = ttll;
menu->make_entry = mix_entry;
menu->search = mix_search;
menu->tag = NULL;
menu->title = _("Select a remailer chain.");
menu->data = type2_list;
......
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