/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2002,2003,2005,2007,2008,2009 Free Software Foundation, Inc.
*
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* GRUB 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 GRUB. If not, see <http://www.gnu.org/licenses/>.
*/
struct term_state
{
void *free;
int num_lines;
char *term_name;
};
/* If the more pager is active. */
static void
void
grub_normal_reset_more (void)
{
}
static void
print_more (void)
{
char key;
pos = grub_term_save_pos ();
/* TRANSLATORS: This has to fit on one line. It's ok to include few
words but don't write poems. */
if (!unicode_str)
{
return;
}
{
}
key = grub_getkey ();
/* Remove the message. */
/* Scroll one line or an entire page, depending on the key. */
{
}
{
grub_more = 0;
}
else
}
void
{
if (onoff == 1)
else if (real_grub_more > 0)
}
enum
{
};
static grub_uint32_t
{
if (in <= 0x7f)
return in;
{
switch (in)
{
case GRUB_UNICODE_LEFTARROW:
return GRUB_CP437_LEFTARROW;
case GRUB_UNICODE_UPARROW:
return GRUB_CP437_UPARROW;
case GRUB_UNICODE_RIGHTARROW:
return GRUB_CP437_RIGHTARROW;
case GRUB_UNICODE_DOWNARROW:
return GRUB_CP437_DOWNARROW;
case GRUB_UNICODE_HLINE:
return GRUB_CP437_HLINE;
case GRUB_UNICODE_VLINE:
return GRUB_CP437_VLINE;
case GRUB_UNICODE_CORNER_UL:
return GRUB_CP437_CORNER_UL;
case GRUB_UNICODE_CORNER_UR:
return GRUB_CP437_CORNER_UR;
case GRUB_UNICODE_CORNER_LL:
return GRUB_CP437_CORNER_LL;
case GRUB_UNICODE_CORNER_LR:
return GRUB_CP437_CORNER_LR;
}
return '?';
/* Better than nothing. */
switch (in)
{
case GRUB_UNICODE_LEFTARROW:
return '<';
case GRUB_UNICODE_UPARROW:
return '^';
case GRUB_UNICODE_RIGHTARROW:
return '>';
case GRUB_UNICODE_DOWNARROW:
return 'v';
case GRUB_UNICODE_HLINE:
return '-';
case GRUB_UNICODE_VLINE:
return '|';
case GRUB_UNICODE_CORNER_UL:
case GRUB_UNICODE_CORNER_UR:
case GRUB_UNICODE_CORNER_LL:
case GRUB_UNICODE_CORNER_LR:
return '+';
}
return '?';
}
return in;
}
void
{
grub_error_push ();
grub_error_pop ();
if (!unicode_str)
{
{
struct grub_unicode_glyph c =
{
.variant = 0,
.attributes = 0,
.ncomb = 0,
.combining = 0,
.estimated_width = 1,
};
{
}
if (*str == '\n')
{
c.base = '\r';
{
}
}
}
return;
}
}
grub_term_save_pos (void)
{
unsigned cnt = 0;
cnt++;
if (!ret)
return NULL;
return ret;
}
void
{
if (!pos)
return;
{
ptr++;
}
}
static void
grub_terminal_autoload_free (void)
{
unsigned i;
for (i = 0; i < 2; i++)
{
}
}
/* Read the file terminal.lst for auto-loading. */
void
{
char *filename;
if (!prefix)
{
return;
}
if (!filename)
{
return;
}
if (!file)
{
return;
}
/* Override previous terminal.lst. */
{
char *p, *name;
if (! buf)
break;
switch (buf[0])
{
case 'i':
break;
case 'o':
break;
}
if (!target)
continue;
if (! p)
continue;
*p = '\0';
while (*++p == ' ')
;
if (!cur)
{
continue;
}
if (! name)
{
continue;
}
{
continue;
}
}
}
static void
{
{
.variant = 0,
.attributes = 0,
.ncomb = 0,
.combining = 0,
.estimated_width = 1
};
{
int n;
while (n--)
return;
}
{
int i;
for (i = -1; i < (int) c->ncomb; i++)
{
if (i == -1)
{
{
if ((c->attributes & GRUB_UNICODE_GLYPH_ATTRIBUTE_MIRROR))
}
}
else
{
c2.estimated_width = 0;
}
}
}
else
if (c->base == '\n')
{
}
}
static void
{
struct grub_unicode_glyph c =
{
.variant = 0,
.attributes = 0,
.ncomb = 0,
.combining = 0,
.estimated_width = 1
};
}
/* Put a Unicode character. */
void
{
/* Combining character by itself? */
return;
}
static grub_ssize_t
int margin_left, int margin_right)
{
.base = ' ',
.variant = 0,
.attributes = 0,
.ncomb = 0,
.combining = 0
};
return (grub_term_width (term)
}
static grub_ssize_t
int margin_left)
{
}
static int
const grub_uint32_t * last_position,
int margin_left, int margin_right,
struct grub_term_output *term,
struct term_state *state,
int dry_run)
{
int lines = 0;
{
{
struct grub_unicode_glyph c = {
.variant = 0,
.attributes = 0,
.ncomb = 0,
.combining = 0
};
}
if (*ptr == ' ')
{
last_space = ptr;
}
{
ptr = last_space;
else if (line_width > max_width
{
}
else
lines++;
if (!dry_run)
{
{
/* Skip combining characters on non-UTF8 terminals. */
continue;
}
{
return 1;
}
}
if (!dry_run)
ptr++;
line_start = ptr;
}
}
if (line_start < last_position)
lines++;
if (!dry_run)
{
{
/* Skip combining characters on non-UTF8 terminals. */
continue;
}
}
}
static struct term_state *
{
return state;
if (!state)
{
return NULL;
}
term_states = state;
return state;
}
static int
int margin_left, int margin_right,
struct grub_term_output *term,
struct term_state *state)
{
{
{
{
return 1;
}
}
}
return 0;
}
static int
int margin_left, int margin_right)
{
if (!state)
return 0;
if (state->backlog_ucs4)
{
int ret;
if (!ret)
{
state->backlog_len = 0;
state->backlog_ucs4 = 0;
}
return ret;
}
if (state->backlog_glyphs)
{
int ret;
if (!ret)
{
state->backlog_len = 0;
state->backlog_glyphs = 0;
}
return ret;
}
return 0;
}
static int
const grub_uint32_t * last_position,
int margin_left, int margin_right,
int dry_run)
{
if (!dry_run)
{
if (backlog)
}
{
int ret;
{
return grub_term_getcharwidth (term, c);
}
margin_left));
if (visual_len < 0)
{
grub_print_error ();
return 0;
}
if (dry_run)
{
ret = 0;
ret++;
ret++;
}
else
{
if (!ret)
else
}
return ret;
}
}
void
const grub_uint32_t * last_position,
int margin_left, int margin_right,
struct grub_term_output *term)
{
term, 0, 0);
}
int
const grub_uint32_t * last_position,
int margin_left, int margin_right,
struct grub_term_output *term)
{
term, 0, 1);
}
void
{
int backlog = 0;
grub_error_push ();
grub_error_pop ();
if (!unicode_str)
{
{
struct grub_unicode_glyph c =
{
.variant = 0,
.attributes = 0,
.ncomb = 0,
.combining = 0,
.estimated_width = 1,
};
{
}
if (*str == '\n')
{
c.base = '\r';
{
}
}
}
return;
}
{
int cur;
if (cur)
backlog = 1;
}
while (backlog)
{
print_more ();
backlog = 0;
{
int cur;
if (cur)
backlog = 1;
}
}
}
void
grub_cls (void)
{
{
{
}
else
}
}