diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2019-05-12 07:27:09 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2019-05-12 07:27:09 +0000 |
commit | 5712c79ba9c3b1dd3a5235e4272a50d37132ee8a (patch) | |
tree | a687a2c9b8bc6ac22e7cfaf77ecaeab7353a0fd4 /usr.bin | |
parent | 5719378af92197b8710728dabaf6f270862d3b54 (diff) |
Remove menu_create_from_items, I thought I would use it for some later
work but I don't need it.
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/tmux/cmd-display-menu.c | 4 | ||||
-rw-r--r-- | usr.bin/tmux/menu.c | 22 | ||||
-rw-r--r-- | usr.bin/tmux/tmux.h | 6 |
3 files changed, 7 insertions, 25 deletions
diff --git a/usr.bin/tmux/cmd-display-menu.c b/usr.bin/tmux/cmd-display-menu.c index dfe4f9694d2..4299d9a6b3f 100644 --- a/usr.bin/tmux/cmd-display-menu.c +++ b/usr.bin/tmux/cmd-display-menu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-display-menu.c,v 1.1 2019/05/10 18:04:06 nicm Exp $ */ +/* $OpenBSD: cmd-display-menu.c,v 1.2 2019/05/12 07:27:08 nicm Exp $ */ /* * Copyright (c) 2019 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -79,7 +79,7 @@ cmd_display_menu_exec(struct cmd *self, struct cmdq_item *item) title = format_single(NULL, args_get(args, 'T'), c, s, wl, wp); else title = xstrdup(""); - menu = menu_create_from_string(string, c, fs, title); + menu = menu_create(string, c, fs, title); free(title); if (menu == NULL) { cmdq_error(item, "invalid menu %s", string); diff --git a/usr.bin/tmux/menu.c b/usr.bin/tmux/menu.c index f0452e7a5af..649be560a44 100644 --- a/usr.bin/tmux/menu.c +++ b/usr.bin/tmux/menu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: menu.c,v 1.1 2019/05/10 18:04:06 nicm Exp $ */ +/* $OpenBSD: menu.c,v 1.2 2019/05/12 07:27:08 nicm Exp $ */ /* * Copyright (c) 2019 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -103,24 +103,8 @@ menu_parse_item(struct menu *menu, const char *s, struct client *c, } struct menu * -menu_create_from_items(struct menu_item *items, u_int count, struct client *c, - struct cmd_find_state *fs, const char *title) -{ - struct menu *menu; - u_int i; - - menu = xcalloc(1, sizeof *menu); - menu->title = xstrdup(title); - - for (i = 0; i < count; i++) - menu_add_item(menu, &items[i], c, fs); - - return (menu); -} - -struct menu * -menu_create_from_string(const char *s, struct client *c, - struct cmd_find_state *fs, const char *title) +menu_create(const char *s, struct client *c, struct cmd_find_state *fs, + const char *title) { struct menu *menu; char *copy, *string, *next; diff --git a/usr.bin/tmux/tmux.h b/usr.bin/tmux/tmux.h index 7ff83cd7e2c..afd3a90e8cc 100644 --- a/usr.bin/tmux/tmux.h +++ b/usr.bin/tmux/tmux.h @@ -1,4 +1,4 @@ -/* $OpenBSD: tmux.h,v 1.895 2019/05/10 18:04:06 nicm Exp $ */ +/* $OpenBSD: tmux.h,v 1.896 2019/05/12 07:27:08 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -2551,9 +2551,7 @@ __dead void printflike(1, 2) fatal(const char *, ...); __dead void printflike(1, 2) fatalx(const char *, ...); /* menu.c */ -struct menu *menu_create_from_items(struct menu_item *, u_int, - struct client *, struct cmd_find_state *, const char *); -struct menu *menu_create_from_string(const char *, struct client *, +struct menu *menu_create(const char *, struct client *, struct cmd_find_state *, const char *); void menu_free(struct menu *); int menu_display(struct menu *, int, struct cmdq_item *, u_int, |