1N/A/* cmdline.c - the device-independent GRUB text command line */ 1N/A * GRUB -- GRand Unified Bootloader 1N/A * Copyright (C) 1999,2000,2001,2002,2004 Free Software Foundation, Inc. 1N/A * This program is free software; you can redistribute it and/or modify 1N/A * it under the terms of the GNU General Public License as published by 1N/A * the Free Software Foundation; either version 2 of the License, or 1N/A * (at your option) any later version. 1N/A * This program is distributed in the hope that it will be useful, 1N/A * but WITHOUT ANY WARRANTY; without even the implied warranty of 1N/A * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 1N/A * GNU General Public License for more details. 1N/A * You should have received a copy of the GNU General Public License 1N/A * along with this program; if not, write to the Free Software 1N/A * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 1N/A/* Find the next word from CMDLINE and return the pointer. If 1N/A AFTER_EQUAL is non-zero, assume that the character `=' is treated as 1N/A a space. Caution: this assumption is for backward compatibility. */ 1N/A /* Skip until we hit whitespace, or maybe an equal sign. */ 1N/A /* Skip whitespace, and maybe equal signs. */ 1N/A/* Print a helpful message for the command-line interface. */ 1N/A printf (
" [ Minimal BASH-like line editing is supported. For the first word, TAB\n" 1N/A " lists possible command completions. Anywhere else TAB lists the possible\n" 1N/A/* Find the builtin whose command name is COMMAND and return the 1N/A pointer. If not found, return 0. */ 1N/A /* Find the first space and terminate the command name. */ 1N/A /* Seek out the builtin whose command name is COMMAND. */ 1N/A /* Find the builtin for COMMAND. */ 1N/A /* Cannot find COMMAND. */ 1N/A/* Initialize the data for the command-line. */ 1N/A /* Initialization. */ 1N/A /* Restore memory probe state. */ 1N/A /* Initialize the data for the builtin commands. */ 1N/A/* Enter the command-line interface. HEAP is used for the command-line 1N/A buffer. Return only if FOREVER is nonzero and get_cmdline returns 1N/A nonzero (ESC is pushed). */ 1N/A /* Initialize the data and print a message. */ 1N/A /* Get the command-line with the minimal BASH-like interface. */ 1N/A /* If there was no command, grab a new one. */ 1N/A /* Find a builtin. */ 1N/A /* If BUILTIN cannot be run in the command-line, skip it. */ 1N/A /* Invalidate the cache, because the user may exchange removable 1N/A /* Start to count lines, only if the internal pager is in use. */ 1N/A /* Run BUILTIN->FUNC. */ 1N/A /* Finish the line count. */ 1N/A/* Run an entry from the script SCRIPT. HEAP is used for the 1N/A command-line buffer. If an error occurs, return non-zero, otherwise 1N/A /* Initialize the data. */ 1N/A * At this point something must have gone wrong, so dump the 1N/A * buffer and flip output back on. 1N/A /* If a fallback entry is defined, don't prompt a user's 1N/A /* Copy the first string in CUR_ENTRY to HEAP. */ 1N/A /* If there is no more command in SCRIPT... */ 1N/A /* If any kernel is not loaded, just exit successfully. */ 1N/A /* Otherwise, the command boot is run implicitly. */ 1N/A /* Find a builtin. */ 1N/A /* If BUILTIN cannot be run in the command-line, skip it. */ 1N/A /* Invalidate the cache, because the user may exchange removable 1N/A /* Run BUILTIN->FUNC. */