Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 4201 → Rev 4296

/branches/dd/uspace/srv/fb/serial_console.c
53,10 → 53,12
#define MAX_CONTROL 20
 
static void serial_sgr(const unsigned int mode);
void serial_putchar(wchar_t ch);
 
static int scr_width;
static int scr_height;
static bool color = true; /** True if producing color output. */
static bool utf8 = false; /** True if producing UTF8 output. */
static putc_function_t putc_function;
 
/* Allow only 1 connection */
102,6 → 104,30
putc_function(*(str++));
}
 
void serial_putchar(wchar_t ch)
{
uint8_t buf[STR_BOUNDS(1)];
size_t offs;
size_t i;
 
if (utf8 != true) {
if (ch >= 0 && ch < 128)
(*putc_function)((uint8_t) ch);
else
(*putc_function)('?');
return;
}
 
offs = 0;
if (chr_encode(ch, buf, &offs, STR_BOUNDS(1)) == EOK) {
for (i = 0; i < offs; i++)
(*putc_function)(buf[i]);
} else {
(*putc_function)('?');
}
 
}
 
void serial_goto(const unsigned int row, const unsigned int col)
{
if ((row > scr_height) || (col > scr_width))
256,7 → 282,7
a1 = &field->attrs;
if (!attrs_same(*a0, *a1))
serial_set_attrs(a1);
(*putc_function)(field->character);
serial_putchar(field->character);
a0 = a1;
}
}
276,7 → 302,7
keyfield_t *interbuf = NULL;
size_t intersize = 0;
 
char c;
wchar_t c;
int col, row, w, h;
int fgcolor;
int bgcolor;
343,7 → 369,7
serial_goto(row, col);
lastcol = col + 1;
lastrow = row;
(*putc_function)(c);
serial_putchar(c);
retval = 0;
break;
case FB_CURSOR_GOTO: