iPXE
|
Menu selection. More...
#include <ipxe/list.h>
Go to the source code of this file.
Data Structures | |
struct | menu |
A menu. More... | |
struct | menu_item |
A menu item. More... | |
Functions | |
FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
struct menu * | create_menu (const char *name, const char *title) |
Create menu. More... | |
struct menu_item * | add_menu_item (struct menu *menu, const char *label, const char *text, int shortcut, int is_default) |
Add menu item. More... | |
void | destroy_menu (struct menu *menu) |
Destroy menu. More... | |
struct menu * | find_menu (const char *name) |
Find menu. More... | |
int | show_menu (struct menu *menu, unsigned long timeout, const char *select, struct menu_item **selected) |
Show menu. More... | |
Menu selection.
Definition in file menu.h.
FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
struct menu* create_menu | ( | const char * | name, |
const char * | title | ||
) |
Create menu.
name | Menu name, or NULL |
title | Menu title, or NULL |
menu | Menu, or NULL on failure |
Definition at line 48 of file menu.c.
References DBGC, destroy_menu(), find_menu(), INIT_LIST_HEAD, menu::items, len, menu::list, list_add_tail, menu::name, name, NULL, strcpy(), strlen(), menu::title, and zalloc().
Referenced by menu_exec().
struct menu_item* add_menu_item | ( | struct menu * | menu, |
const char * | label, | ||
const char * | text, | ||
int | shortcut, | ||
int | is_default | ||
) |
Add menu item.
menu | Menu |
label | Label, or NULL |
text | Text, or NULL |
shortcut | Shortcut key |
is_default | Item is the default item |
item | Menu item, or NULL on failure |
Definition at line 103 of file menu.c.
References menu_item::is_default, menu::items, menu_item::label, len, menu_item::list, list_add_tail, NULL, menu_item::shortcut, strcpy(), strlen(), menu_item::text, and zalloc().
Referenced by item_exec().
void destroy_menu | ( | struct menu * | menu | ) |
Destroy menu.
menu | Menu |
Definition at line 148 of file menu.c.
References free, menu::items, menu_item::list, menu::list, list_del, list_for_each_entry_safe, and tmp.
Referenced by choose_exec(), create_menu(), and menu_exec().
struct menu* find_menu | ( | const char * | name | ) |
Find menu.
name | Menu name, or NULL |
menu | Menu, or NULL if not found |
Definition at line 171 of file menu.c.
References menu::list, list_for_each_entry, menu::name, name, NULL, and strcmp().
Referenced by create_menu(), and parse_menu().
int show_menu | ( | struct menu * | menu, |
unsigned long | timeout, | ||
const char * | select, | ||
struct menu_item ** | selected | ||
) |
Show menu.
menu | Menu |
timeout | Timeout period, in ticks (0=indefinite) |
selected | Selected item |
rc | Return status code |
Definition at line 273 of file menu_ui.c.
References A_BOLD, assert(), attroff(), attron(), color_set, COLS, jump_scroller::count, CPAIR_NORMAL, jump_scroller::current, curs_set(), draw_menu_item(), draw_menu_items(), endwin(), ENOENT, erase(), initscr(), menu_item::is_default, menu::items, jump_scroll(), menu_item::label, list_for_each_entry, memset(), menu_ui::menu, MENU_COLS, menu_loop(), MENU_ROWS, mvprintw, NULL, rc, jump_scroller::rows, menu_ui::scroll, select(), snprintf(), start_color, strcmp(), strlen(), menu_ui::timeout, timeout(), menu::title, and TITLE_ROW.
Referenced by choose_exec().