Changes in uspace/srv/hid/console/console.c [38d150e:1d6dd2a] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hid/console/console.c
r38d150e r1d6dd2a 51 51 #include <fibril_synch.h> 52 52 #include <stdlib.h> 53 #include <str.h> 53 54 #include "console.h" 54 55 … … 101 102 static console_t *active_console = &consoles[0]; 102 103 103 static int input_ev_active(input_t *);104 static int input_ev_deactive(input_t *);105 static int input_ev_key(input_t *, kbd_event_type_t, keycode_t, keymod_t, wchar_t);106 static int input_ev_move(input_t *, int, int);107 static int input_ev_abs_move(input_t *, unsigned, unsigned, unsigned, unsigned);108 static int input_ev_button(input_t *, int, int);104 static errno_t input_ev_active(input_t *); 105 static errno_t input_ev_deactive(input_t *); 106 static errno_t input_ev_key(input_t *, kbd_event_type_t, keycode_t, keymod_t, wchar_t); 107 static errno_t input_ev_move(input_t *, int, int); 108 static errno_t input_ev_abs_move(input_t *, unsigned, unsigned, unsigned, unsigned); 109 static errno_t input_ev_button(input_t *, int, int); 109 110 110 111 static input_ev_ops_t input_ev_ops = { … … 117 118 }; 118 119 119 static int cons_open(con_srvs_t *, con_srv_t *);120 static int cons_close(con_srv_t *);121 static int cons_read(con_srv_t *, void *, size_t);122 static int cons_write(con_srv_t *, void *, size_t);120 static errno_t cons_open(con_srvs_t *, con_srv_t *); 121 static errno_t cons_close(con_srv_t *); 122 static errno_t cons_read(con_srv_t *, void *, size_t, size_t *); 123 static errno_t cons_write(con_srv_t *, void *, size_t, size_t *); 123 124 static void cons_sync(con_srv_t *); 124 125 static void cons_clear(con_srv_t *); 125 126 static void cons_set_pos(con_srv_t *, sysarg_t col, sysarg_t row); 126 static int cons_get_pos(con_srv_t *, sysarg_t *, sysarg_t *);127 static int cons_get_size(con_srv_t *, sysarg_t *, sysarg_t *);128 static int cons_get_color_cap(con_srv_t *, console_caps_t *);127 static errno_t cons_get_pos(con_srv_t *, sysarg_t *, sysarg_t *); 128 static errno_t cons_get_size(con_srv_t *, sysarg_t *, sysarg_t *); 129 static errno_t cons_get_color_cap(con_srv_t *, console_caps_t *); 129 130 static void cons_set_style(con_srv_t *, console_style_t); 130 131 static void cons_set_color(con_srv_t *, console_color_t, console_color_t, … … 132 133 static void cons_set_rgb_color(con_srv_t *, pixel_t, pixel_t); 133 134 static void cons_set_cursor_visibility(con_srv_t *, bool); 134 static int cons_get_event(con_srv_t *, cons_event_t *);135 static errno_t cons_get_event(con_srv_t *, cons_event_t *); 135 136 136 137 static con_ops_t con_ops = { … … 230 231 } 231 232 232 static int input_ev_active(input_t *input)233 static errno_t input_ev_active(input_t *input) 233 234 { 234 235 active = true; … … 239 240 } 240 241 241 static int input_ev_deactive(input_t *input)242 static errno_t input_ev_deactive(input_t *input) 242 243 { 243 244 active = false; … … 247 248 } 248 249 249 static int input_ev_key(input_t *input, kbd_event_type_t type, keycode_t key,250 static errno_t input_ev_key(input_t *input, kbd_event_type_t type, keycode_t key, 250 251 keymod_t mods, wchar_t c) 251 252 { … … 274 275 } 275 276 276 static int input_ev_move(input_t *input, int dx, int dy)277 { 278 return EOK; 279 } 280 281 static int input_ev_abs_move(input_t *input, unsigned x , unsigned y,277 static errno_t input_ev_move(input_t *input, int dx, int dy) 278 { 279 return EOK; 280 } 281 282 static errno_t input_ev_abs_move(input_t *input, unsigned x , unsigned y, 282 283 unsigned max_x, unsigned max_y) 283 284 { … … 285 286 } 286 287 287 static int input_ev_button(input_t *input, int bnum, int bpress)288 static errno_t input_ev_button(input_t *input, int bnum, int bpress) 288 289 { 289 290 return EOK; … … 328 329 } 329 330 330 static int cons_open(con_srvs_t *srvs, con_srv_t *srv)331 { 332 return EOK; 333 } 334 335 static int cons_close(con_srv_t *srv)336 { 337 return EOK; 338 } 339 340 static int cons_read(con_srv_t *srv, void *buf, size_t size)331 static errno_t cons_open(con_srvs_t *srvs, con_srv_t *srv) 332 { 333 return EOK; 334 } 335 336 static errno_t cons_close(con_srv_t *srv) 337 { 338 return EOK; 339 } 340 341 static errno_t cons_read(con_srv_t *srv, void *buf, size_t size, size_t *nread) 341 342 { 342 343 uint8_t *bbuf = buf; … … 378 379 } 379 380 380 return size; 381 } 382 383 static int cons_write(con_srv_t *srv, void *data, size_t size) 381 *nread = size; 382 return EOK; 383 } 384 385 static errno_t cons_write(con_srv_t *srv, void *data, size_t size, size_t *nwritten) 384 386 { 385 387 console_t *cons = srv_to_console(srv); … … 389 391 cons_write_char(cons, str_decode(data, &off, size)); 390 392 391 return size; 393 *nwritten = size; 394 return EOK; 392 395 } 393 396 … … 421 424 } 422 425 423 static int cons_get_pos(con_srv_t *srv, sysarg_t *col, sysarg_t *row)426 static errno_t cons_get_pos(con_srv_t *srv, sysarg_t *col, sysarg_t *row) 424 427 { 425 428 console_t *cons = srv_to_console(srv); … … 432 435 } 433 436 434 static int cons_get_size(con_srv_t *srv, sysarg_t *cols, sysarg_t *rows)437 static errno_t cons_get_size(con_srv_t *srv, sysarg_t *cols, sysarg_t *rows) 435 438 { 436 439 console_t *cons = srv_to_console(srv); … … 444 447 } 445 448 446 static int cons_get_color_cap(con_srv_t *srv, console_caps_t *ccaps)449 static errno_t cons_get_color_cap(con_srv_t *srv, console_caps_t *ccaps) 447 450 { 448 451 console_t *cons = srv_to_console(srv); … … 491 494 } 492 495 493 static int cons_get_event(con_srv_t *srv, cons_event_t *event)496 static errno_t cons_get_event(con_srv_t *srv, cons_event_t *event) 494 497 { 495 498 console_t *cons = srv_to_console(srv); … … 526 529 } 527 530 528 static int input_connect(const char *svc)531 static errno_t input_connect(const char *svc) 529 532 { 530 533 async_sess_t *sess; 531 534 service_id_t dsid; 532 535 533 int rc = loc_service_get_id(svc, &dsid, 0);536 errno_t rc = loc_service_get_id(svc, &dsid, 0); 534 537 if (rc != EOK) { 535 538 printf("%s: Input service %s not found\n", NAME, svc); … … 560 563 service_id_t dsid; 561 564 562 int rc = loc_service_get_id(svc, &dsid, 0);565 errno_t rc = loc_service_get_id(svc, &dsid, 0); 563 566 if (rc == EOK) { 564 567 sess = loc_service_connect(dsid, INTERFACE_OUTPUT, 0); … … 577 580 { 578 581 /* Connect to input service */ 579 int rc = input_connect(input_svc);582 errno_t rc = input_connect(input_svc); 580 583 if (rc != EOK) 581 584 return false;
Note:
See TracChangeset
for help on using the changeset viewer.