Changeset e273e9e in mainline
- Timestamp:
- 2024-10-03T18:48:48Z (4 months ago)
- Branches:
- master
- Children:
- 5132379
- Parents:
- b2c9e42c
- Location:
- uspace
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/terminal/terminal.c
rb2c9e42c re273e9e 403 403 if (pos < size) { 404 404 link_t *link = prodcons_consume(&term->input_pc); 405 cons_event_t *event = list_get_instance(link, cons_event_t, link); 405 terminal_event_t *qevent = list_get_instance(link, 406 terminal_event_t, link); 407 cons_event_t *event = &qevent->ev; 406 408 407 409 /* Accept key presses of printable chars only. */ … … 417 419 } 418 420 419 free( event);421 free(qevent); 420 422 } 421 423 } … … 635 637 terminal_t *term = srv_to_terminal(srv); 636 638 link_t *link = prodcons_consume(&term->input_pc); 637 cons_event_t *ev = list_get_instance(link, cons_event_t, link);638 639 *event = *ev;639 terminal_event_t *ev = list_get_instance(link, terminal_event_t, link); 640 641 *event = ev->ev; 640 642 free(ev); 641 643 return EOK; … … 823 825 { 824 826 /* Got key press/release event */ 825 cons_event_t *event =826 ( cons_event_t *) malloc(sizeof(cons_event_t));827 terminal_event_t *event = 828 (terminal_event_t *) malloc(sizeof(terminal_event_t)); 827 829 if (event == NULL) 828 830 return; 829 831 830 *event= *ev;832 event->ev = *ev; 831 833 link_initialize(&event->link); 832 834 -
uspace/app/terminal/terminal.h
rb2c9e42c re273e9e 1 1 /* 2 * Copyright (c) 202 3Jiri Svoboda2 * Copyright (c) 2024 Jiri Svoboda 3 3 * Copyright (c) 2012 Petr Koupy 4 4 * All rights reserved. … … 46 46 #include <gfx/coord.h> 47 47 #include <io/con_srv.h> 48 #include <io/cons_event.h> 48 49 #include <loc.h> 49 50 #include <stdatomic.h> … … 102 103 } terminal_t; 103 104 105 /** Terminal event */ 106 typedef struct { 107 /** Link to list of events */ 108 link_t link; 109 /** Console event */ 110 cons_event_t ev; 111 } terminal_event_t; 112 104 113 extern errno_t terminal_create(const char *, sysarg_t, sysarg_t, 105 114 terminal_flags_t, const char *, terminal_t **); -
uspace/lib/console/include/io/cons_event.h
rb2c9e42c re273e9e 1 1 /* 2 * Copyright (c) 202 3Jiri Svoboda2 * Copyright (c) 2024 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 36 36 #define _LIBCONSOLE_IO_CONS_EVENT_H_ 37 37 38 #include <adt/list.h>39 38 #include <io/kbd_event.h> 40 39 #include <io/pos_event.h> … … 51 50 /** Console event structure. */ 52 51 typedef struct { 53 /** List handle */54 link_t link;55 56 52 /** Event type */ 57 53 cons_event_type_t type; -
uspace/srv/hid/console/console.c
rb2c9e42c re273e9e 334 334 { 335 335 /* Got key press/release event */ 336 cons_ event_t *event =337 (cons_ event_t *) malloc(sizeof(cons_event_t));336 cons_qevent_t *event = 337 (cons_qevent_t *) malloc(sizeof(cons_qevent_t)); 338 338 if (event == NULL) 339 339 return; 340 340 341 *event= *ev;341 event->ev = *ev; 342 342 link_initialize(&event->link); 343 343 … … 556 556 if (pos < size) { 557 557 link_t *link = prodcons_consume(&cons->input_pc); 558 cons_event_t *event = list_get_instance(link, 559 cons_event_t, link); 558 cons_qevent_t *qevent = list_get_instance(link, 559 cons_qevent_t, link); 560 cons_event_t *event = &qevent->ev; 560 561 561 562 /* Accept key presses of printable chars only. */ … … 567 568 } 568 569 569 free( event);570 free(qevent); 570 571 } 571 572 } … … 703 704 console_t *cons = srv_to_console(srv); 704 705 link_t *link = prodcons_consume(&cons->input_pc); 705 cons_ event_t *cevent = list_get_instance(link, cons_event_t, link);706 707 *event = *cevent;708 free( cevent);706 cons_qevent_t *qevent = list_get_instance(link, cons_qevent_t, link); 707 708 *event = qevent->ev; 709 free(qevent); 709 710 return EOK; 710 711 } -
uspace/srv/hid/console/console.h
rb2c9e42c re273e9e 1 1 /* 2 * Copyright (c) 2024 Jiri Svoboda 2 3 * Copyright (c) 2006 Josef Cejka 3 4 * All rights reserved. … … 36 37 #define CONSOLE_CONSOLE_H__ 37 38 39 #include <adt/prodcons.h> 40 #include <io/cons_event.h> 41 38 42 #define CONSOLE_COUNT 11 43 44 /** Console event queue entry */ 45 typedef struct { 46 /** Link to list of events */ 47 link_t link; 48 /** Console event */ 49 cons_event_t ev; 50 } cons_qevent_t; 39 51 40 52 #endif -
uspace/srv/hid/output/output.h
rb2c9e42c re273e9e 1 1 /* 2 * Copyright (c) 2024 Jiri Svoboda 2 3 * Copyright (c) 2011 Martin Decky 3 4 * All rights reserved. … … 34 35 #define OUTPUT_OUTPUT_H_ 35 36 37 #include <adt/list.h> 36 38 #include <stdbool.h> 37 39 #include <loc.h>
Note:
See TracChangeset
for help on using the changeset viewer.