Preliminary non-interactive use support

This commit is contained in:
okuji committed 1999-05-02 21:30:41 +00:00
1 parent 8c2e2a840c
commit be705674e1
6 files changed
+129 -43

No files matched your search

+2 -2
View File
@@ -191,7 +191,7 @@ restart:
if (password || errnum == ERR_BOOT_COMMAND)
{
printf("Press any key to continue...");
(void) getc ();
(void) getkey ();
returnit:
return 0;
}
@@ -273,7 +273,7 @@ returnit:
}
else if (substring("pause", cur_heap) < 1)
{
if (getc() == 27)
if (ASCII_CHAR (getkey ()) == 27)
return 1;
}
else if (substring("uppermem", cur_heap) < 1)
+8 -4
View File
@@ -282,6 +282,14 @@ extern unsigned long boot_drive;
extern char version_string[];
extern char *config_file;
#ifdef GRUB_UTIL
/* If not using config file, this variable is set to zero,
otherwise non-zero. */
extern int use_config_file;
/* If not using curses, this variable is set to zero, otherwise non-zero. */
extern int use_curses;
#endif
#ifndef STAGE1_5
/* GUI interface variables. */
extern int fallback;
@@ -427,10 +435,6 @@ void grub_putchar (int c);
Use ASCII_CHAR(ret) to extract the ASCII code. */
int getkey (void);
/* returns 0 if non-ASCII character */
#undef getc
#define getc() ASCII_CHAR (getkey ())
/* Like GETKEY, but doesn't block, and returns -1 if no keystroke is
available. */
int checkkey (void);
+4
View File
@@ -527,7 +527,11 @@ cmain(void)
* Here load the configuration file.
*/
#ifdef GRUB_UTIL
if (use_config_file && grub_open (config_file))
#else
if (grub_open (config_file))
#endif
{
int state = 0, prev_config_len = 0, prev_menu_len = 0;
char cmdline[1502], *ptr;