TARGET_CPPFLAGS="$TARGET_CPPFLAGS -Wall -W"
TARGET_CPPFLAGS="$TARGET_CPPFLAGS -I\$(top_srcdir)/include"
TARGET_CPPFLAGS="$TARGET_CPPFLAGS -I\$(top_builddir)/include"
-TARGET_CPPFLAGS="$TARGET_CPPFLAGS -Dfloat=__float__bug__ -Ddouble=__double__bug__ -DGRUB_RUNTIME=1"
+TARGET_CPPFLAGS="$TARGET_CPPFLAGS -DGRUB_RUNTIME=1"
case "$target_cpu" in
i[[3456]]86) target_cpu=i386 ;;
name = regexp;
common = commands/regexp.c;
common = commands/wildcard.c;
- ldadd = libgnulib.a;
- dependencies = libgnulib.a;
+ ldadd = libregexp.a;
+ dependencies = libregexp.a;
cflags = '$(CFLAGS_POSIX) $(CFLAGS_GNULIB)';
cppflags = '$(CPPFLAGS_POSIX) $(CPPFLAGS_GNULIB)';
};
name = verify;
common = commands/verify.c;
cflags = '$(CFLAGS_POSIX)';
- cppflags = '-I$(srcdir)/lib/posix_wrap';
+ cppflags = '-I$(srcdir)/lib/posix_wrap/include';
};
module = {
struct grub_term_output *term;
const char *summary_translated = _(cmd->summary);
char *command_help;
- grub_wchar_t *unicode_command_help;
- grub_wchar_t *unicode_last_position;
+ grub_uint32_t *unicode_command_help;
+ grub_uint32_t *unicode_last_position;
command_help = grub_xasprintf ("%s %s", cmd->name, summary_translated);
if (!command_help)
FOR_ACTIVE_TERM_OUTPUTS(term)
{
unsigned stringwidth;
- grub_wchar_t *unicode_last_screen_position;
+ grub_uint32_t *unicode_last_screen_position;
unicode_last_screen_position = unicode_command_help;
COMPILE_TIME_ASSERT (ARRAY_SIZE (domains) == CONTEXT_CNT);
for (i = 0; i < ARRAY_SIZE (domains); i++)
{
- grub_err_t err;
err = grub_gettext_init_ext (&main_context[i], lang,
grub_env_get ("locale_dir"),
grub_env_get ("prefix"), domains[i]);
int left_x, int baseline_y)
{
int x;
- grub_wchar_t *logical;
+ grub_uint32_t *logical;
grub_ssize_t logical_len, visual_len;
struct grub_unicode_glyph *visual, *ptr;
grub_font_get_string_width (grub_font_t font, const char *str)
{
int width = 0;
- grub_wchar_t *ptr;
+ grub_uint32_t *ptr;
grub_ssize_t logical_len;
- grub_wchar_t *logical;
+ grub_uint32_t *logical;
logical_len = grub_utf8_to_ucs4_alloc (str, &logical, 0);
if (logical_len < 0)
#define errno grub_posix_errno
#define EINVAL GRUB_ERR_BAD_NUMBER
#define ENOMEM GRUB_ERR_OUT_OF_MEMORY
-#define EAGAIN GRUB_ERR_AGAIN
+#define EAGAIN GRUB_ERR_WAIT
/* FIXME: Disambiguate this. */
#define ENODEV GRUB_ERR_IO
#define ENOSYS GRUB_ERR_IO
#define ENOENT GRUB_ERR_IO
#define EIO GRUB_ERR_IO
#define EROFS GRUB_ERR_POSIX_EROFS
-#define EINTR GRUB_ERR_AGAIN
+#define EINTR GRUB_ERR_WAIT
#define EACCES GRUB_ERR_ACCESS_DENIED
#define ERANGE GRUB_ERR_BAD_ARGUMENT
#define EEXIST GRUB_ERR_POSIX_EEXIST
}
static inline grub_size_t
-mbstowcs (grub_wchar_t *dest, const char *src, grub_size_t n)
+mbstowcs (wchar_t *dest, const char *src, grub_size_t n)
{
- grub_size_t ret = grub_utf8_to_ucs4 (dest, n, (const grub_uint8_t *) src,
+ COMPILE_TIME_ASSERT( sizeof (grub_uint32_t) == sizeof (wchar_t));
+ grub_size_t ret = grub_utf8_to_ucs4 ((grub_uint32_t *) dest,
+ n, (const grub_uint8_t *) src,
-1, NULL);
if (ret < n)
dest[ret] = 0;
return grub_strdup (s);
}
-static inline grub_wchar_t *
-wmempcpy (grub_wchar_t *dest, const grub_wchar_t *src, grub_size_t n)
+static inline wchar_t *
+wmempcpy (wchar_t *dest, const wchar_t *src, grub_size_t n)
{
grub_memcpy (dest, src, sizeof (dest[0]) * n);
return dest + n;
mbschr (const char *src, int c)
{
int count = 0;
- grub_wchar_t code = 0;
+ grub_uint32_t code = 0;
const char *last_start = src;
while (1)
continue;
if (code == 0)
break;
- if (code == c)
+ if ((int) code == c)
return (char *) last_start;
last_start = src;
}
#include <grub/charset.h>
#include <grub/misc.h>
-#define wint_t grub_posix_wint_t
-#define wchar_t grub_posix_wchar_t
+#include <stddef.h>
+
#define mbstate_t grub_posix_mbstate_t
/* UCS-4. */
WEOF = -1
};
+typedef int wint_t;
+
typedef struct mbstate {
- grub_wchar_t code;
+ grub_uint32_t code;
int count;
} mbstate_t;
+
/* UTF-8. */
#define MB_CUR_MAX 4
#define MB_LEN_MAX 4
static inline grub_size_t
-mbrtowc (grub_wchar_t *pwc, const char *s, grub_size_t n, mbstate_t *ps)
+mbrtowc (wchar_t *pwc, const char *s, grub_size_t n, mbstate_t *ps)
{
- COMPILE_TIME_ASSERT (sizeof (wchar_t) == sizeof (grub_wchar_t));
- COMPILE_TIME_ASSERT (GRUB_WCHAR_MAX == WCHAR_MAX);
const char *ptr;
if (!s)
{
return 0;
}
-static inline grub_wchar_t *
-wmemchr (const grub_wchar_t *s, grub_wchar_t c, grub_size_t n)
+static inline wchar_t *
+wmemchr (const wchar_t *s, wchar_t c, grub_size_t n)
{
for (; n--; s++)
{
if (*s == c)
- return (grub_wchar_t *) s;
+ return (wchar_t *) s;
}
return 0;
}
static inline grub_size_t
-wcslen (const grub_wchar_t *s)
+wcslen (const wchar_t *s)
{
- const grub_wchar_t *ptr;
+ const wchar_t *ptr;
for (ptr = s; *ptr; ptr++);
return ptr - s;
}
{
int count = 0;
grub_size_t ret = 0;
- grub_wchar_t code = 0;
+ grub_uint32_t code = 0;
while (1)
{
#include <grub/i18n.h>
#include <grub/charset.h>
-static grub_wchar_t *kill_buf;
+static grub_uint32_t *kill_buf;
static int hist_size;
-static grub_wchar_t **hist_lines = 0;
+static grub_uint32_t **hist_lines = 0;
static int hist_pos = 0;
static int hist_end = 0;
static int hist_used = 0;
grub_err_t
grub_set_history (int newsize)
{
- grub_wchar_t **old_hist_lines = hist_lines;
- hist_lines = grub_malloc (sizeof (hist_lines[0]) * newsize);
+ grub_uint32_t **old_hist_lines = hist_lines;
+ hist_lines = grub_malloc (sizeof (grub_uint32_t *) * newsize);
/* Copy the old lines into the new buffer. */
if (old_hist_lines)
if (hist_pos < hist_end)
grub_memmove (hist_lines, old_hist_lines + hist_pos,
- (hist_end - hist_pos) * sizeof (grub_wchar_t *));
+ (hist_end - hist_pos) * sizeof (grub_uint32_t *));
else if (hist_used)
{
/* Copy the older part. */
grub_memmove (hist_lines, old_hist_lines + hist_pos,
- (hist_size - hist_pos) * sizeof (grub_wchar_t *));
+ (hist_size - hist_pos) * sizeof (grub_uint32_t *));
/* Copy the newer part. */
grub_memmove (hist_lines + hist_size - hist_pos, old_hist_lines,
- hist_end * sizeof (grub_wchar_t *));
+ hist_end * sizeof (grub_uint32_t *));
}
}
/* Get the entry POS from the history where `0' is the newest
entry. */
-static grub_wchar_t *
+static grub_uint32_t *
grub_history_get (unsigned pos)
{
pos = (hist_pos + pos) % hist_size;
}
static grub_size_t
-strlen_ucs4 (const grub_wchar_t *s)
+strlen_ucs4 (const grub_uint32_t *s)
{
- const grub_wchar_t *p = s;
+ const grub_uint32_t *p = s;
while (*p)
p++;
/* Replace the history entry on position POS with the string S. */
static void
-grub_history_set (int pos, grub_wchar_t *s, grub_size_t len)
+grub_history_set (int pos, grub_uint32_t *s, grub_size_t len)
{
grub_free (hist_lines[pos]);
- hist_lines[pos] = grub_malloc ((len + 1) * sizeof (grub_wchar_t));
+ hist_lines[pos] = grub_malloc ((len + 1) * sizeof (grub_uint32_t));
if (!hist_lines[pos])
{
grub_print_error ();
grub_errno = GRUB_ERR_NONE;
return ;
}
- grub_memcpy (hist_lines[pos], s, len * sizeof (grub_wchar_t));
+ grub_memcpy (hist_lines[pos], s, len * sizeof (grub_uint32_t));
hist_lines[pos][len] = 0;
}
/* Insert a new history line S on the top of the history. */
static void
-grub_history_add (grub_wchar_t *s, grub_size_t len)
+grub_history_add (grub_uint32_t *s, grub_size_t len)
{
/* Remove the oldest entry in the history to make room for a new
entry. */
/* Replace the history entry on position POS with the string S. */
static void
-grub_history_replace (unsigned pos, grub_wchar_t *s, grub_size_t len)
+grub_history_replace (unsigned pos, grub_uint32_t *s, grub_size_t len)
{
grub_history_set ((hist_pos + pos) % hist_size, s, len);
}
grub_cmdline_get (const char *prompt_translated)
{
grub_size_t lpos, llen;
- grub_wchar_t *buf;
+ grub_uint32_t *buf;
grub_size_t max_len = 256;
int key;
int histpos = 0;
- auto void cl_insert (const grub_wchar_t *str);
+ auto void cl_insert (const grub_uint32_t *str);
auto void cl_delete (unsigned len);
auto inline void __attribute__ ((always_inline)) cl_print (struct cmdline_term *cl_term, int pos,
- grub_wchar_t c);
+ grub_uint32_t c);
auto void cl_set_pos (struct cmdline_term *cl_term);
- auto void cl_print_all (int pos, grub_wchar_t c);
+ auto void cl_print_all (int pos, grub_uint32_t c);
auto void cl_set_pos_all (void);
auto void init_clterm (struct cmdline_term *cl_term_cur);
auto void init_clterm_all (void);
cl_set_pos (&cl_terms[i]);
}
- inline void __attribute__ ((always_inline)) cl_print (struct cmdline_term *cl_term, int pos, grub_wchar_t c)
+ inline void __attribute__ ((always_inline)) cl_print (struct cmdline_term *cl_term, int pos, grub_uint32_t c)
{
- grub_wchar_t *p;
+ grub_uint32_t *p;
for (p = buf + pos; p < buf + llen; p++)
{
}
}
- void cl_print_all (int pos, grub_wchar_t c)
+ void cl_print_all (int pos, grub_uint32_t c)
{
unsigned i;
for (i = 0; i < nterms; i++)
cl_print (&cl_terms[i], pos, c);
}
- void cl_insert (const grub_wchar_t *str)
+ void cl_insert (const grub_uint32_t *str)
{
grub_size_t len = strlen_ucs4 (str);
if (len + llen >= max_len)
{
- grub_wchar_t *nbuf;
+ grub_uint32_t *nbuf;
max_len *= 2;
- nbuf = grub_realloc (buf, sizeof (nbuf[0]) * max_len);
+ nbuf = grub_realloc (buf, sizeof (grub_uint32_t) * max_len);
if (nbuf)
buf = nbuf;
else
if (len + llen < max_len)
{
grub_memmove (buf + lpos + len, buf + lpos,
- (llen - lpos + 1) * sizeof (grub_wchar_t));
- grub_memmove (buf + lpos, str, len * sizeof (grub_wchar_t));
+ (llen - lpos + 1) * sizeof (grub_uint32_t));
+ grub_memmove (buf + lpos, str, len * sizeof (grub_uint32_t));
llen += len;
cl_set_pos_all ();
cl_set_pos_all ();
grub_memmove (buf + lpos, buf + lpos + len,
- sizeof (grub_wchar_t) * (llen - lpos + 1));
+ sizeof (grub_uint32_t) * (llen - lpos + 1));
llen -= len;
cl_print_all (lpos, 0);
cl_set_pos_all ();
init_clterm (&cl_terms[i]);
}
- buf = grub_malloc (max_len * sizeof (grub_wchar_t));
+ buf = grub_malloc (max_len * sizeof (grub_uint32_t));
if (!buf)
return 0;
{
struct cmdline_term *cl_term_cur;
struct grub_term_output *cur;
- grub_wchar_t *unicode_msg;
+ grub_uint32_t *unicode_msg;
grub_size_t msg_len = grub_strlen (prompt_translated) + 3;
nterms = 0;
return 0;
cl_term_cur = cl_terms;
- unicode_msg = grub_malloc (msg_len * sizeof (grub_wchar_t));
+ unicode_msg = grub_malloc (msg_len * sizeof (grub_uint32_t));
if (!unicode_msg)
return 0;;
msg_len = grub_utf8_to_ucs4 (unicode_msg, msg_len - 1,
int restore;
char *insertu8;
char *bufu8;
- grub_wchar_t c;
+ grub_uint32_t c;
c = buf[lpos];
buf[lpos] = '\0';
{
grub_size_t insertlen;
grub_ssize_t t;
- grub_wchar_t *insert;
+ grub_uint32_t *insert;
insertlen = grub_strlen (insertu8);
- insert = grub_malloc ((insertlen + 1) * sizeof (insert[0]));
+ insert = grub_malloc ((insertlen + 1) * sizeof (grub_uint32_t));
if (!insert)
{
grub_free (insertu8);
grub_free (kill_buf);
kill_buf = grub_malloc ((llen - lpos + 1)
- * sizeof (grub_wchar_t));
+ * sizeof (grub_uint32_t));
if (grub_errno)
{
grub_print_error ();
else
{
grub_memcpy (kill_buf, buf + lpos,
- (llen - lpos + 1) * sizeof (grub_wchar_t));
+ (llen - lpos + 1) * sizeof (grub_uint32_t));
kill_buf[llen - lpos] = 0;
}
case GRUB_TERM_CTRL | 'n':
case GRUB_TERM_KEY_DOWN:
{
- grub_wchar_t *hist;
+ grub_uint32_t *hist;
lpos = 0;
case GRUB_TERM_KEY_UP:
case GRUB_TERM_CTRL | 'p':
{
- grub_wchar_t *hist;
+ grub_uint32_t *hist;
lpos = 0;
grub_free (kill_buf);
- kill_buf = grub_malloc ((n + 1) * sizeof(grub_wchar_t));
+ kill_buf = grub_malloc ((n + 1) * sizeof(grub_uint32_t));
if (grub_errno)
{
grub_print_error ();
}
if (kill_buf)
{
- grub_memcpy (kill_buf, buf, n * sizeof(grub_wchar_t));
+ grub_memcpy (kill_buf, buf, n * sizeof(grub_uint32_t));
kill_buf[n] = 0;
}
default:
if (grub_isprint (key))
{
- grub_wchar_t str[2];
+ grub_uint32_t str[2];
str[0] = key;
str[1] = '\0';
histpos = 0;
if (strlen_ucs4 (buf) > 0)
{
- grub_wchar_t empty[] = { 0 };
+ grub_uint32_t empty[] = { 0 };
grub_history_replace (histpos, buf, llen);
grub_history_add (empty, 0);
}
grub_term_cls (term);
- if (!grub_term_is_tiny (term))
- {
- int msg_len;
- int posx;
- const char *msg = _("GNU GRUB version %s");
- char *msg_formatted;
- grub_wchar_t *unicode_msg;
- grub_wchar_t *last_position;
-
- msg_formatted = grub_xasprintf (msg, PACKAGE_VERSION);
- if (!msg_formatted)
- return;
+ msg_formatted = grub_xasprintf (msg, PACKAGE_VERSION);
+ if (!msg_formatted)
+ return;
- msg_len = grub_utf8_to_ucs4_alloc (msg_formatted,
- &unicode_msg, &last_position);
- grub_free (msg_formatted);
+ msg_len = grub_utf8_to_ucs4_alloc (msg_formatted,
+ &unicode_msg, &last_position);
+ grub_free (msg_formatted);
- if (msg_len < 0)
- {
- return;
- }
-
- posx = grub_getstringwidth (unicode_msg, last_position, term);
- posx = (grub_term_width (term) - posx) / 2;
- grub_term_gotoxy (term, posx, 1);
-
- grub_print_ucs4 (unicode_msg, last_position, 0, 0, term);
- grub_putcode ('\n', term);
- grub_putcode ('\n', term);
- grub_free (unicode_msg);
+ if (msg_len < 0)
+ {
+ return;
}
posx = grub_getstringwidth (unicode_msg, last_position, term);
return grub_errno;
FOR_ACTIVE_TERM_OUTPUTS(term)
- if (!grub_term_is_tiny (term))
- {
- grub_normal_init_page (term, 1);
- grub_term_setcursor (term, 1);
-
- if (grub_term_width (term) > 3 + STANDARD_MARGIN + 20)
- grub_print_message_indented (msg_formatted, 3, STANDARD_MARGIN, term);
- else
- grub_print_message_indented (msg_formatted, 0, 0, term);
- grub_putcode ('\n', term);
- grub_putcode ('\n', term);
- grub_putcode ('\n', term);
- }
+ {
+ grub_normal_init_page (term, 1);
+ grub_term_setcursor (term, 1);
+
+ if (grub_term_width (term) > 3 + STANDARD_MARGIN + 20)
+ grub_print_message_indented (msg_formatted, 3, STANDARD_MARGIN, term);
+ else
+ grub_print_message_indented (msg_formatted, 0, 0, term);
+ grub_putcode ('\n', term);
+ grub_putcode ('\n', term);
+ grub_putcode ('\n', term);
+ }
grub_free (msg_formatted);
return 0;
struct term_state
{
struct term_state *next;
- const struct grub_unicode_glyph *backlog_glyphs;
- const grub_wchar_t *backlog_ucs4;
+ struct grub_unicode_glyph *backlog_glyphs;
+ const grub_uint32_t *backlog_ucs4;
int backlog_fixed_tab;
grub_size_t backlog_len;
static int grub_more;
static void
-putcode_real (grub_wchar_t code, struct grub_term_output *term, int fixed_tab);
+putcode_real (grub_uint32_t code, struct grub_term_output *term, int fixed_tab);
void
grub_normal_reset_more (void)
char key;
struct grub_term_coordinate *pos;
grub_term_output_t term;
- grub_wchar_t *unicode_str, *unicode_last_position;
+ grub_uint32_t *unicode_str, *unicode_last_position;
pos = grub_term_save_pos ();
GRUB_CP437_CORNER_UL = 0xda,
};
-char
-grub_translit (grub_wchar_t in)
+static grub_uint32_t
+map_code (grub_uint32_t in, struct grub_term_output *term)
{
- if (!(in & ~0x7f))
- return in;
-
- 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 '?';
-}
-
-static grub_wchar_t
-map_code (grub_wchar_t in, struct grub_term_output *term)
-{
- if (!(in & ~0x7f))
+ if (in <= 0x7f)
return in;
switch (term->flags & GRUB_TERM_CODE_TYPE_MASK)
case GRUB_UNICODE_CORNER_LR:
return GRUB_CP437_CORNER_LR;
}
+ return '?';
case GRUB_TERM_CODE_TYPE_ASCII:
/* Better than nothing. */
- return grub_translit (in);
+ 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_puts_terminal (const char *str, struct grub_term_output *term)
{
- grub_wchar_t *unicode_str, *unicode_last_position;
+ grub_uint32_t *unicode_str, *unicode_last_position;
grub_error_push ();
grub_utf8_to_ucs4_alloc (str, &unicode_str,
&unicode_last_position);
for (i = -1; i < (int) c->ncomb; i++)
{
grub_uint8_t u8[20], *ptr;
- grub_wchar_t code;
+ grub_uint32_t code;
if (i == -1)
{
}
static void
-putcode_real (grub_wchar_t code, struct grub_term_output *term, int fixed_tab)
+putcode_real (grub_uint32_t code, struct grub_term_output *term, int fixed_tab)
{
struct grub_unicode_glyph c =
{
/* Put a Unicode character. */
void
-grub_putcode (grub_wchar_t code, struct grub_term_output *term)
+grub_putcode (grub_uint32_t code, struct grub_term_output *term)
{
/* Combining character by itself? */
if (grub_unicode_get_comb_type (code) != GRUB_UNICODE_COMB_NONE)
}
static int
-print_ucs4_terminal (const grub_wchar_t * str,
- const grub_wchar_t * last_position,
+print_ucs4_terminal (const grub_uint32_t * str,
+ const grub_uint32_t * last_position,
int margin_left, int margin_right,
struct grub_term_output *term,
struct term_state *state,
grub_uint32_t contchar,
int primitive_wrap, int fill_right, struct grub_term_pos *pos)
{
- const grub_wchar_t *ptr;
+ const grub_uint32_t *ptr;
grub_ssize_t startwidth = dry_run ? 0 : get_startwidth (term, margin_left);
grub_ssize_t line_width = startwidth;
grub_ssize_t lastspacewidth = 0;
grub_ssize_t max_width = get_maxwidth (term, margin_left, margin_right);
- const grub_wchar_t *line_start = str, *last_space = str - 1;
+ const grub_uint32_t *line_start = str, *last_space = str - 1;
int lines = 0;
int i;
struct term_state local_state;
if (line_width > max_width || *ptr == '\n')
{
- const grub_wchar_t *ptr2;
+ const grub_uint32_t *ptr2;
int wasn = (*ptr == '\n');
if (wasn)
lines++;
if (!dry_run && !skip_lines && max_lines)
{
- const grub_wchar_t *ptr2;
+ const grub_uint32_t *ptr2;
for (ptr2 = line_start; ptr2 < last_position; ptr2++)
{
}
static int
-print_ucs4_real (const grub_wchar_t * str,
- const grub_wchar_t * last_position,
+print_ucs4_real (const grub_uint32_t * str,
+ const grub_uint32_t * last_position,
int margin_left, int margin_right,
struct grub_term_output *term, int backlog,
int dry_run, int fixed_tab, unsigned skip_lines,
}
void
-grub_print_ucs4 (const grub_wchar_t * str,
- const grub_wchar_t * last_position,
+grub_print_ucs4 (const grub_uint32_t * str,
+ const grub_uint32_t * last_position,
int margin_left, int margin_right,
struct grub_term_output *term)
{
}
int
-grub_ucs4_count_lines (const grub_wchar_t * str,
- const grub_wchar_t * last_position,
+grub_ucs4_count_lines (const grub_uint32_t * str,
+ const grub_uint32_t * last_position,
int margin_left, int margin_right,
struct grub_term_output *term)
{
void
grub_xnputs (const char *str, grub_size_t msg_len)
{
- grub_wchar_t *unicode_str = NULL, *unicode_last_position;
+ grub_uint32_t *unicode_str = NULL, *unicode_last_position;
int backlog = 0;
grub_term_output_t term;
#define ALIGN_UP_OVERHEAD(addr, align) ((-(addr)) & ((typeof (addr)) (align) - 1))
#define ALIGN_DOWN(addr, align) \
((addr) & ~((typeof (addr)) align - 1))
-#ifndef GRUB_POSIX
#define ARRAY_SIZE(array) (sizeof (array) / sizeof (array[0]))
-#endif
#define COMPILE_TIME_ASSERT(cond) switch (0) { case 1: case !(cond): ; }
#define grub_dprintf(condition, fmt, args...) grub_real_dprintf(GRUB_FILE, __LINE__, condition, fmt, ## args)