menu.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * Copyright 2010-2011 Calxeda, Inc.
  4. */
  5. #ifndef __MENU_H__
  6. #define __MENU_H__
  7. struct menu;
  8. struct menu *menu_create(char *title, int timeout, int prompt,
  9. void (*item_data_print)(void *),
  10. char *(*item_choice)(void *),
  11. void *item_choice_data);
  12. int menu_default_set(struct menu *m, char *item_key);
  13. int menu_get_choice(struct menu *m, void **choice);
  14. int menu_item_add(struct menu *m, char *item_key, void *item_data);
  15. int menu_destroy(struct menu *m);
  16. void menu_display_statusline(struct menu *m);
  17. int menu_default_choice(struct menu *m, void **choice);
  18. /**
  19. * menu_show() Show a boot menu
  20. *
  21. * This shows a menu and lets the user select an option. The menu is defined by
  22. * environment variables (see README.bootmenu).
  23. *
  24. * This function doesn't normally return, but if the users requests the command
  25. * problem, it will.
  26. *
  27. * @bootdelay: Delay to wait before running the default menu option (0 to run
  28. * the entry immediately)
  29. * @return If it returns, it always returns -1 to indicate that the boot should
  30. * be aborted and the command prompt should be provided
  31. */
  32. int menu_show(int bootdelay);
  33. #endif /* __MENU_H__ */