You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

menu.h 1.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #ifndef _IPXE_MENU_H
  2. #define _IPXE_MENU_H
  3. /** @file
  4. *
  5. * Menu selection
  6. *
  7. */
  8. FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
  9. #include <ipxe/list.h>
  10. /** A menu */
  11. struct menu {
  12. /** List of menus */
  13. struct list_head list;
  14. /** Name */
  15. const char *name;
  16. /** Title */
  17. const char *title;
  18. /** Menu items */
  19. struct list_head items;
  20. };
  21. /** A menu item */
  22. struct menu_item {
  23. /** List of menu items */
  24. struct list_head list;
  25. /** Label */
  26. const char *label;
  27. /** Text */
  28. const char *text;
  29. /** Shortcut key */
  30. int shortcut;
  31. /** Is default item */
  32. int is_default;
  33. };
  34. extern struct menu * create_menu ( const char *name, const char *title );
  35. extern struct menu_item * add_menu_item ( struct menu *menu, const char *label,
  36. const char *text, int shortcut,
  37. int is_default );
  38. extern void destroy_menu ( struct menu *menu );
  39. extern struct menu * find_menu ( const char *name );
  40. extern int show_menu ( struct menu *menu, unsigned long timeout,
  41. const char *select, struct menu_item **selected );
  42. #endif /* _IPXE_MENU_H */