From 282cc4b1b068884308cccec1d615640fbbe6d9f7 Mon Sep 17 00:00:00 2001 From: okan Date: Tue, 6 Dec 2016 21:54:10 +0000 Subject: Add search_print_text(), a default callback for mi->print in menu_filter(). While here, normalize the remaining search_print_* argument paramters. --- search.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'search.c') diff --git a/search.c b/search.c index 80d0b1a..8c06f4d 100644 --- a/search.c +++ b/search.c @@ -15,7 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $OpenBSD: search.c,v 1.58 2016/12/01 20:28:19 okan Exp $ + * $OpenBSD: search.c,v 1.59 2016/12/06 21:54:10 okan Exp $ */ #include @@ -105,7 +105,13 @@ search_match_client(struct menu_q *menuq, struct menu_q *resultq, char *search) } void -search_print_cmd(struct menu *mi, int i) +search_print_text(struct menu *mi, int listing) +{ + (void)snprintf(mi->print, sizeof(mi->print), "%s", mi->text); +} + +void +search_print_cmd(struct menu *mi, int listing) { struct cmd_ctx *cmd = (struct cmd_ctx *)mi->ctx; @@ -113,7 +119,7 @@ search_print_cmd(struct menu *mi, int i) } void -search_print_group(struct menu *mi, int i) +search_print_group(struct menu *mi, int listing) { struct group_ctx *gc = (struct group_ctx *)mi->ctx; @@ -123,7 +129,7 @@ search_print_group(struct menu *mi, int i) } void -search_print_client(struct menu *mi, int list) +search_print_client(struct menu *mi, int listing) { struct client_ctx *cc = (struct client_ctx *)mi->ctx; char flag = ' '; -- cgit v1.2.3-2-gb3c3