Changeset b27eb71 in mainline for uspace/srv/fb/serial_console.c
- Timestamp:
- 2009-04-05T09:17:02Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 9db4079
- Parents:
- f2b8cdc
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fb/serial_console.c
rf2b8cdc rb27eb71 54 54 55 55 static void serial_sgr(const unsigned int mode); 56 void serial_putchar(wchar_t ch); 56 57 57 58 static int scr_width; 58 59 static int scr_height; 59 60 static bool color = true; /** True if producing color output. */ 61 static bool utf8 = false; /** True if producing UTF8 output. */ 60 62 static putc_function_t putc_function; 61 63 … … 105 107 void serial_putchar(wchar_t ch) 106 108 { 107 (*putc_function)(ch); 109 uint8_t buf[STR_BOUNDS(1)]; 110 size_t offs; 111 size_t i; 112 113 if (utf8 != true) { 114 if (ch >= 0 && ch < 128) 115 (*putc_function)((uint8_t) ch); 116 else 117 (*putc_function)('?'); 118 return; 119 } 120 121 offs = 0; 122 if (chr_encode(ch, buf, &offs, STR_BOUNDS(1)) == EOK) { 123 for (i = 0; i < offs; i++) 124 (*putc_function)(buf[i]); 125 } else { 126 (*putc_function)('?'); 127 } 128 108 129 } 109 130
Note:
See TracChangeset
for help on using the changeset viewer.