]>
Commit | Line | Data |
---|---|---|
ce5bf700 | 1 | /* normal.h - prototypes for the normal mode */ |
2 | /* | |
4b13b216 | 3 | * GRUB -- GRand Unified Bootloader |
6fa42fa6 | 4 | * Copyright (C) 2002,2003,2005,2006,2007,2008,2009 Free Software Foundation, Inc. |
ce5bf700 | 5 | * |
5a79f472 | 6 | * GRUB is free software: you can redistribute it and/or modify |
ce5bf700 | 7 | * it under the terms of the GNU General Public License as published by |
5a79f472 | 8 | * the Free Software Foundation, either version 3 of the License, or |
ce5bf700 | 9 | * (at your option) any later version. |
10 | * | |
5a79f472 | 11 | * GRUB is distributed in the hope that it will be useful, |
ce5bf700 | 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 | |
5a79f472 | 17 | * along with GRUB. If not, see <http://www.gnu.org/licenses/>. |
ce5bf700 | 18 | */ |
19 | ||
4b13b216 | 20 | #ifndef GRUB_NORMAL_HEADER |
21 | #define GRUB_NORMAL_HEADER 1 | |
ce5bf700 | 22 | |
f4c623e1 | 23 | #include <grub/term.h> |
4b13b216 | 24 | #include <grub/symbol.h> |
25 | #include <grub/err.h> | |
f3b58148 | 26 | #include <grub/env.h> |
6fa42fa6 | 27 | #include <grub/menu.h> |
b1b797cb | 28 | #include <grub/command.h> |
d05f0df3 | 29 | #include <grub/file.h> |
ce5bf700 | 30 | |
7f39d92f | 31 | /* The standard left and right margin for some messages. */ |
32 | #define STANDARD_MARGIN 6 | |
33 | ||
992ffbbe | 34 | /* The type of a completion item. */ |
35 | enum grub_completion_type | |
36 | { | |
37 | GRUB_COMPLETION_TYPE_COMMAND, | |
38 | GRUB_COMPLETION_TYPE_DEVICE, | |
39 | GRUB_COMPLETION_TYPE_PARTITION, | |
40 | GRUB_COMPLETION_TYPE_FILE, | |
67f44c86 | 41 | GRUB_COMPLETION_TYPE_ARGUMENT |
992ffbbe | 42 | }; |
43 | typedef enum grub_completion_type grub_completion_type_t; | |
44 | ||
772e23da | 45 | extern struct grub_menu_viewer grub_normal_text_menu_viewer; |
6066889c | 46 | extern int grub_normal_exit_level; |
6fa42fa6 | 47 | |
230c0ad6 | 48 | /* Defined in `main.c'. */ |
4b13b216 | 49 | void grub_enter_normal_mode (const char *config); |
f04f02e4 | 50 | void grub_normal_execute (const char *config, int nested, int batch); |
cdce14fa VS |
51 | struct grub_term_screen_geometry |
52 | { | |
53 | /* The number of entries shown at a time. */ | |
54 | int num_entries; | |
55 | int first_entry_y; | |
56 | int first_entry_x; | |
57 | int entry_width; | |
58 | int timeout_y; | |
59 | int timeout_lines; | |
60 | int border; | |
61 | int right_margin; | |
62 | }; | |
63 | ||
64 | void grub_menu_init_page (int nested, int edit, | |
65 | struct grub_term_screen_geometry *geo, | |
2e713831 | 66 | struct grub_term_output *term); |
cdce14fa | 67 | void grub_normal_init_page (struct grub_term_output *term, int y); |
230c0ad6 | 68 | char *grub_file_getline (grub_file_t file); |
41c6f91f | 69 | void grub_cmdline_run (int nested, int force_auth); |
230c0ad6 | 70 | |
71 | /* Defined in `cmdline.c'. */ | |
2e713831 | 72 | char *grub_cmdline_get (const char *prompt); |
4b13b216 | 73 | grub_err_t grub_set_history (int newsize); |
230c0ad6 | 74 | |
75 | /* Defined in `completion.c'. */ | |
992ffbbe | 76 | char *grub_normal_do_completion (char *buf, int *restore, |
77 | void (*hook) (const char *item, grub_completion_type_t type, int count)); | |
230c0ad6 | 78 | |
79 | /* Defined in `misc.c'. */ | |
992ffbbe | 80 | grub_err_t grub_normal_print_device_info (const char *name); |
230c0ad6 | 81 | |
82 | /* Defined in `color.c'. */ | |
0ece25b1 | 83 | char *grub_env_write_color_normal (struct grub_env_var *var, const char *val); |
84 | char *grub_env_write_color_highlight (struct grub_env_var *var, const char *val); | |
681440aa | 85 | int grub_parse_color_name_pair (grub_uint8_t *ret, const char *name); |
230c0ad6 | 86 | |
87 | /* Defined in `menu_text.c'. */ | |
0ece25b1 | 88 | void grub_wait_after_message (void); |
f588f1c8 VS |
89 | void |
90 | grub_print_ucs4 (const grub_uint32_t * str, | |
91 | const grub_uint32_t * last_position, | |
92 | int margin_left, int margin_right, | |
93 | struct grub_term_output *term); | |
34f71cb8 VS |
94 | |
95 | void | |
96 | grub_print_ucs4_menu (const grub_uint32_t * str, | |
97 | const grub_uint32_t * last_position, | |
98 | int margin_left, int margin_right, | |
99 | struct grub_term_output *term, | |
100 | int skip_lines, int max_lines, grub_uint32_t contchar, | |
101 | struct grub_term_pos *pos); | |
8b8a81fa VS |
102 | int |
103 | grub_ucs4_count_lines (const grub_uint32_t * str, | |
104 | const grub_uint32_t * last_position, | |
105 | int margin_left, int margin_right, | |
106 | struct grub_term_output *term); | |
a2856736 VS |
107 | grub_size_t grub_getstringwidth (grub_uint32_t * str, |
108 | const grub_uint32_t * last_position, | |
109 | struct grub_term_output *term); | |
7f39d92f | 110 | void grub_print_message_indented (const char *msg, int margin_left, |
2e713831 VS |
111 | int margin_right, |
112 | struct grub_term_output *term); | |
113 | void | |
114 | grub_menu_text_register_instances (int entry, grub_menu_t menu, int nested); | |
115 | grub_err_t | |
dcb883b1 | 116 | grub_show_menu (grub_menu_t menu, int nested, int autobooted); |
4b13b216 | 117 | |
230c0ad6 | 118 | /* Defined in `handler.c'. */ |
d05f0df3 | 119 | void read_handler_list (void); |
120 | void free_handler_list (void); | |
230c0ad6 | 121 | |
122 | /* Defined in `dyncmd.c'. */ | |
027de555 | 123 | void read_command_list (const char *prefix); |
230c0ad6 | 124 | |
125 | /* Defined in `autofs.c'. */ | |
027de555 | 126 | void read_fs_list (const char *prefix); |
230c0ad6 | 127 | |
2fbcbbc3 VS |
128 | void grub_context_init (void); |
129 | void grub_context_fini (void); | |
d05f0df3 | 130 | |
027de555 | 131 | void read_crypto_list (const char *prefix); |
7316783f | 132 | |
027de555 | 133 | void read_terminal_list (const char *prefix); |
33c1ed4c | 134 | |
f4c623e1 | 135 | void grub_set_more (int onoff); |
d05f0df3 | 136 | |
5c56cac9 | 137 | void grub_normal_reset_more (void); |
c6f2fe52 | 138 | |
0a239a82 VS |
139 | void grub_xputs_normal (const char *str); |
140 | ||
a38b701c | 141 | extern int grub_extractor_level; |
7756d444 | 142 | |
bd960307 VS |
143 | grub_err_t |
144 | grub_normal_add_menu_entry (int argc, const char **args, char **classes, | |
d9bef9bc | 145 | const char *id, |
bd960307 | 146 | const char *users, const char *hotkey, |
fc55cc4c VS |
147 | const char *prefix, const char *sourcecode, |
148 | int submenu); | |
bd960307 | 149 | |
a37376e7 VS |
150 | grub_err_t |
151 | grub_normal_set_password (const char *user, const char *password); | |
152 | ||
fc55cc4c VS |
153 | void grub_normal_free_menu (grub_menu_t menu); |
154 | ||
df895792 VS |
155 | void grub_normal_auth_init (void); |
156 | void grub_normal_auth_fini (void); | |
157 | ||
cc19857a VS |
158 | void |
159 | grub_xnputs (const char *str, grub_size_t msg_len); | |
160 | ||
e4e37e8d VS |
161 | grub_command_t |
162 | grub_dyncmd_get_cmd (grub_command_t cmd); | |
163 | ||
17f38c0f VS |
164 | void |
165 | grub_gettext_reread_prefix (const char *val); | |
166 | ||
fa292343 B |
167 | enum grub_human_size_type |
168 | { | |
169 | GRUB_HUMAN_SIZE_NORMAL, | |
170 | GRUB_HUMAN_SIZE_SHORT, | |
171 | GRUB_HUMAN_SIZE_SPEED, | |
172 | }; | |
173 | ||
310d4214 | 174 | const char * |
fa292343 | 175 | grub_get_human_size (grub_uint64_t size, enum grub_human_size_type type); |
310d4214 | 176 | |
4b13b216 | 177 | #endif /* ! GRUB_NORMAL_HEADER */ |