iPXE
menu.h
Go to the documentation of this file.
00001 #ifndef _IPXE_MENU_H
00002 #define _IPXE_MENU_H
00003 
00004 /** @file
00005  *
00006  * Menu selection
00007  *
00008  */
00009 
00010 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
00011 
00012 #include <ipxe/list.h>
00013 
00014 /** A menu */
00015 struct menu {
00016         /** List of menus */
00017         struct list_head list;
00018         /** Name */
00019         const char *name;
00020         /** Title */
00021         const char *title;
00022         /** Menu items */
00023         struct list_head items;
00024 };
00025 
00026 /** A menu item */
00027 struct menu_item {
00028         /** List of menu items */
00029         struct list_head list;
00030         /** Label */
00031         const char *label;
00032         /** Text */
00033         const char *text;
00034         /** Shortcut key */
00035         int shortcut;
00036         /** Is default item */
00037         int is_default;
00038 };
00039 
00040 extern struct menu * create_menu ( const char *name, const char *title );
00041 extern struct menu_item * add_menu_item ( struct menu *menu, const char *label,
00042                                           const char *text, int shortcut,
00043                                           int is_default );
00044 extern void destroy_menu ( struct menu *menu );
00045 extern struct menu * find_menu ( const char *name );
00046 extern int show_menu ( struct menu *menu, unsigned long timeout,
00047                        const char *select, struct menu_item **selected );
00048 
00049 #endif /* _IPXE_MENU_H */