Changes in uspace/srv/hid/fb/serial_console.c [228e490:32e7411] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hid/fb/serial_console.c
r228e490 r32e7411 47 47 #include <io/style.h> 48 48 #include <str.h> 49 #include <inttypes.h>50 49 #include <io/screenbuffer.h> 51 50 … … 55 54 #define MAX_CONTROL 20 56 55 57 static sysarg_t scr_width;58 static sysarg_t scr_height;56 static ipcarg_t scr_width; 57 static ipcarg_t scr_height; 59 58 static bool color = true; /**< True if producing color output. */ 60 59 static bool utf8 = false; /**< True if producing UTF8 output. */ 61 60 static putc_function_t putc_function; 62 61 63 static sysarg_t lastcol = 0;64 static sysarg_t lastrow = 0;62 static ipcarg_t lastcol = 0; 63 static ipcarg_t lastrow = 0; 65 64 static attrs_t cur_attr = { 66 65 .t = at_style, … … 130 129 } 131 130 132 void serial_goto(const sysarg_t col, const sysarg_t row)131 void serial_goto(const ipcarg_t col, const ipcarg_t row) 133 132 { 134 133 if ((col > scr_width) || (row > scr_height)) … … 136 135 137 136 char control[MAX_CONTROL]; 138 snprintf(control, MAX_CONTROL, "\033[%" PRIun ";%" PRIun "f", 139 row + 1, col + 1); 137 snprintf(control, MAX_CONTROL, "\033[%u;%uf", row + 1, col + 1); 140 138 serial_puts(control); 141 139 } … … 252 250 253 251 /** Set scrolling region. */ 254 void serial_set_scroll_region( sysarg_t last_row)252 void serial_set_scroll_region(ipcarg_t last_row) 255 253 { 256 254 char control[MAX_CONTROL]; 257 snprintf(control, MAX_CONTROL, "\033[0;% " PRIun "r", last_row);255 snprintf(control, MAX_CONTROL, "\033[0;%ur", last_row); 258 256 serial_puts(control); 259 257 } … … 269 267 } 270 268 271 void serial_console_init(putc_function_t putc_fn, sysarg_t w, sysarg_t h)269 void serial_console_init(putc_function_t putc_fn, ipcarg_t w, ipcarg_t h) 272 270 { 273 271 scr_width = w; … … 286 284 * 287 285 */ 288 static void draw_text_data(keyfield_t *data, sysarg_t x0, sysarg_t y0,289 sysarg_t width, sysarg_t height)286 static void draw_text_data(keyfield_t *data, ipcarg_t x0, ipcarg_t y0, 287 ipcarg_t width, ipcarg_t height) 290 288 { 291 289 attrs_t *a0 = &data[0].attrs; 292 290 serial_set_attrs(a0); 293 291 294 sysarg_t y;292 ipcarg_t y; 295 293 for (y = 0; y < height; y++) { 296 294 serial_goto(x0, y0 + y); 297 295 298 sysarg_t x;296 ipcarg_t x; 299 297 for (x = 0; x < width; x++) { 300 298 attrs_t *attr = &data[y * width + x].attrs; … … 337 335 338 336 wchar_t c; 339 sysarg_t col;340 sysarg_t row;341 sysarg_t w;342 sysarg_t h;337 ipcarg_t col; 338 ipcarg_t row; 339 ipcarg_t w; 340 ipcarg_t h; 343 341 ssize_t rows; 344 342 345 343 int retval; 346 344 347 switch (IPC_GET_ IMETHOD(call)) {345 switch (IPC_GET_METHOD(call)) { 348 346 case IPC_M_PHONE_HUNGUP: 349 347 client_connected = 0; … … 442 440 443 441 if (rows >= 0) { 444 if (( sysarg_t) rows > scr_height) {442 if ((ipcarg_t) rows > scr_height) { 445 443 retval = EINVAL; 446 444 break; 447 445 } 448 446 } else { 449 if (( sysarg_t) (-rows) > scr_height) {447 if ((ipcarg_t) (-rows) > scr_height) { 450 448 retval = EINVAL; 451 449 break;
Note:
See TracChangeset
for help on using the changeset viewer.