/* terminfo.c - read a terminfo entry from the command line */ /* * GRUB -- GRand Unified Bootloader * Copyright (C) 2002,2004 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * ###################################################################### * * This file contains various functions dealing with different * terminal capabilities. It knows the difference between a vt52 and vt100 * terminal (and much more) and is mainly used the terminal emulation * in the serial driver. */ #include #include "terminfo.h" #include "tparm.h" #include "serial.h" /* Current terminal capabilities. Default is "vt100". */ struct terminfo term = { .name = "vt100", .cursor_address = "\e[%i%p1%d;%p2%dH", .clear_screen = "\e[H\e[J", .enter_standout_mode = "\e[7m", .exit_standout_mode = "\e[m" }; /* A number of escape sequences are provided in the string valued capabilities for easy encoding of characters there. Both \E and \e map to an ESCAPE character, ^x maps to a control-x for any appropriate x, and the sequences \n \l \r \t \b \f \s give a newline, line-feed, return, tab, backspace, form-feed, and space. Other escapes include \^ for ^, \\ for \, \, for comma, \: for :, and \0 for null. (\0 will produce \200, which does not terminate a string but behaves as a null character on most terminals, provid