1 /* menu.h - Menu model function prototypes and data structures. */
3 * GRUB -- GRand Unified Bootloader
4 * Copyright (C) 2009 Free Software Foundation, Inc.
6 * GRUB is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
11 * GRUB is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
20 #ifndef GRUB_MENU_HEADER
21 #define GRUB_MENU_HEADER 1
25 struct bls_entry
*next
;
26 struct bls_entry
*prev
;
27 struct keyval
**keyvals
;
33 struct grub_menu_entry_class
36 struct grub_menu_entry_class
*next
;
40 struct grub_menu_entry
48 /* If set means not everybody is allowed to boot this entry. */
54 /* The classes associated with the menu entry:
55 used to choose an icon or other style attributes.
56 This is a dummy head node for the linked list, so for an entry E,
57 E.classes->next is the first class if it is not NULL. */
58 struct grub_menu_entry_class
*classes
;
60 /* The sourcecode of the menu entry, used by the editor. */
61 const char *sourcecode
;
63 /* Parameters to be passed to menu definition. */
71 /* The next element. */
72 struct grub_menu_entry
*next
;
74 /* BLS used to populate the entry */
75 struct bls_entry
*bls
;
77 typedef struct grub_menu_entry
*grub_menu_entry_t
;
82 /* The size of a menu. */
85 /* The list of menu entries. */
86 grub_menu_entry_t entry_list
;
88 typedef struct grub_menu
*grub_menu_t
;
90 /* Callback structure menu viewers can use to provide user feedback when
91 default entries are executed, possibly including fallback entries. */
92 typedef struct grub_menu_execute_callback
94 /* Called immediately before ENTRY is booted. */
95 void (*notify_booting
) (grub_menu_entry_t entry
, void *userdata
);
97 /* Called when executing one entry has failed, and another entry, ENTRY, will
98 be executed as a fallback. The implementation of this function should
99 delay for a period of at least 2 seconds before returning in order to
100 allow the user time to read the information before it can be lost by
102 void (*notify_fallback
) (grub_menu_entry_t entry
, void *userdata
);
104 /* Called when an entry has failed to execute and there is no remaining
105 fallback entry to attempt. */
106 void (*notify_failure
) (void *userdata
);
108 *grub_menu_execute_callback_t
;
110 grub_menu_entry_t
grub_menu_get_entry (grub_menu_t menu
, int no
);
111 int grub_menu_get_timeout (void);
112 void grub_menu_set_timeout (int timeout
);
113 void grub_menu_entry_run (grub_menu_entry_t entry
);
114 int grub_menu_get_default_entry_index (grub_menu_t menu
);
116 void grub_menu_init (void);
117 void grub_menu_fini (void);
119 #endif /* GRUB_MENU_HEADER */