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