iPXE
menu.h
Go to the documentation of this file.
1 #ifndef _IPXE_MENU_H
2 #define _IPXE_MENU_H
3 
4 /** @file
5  *
6  * Menu selection
7  *
8  */
9 
10 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
11 
12 #include <ipxe/list.h>
13 
14 /** A menu */
15 struct menu {
16  /** List of menus */
17  struct list_head list;
18  /** Name */
19  const char *name;
20  /** Title */
21  const char *title;
22  /** Menu items */
23  struct list_head items;
24 };
25 
26 /** A menu item */
27 struct menu_item {
28  /** List of menu items */
29  struct list_head list;
30  /** Label */
31  const char *label;
32  /** Text */
33  const char *text;
34  /** Shortcut key */
35  int shortcut;
36  /** Is default item */
38 };
39 
40 extern struct menu * create_menu ( const char *name, const char *title );
41 extern struct menu_item * add_menu_item ( struct menu *menu, const char *label,
42  const char *text, int shortcut,
43  int is_default );
44 extern void destroy_menu ( struct menu *menu );
45 extern struct menu * find_menu ( const char *name );
46 extern int show_menu ( struct menu *menu, unsigned long timeout,
47  const char *select, struct menu_item **selected );
48 
49 #endif /* _IPXE_MENU_H */
A menu item.
Definition: menu.h:27
const char * name
Definition: ath9k_hw.c:1984
struct list_head list
List of menus.
Definition: menu.h:17
const char * label
Label.
Definition: menu.h:31
struct list_head items
Menu items.
Definition: menu.h:23
A doubly-linked list entry (or list head)
Definition: list.h:18
struct list_head list
List of menu items.
Definition: menu.h:29
const char * name
Name.
Definition: menu.h:19
Linked lists.
const char * title
Title.
Definition: menu.h:21
int select(fd_set *readfds, int wait)
Check file descriptors for readiness.
Definition: posix_io.c:229
const char * text
Text.
Definition: menu.h:33
int is_default
Is default item.
Definition: menu.h:37
void timeout(int)
A menu.
Definition: menu.h:15
int shortcut
Shortcut key.
Definition: menu.h:35