Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/hid/console/console.c

    r1d6dd2a r38d150e  
    5151#include <fibril_synch.h>
    5252#include <stdlib.h>
    53 #include <str.h>
    5453#include "console.h"
    5554
     
    102101static console_t *active_console = &consoles[0];
    103102
    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);
     103static int input_ev_active(input_t *);
     104static int input_ev_deactive(input_t *);
     105static int input_ev_key(input_t *, kbd_event_type_t, keycode_t, keymod_t, wchar_t);
     106static int input_ev_move(input_t *, int, int);
     107static int input_ev_abs_move(input_t *, unsigned, unsigned, unsigned, unsigned);
     108static int input_ev_button(input_t *, int, int);
    110109
    111110static input_ev_ops_t input_ev_ops = {
     
    118117};
    119118
    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 *);
     119static int cons_open(con_srvs_t *, con_srv_t *);
     120static int cons_close(con_srv_t *);
     121static int cons_read(con_srv_t *, void *, size_t);
     122static int cons_write(con_srv_t *, void *, size_t);
    124123static void cons_sync(con_srv_t *);
    125124static void cons_clear(con_srv_t *);
    126125static 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 *);
     126static int cons_get_pos(con_srv_t *, sysarg_t *, sysarg_t *);
     127static int cons_get_size(con_srv_t *, sysarg_t *, sysarg_t *);
     128static int cons_get_color_cap(con_srv_t *, console_caps_t *);
    130129static void cons_set_style(con_srv_t *, console_style_t);
    131130static void cons_set_color(con_srv_t *, console_color_t, console_color_t,
     
    133132static void cons_set_rgb_color(con_srv_t *, pixel_t, pixel_t);
    134133static void cons_set_cursor_visibility(con_srv_t *, bool);
    135 static errno_t cons_get_event(con_srv_t *, cons_event_t *);
     134static int cons_get_event(con_srv_t *, cons_event_t *);
    136135
    137136static con_ops_t con_ops = {
     
    231230}
    232231
    233 static errno_t input_ev_active(input_t *input)
     232static int input_ev_active(input_t *input)
    234233{
    235234        active = true;
     
    240239}
    241240
    242 static errno_t input_ev_deactive(input_t *input)
     241static int input_ev_deactive(input_t *input)
    243242{
    244243        active = false;
     
    248247}
    249248
    250 static errno_t input_ev_key(input_t *input, kbd_event_type_t type, keycode_t key,
     249static int input_ev_key(input_t *input, kbd_event_type_t type, keycode_t key,
    251250    keymod_t mods, wchar_t c)
    252251{
     
    275274}
    276275
    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,
     276static int input_ev_move(input_t *input, int dx, int dy)
     277{
     278        return EOK;
     279}
     280
     281static int input_ev_abs_move(input_t *input, unsigned x , unsigned y,
    283282    unsigned max_x, unsigned max_y)
    284283{
     
    286285}
    287286
    288 static errno_t input_ev_button(input_t *input, int bnum, int bpress)
     287static int input_ev_button(input_t *input, int bnum, int bpress)
    289288{
    290289        return EOK;
     
    329328}
    330329
    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)
     330static int cons_open(con_srvs_t *srvs, con_srv_t *srv)
     331{
     332        return EOK;
     333}
     334
     335static int cons_close(con_srv_t *srv)
     336{
     337        return EOK;
     338}
     339
     340static int cons_read(con_srv_t *srv, void *buf, size_t size)
    342341{
    343342        uint8_t *bbuf = buf;
     
    379378        }
    380379       
    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
     383static int cons_write(con_srv_t *srv, void *data, size_t size)
    386384{
    387385        console_t *cons = srv_to_console(srv);
     
    391389                cons_write_char(cons, str_decode(data, &off, size));
    392390       
    393         *nwritten = size;
    394         return EOK;
     391        return size;
    395392}
    396393
     
    424421}
    425422
    426 static errno_t cons_get_pos(con_srv_t *srv, sysarg_t *col, sysarg_t *row)
     423static int cons_get_pos(con_srv_t *srv, sysarg_t *col, sysarg_t *row)
    427424{
    428425        console_t *cons = srv_to_console(srv);
     
    435432}
    436433
    437 static errno_t cons_get_size(con_srv_t *srv, sysarg_t *cols, sysarg_t *rows)
     434static int cons_get_size(con_srv_t *srv, sysarg_t *cols, sysarg_t *rows)
    438435{
    439436        console_t *cons = srv_to_console(srv);
     
    447444}
    448445
    449 static errno_t cons_get_color_cap(con_srv_t *srv, console_caps_t *ccaps)
     446static int cons_get_color_cap(con_srv_t *srv, console_caps_t *ccaps)
    450447{
    451448        console_t *cons = srv_to_console(srv);
     
    494491}
    495492
    496 static errno_t cons_get_event(con_srv_t *srv, cons_event_t *event)
     493static int cons_get_event(con_srv_t *srv, cons_event_t *event)
    497494{
    498495        console_t *cons = srv_to_console(srv);
     
    529526}
    530527
    531 static errno_t input_connect(const char *svc)
     528static int input_connect(const char *svc)
    532529{
    533530        async_sess_t *sess;
    534531        service_id_t dsid;
    535532       
    536         errno_t rc = loc_service_get_id(svc, &dsid, 0);
     533        int rc = loc_service_get_id(svc, &dsid, 0);
    537534        if (rc != EOK) {
    538535                printf("%s: Input service %s not found\n", NAME, svc);
     
    563560        service_id_t dsid;
    564561       
    565         errno_t rc = loc_service_get_id(svc, &dsid, 0);
     562        int rc = loc_service_get_id(svc, &dsid, 0);
    566563        if (rc == EOK) {
    567564                sess = loc_service_connect(dsid, INTERFACE_OUTPUT, 0);
     
    580577{
    581578        /* Connect to input service */
    582         errno_t rc = input_connect(input_svc);
     579        int rc = input_connect(input_svc);
    583580        if (rc != EOK)
    584581                return false;
Note: See TracChangeset for help on using the changeset viewer.