]> glassweightruler.freedombox.rocks Git - Ventoy.git/blob - GRUB2/MOD_SRC/grub-2.04/include/grub/menu.h
add support for UnionTechOS fuyu (#864)
[Ventoy.git] / GRUB2 / MOD_SRC / grub-2.04 / include / grub / menu.h
1 /* menu.h - Menu model function prototypes and data structures. */
2 /*
3 * GRUB -- GRand Unified Bootloader
4 * Copyright (C) 2009 Free Software Foundation, Inc.
5 *
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.
10 *
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.
15 *
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/>.
18 */
19
20 #ifndef GRUB_MENU_HEADER
21 #define GRUB_MENU_HEADER 1
22
23 struct bls_entry
24 {
25 struct bls_entry *next;
26 struct bls_entry *prev;
27 struct keyval **keyvals;
28 int nkeyvals;
29 char *filename;
30 int visible;
31 };
32
33 struct grub_menu_entry_class
34 {
35 char *name;
36 struct grub_menu_entry_class *next;
37 };
38
39 /* The menu entry. */
40 struct grub_menu_entry
41 {
42 /* The title name. */
43 const char *title;
44
45 /* The identifier. */
46 const char *id;
47
48 /* If set means not everybody is allowed to boot this entry. */
49 int restricted;
50
51 /* Allowed users. */
52 const char *users;
53
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;
59
60 /* The sourcecode of the menu entry, used by the editor. */
61 const char *sourcecode;
62
63 /* Parameters to be passed to menu definition. */
64 int argc;
65 char **args;
66
67 int hotkey;
68
69 int submenu;
70
71 /* The next element. */
72 struct grub_menu_entry *next;
73
74 /* BLS used to populate the entry */
75 struct bls_entry *bls;
76 };
77 typedef struct grub_menu_entry *grub_menu_entry_t;
78
79 /* The menu. */
80 struct grub_menu
81 {
82 /* The size of a menu. */
83 int size;
84
85 /* The list of menu entries. */
86 grub_menu_entry_t entry_list;
87 };
88 typedef struct grub_menu *grub_menu_t;
89
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
93 {
94 /* Called immediately before ENTRY is booted. */
95 void (*notify_booting) (grub_menu_entry_t entry, void *userdata);
96
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
101 executing ENTRY. */
102 void (*notify_fallback) (grub_menu_entry_t entry, void *userdata);
103
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);
107 }
108 *grub_menu_execute_callback_t;
109
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);
115
116 void grub_menu_init (void);
117 void grub_menu_fini (void);
118
119 #endif /* GRUB_MENU_HEADER */