From eed77bd2970a00d1394ed027ceca5b646e4671ce Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Wed, 17 Jun 2020 18:31:46 +0200 Subject: Started rewrite --- src/kernel/events/event.c | 31 ------------------------------- 1 file changed, 31 deletions(-) delete mode 100644 src/kernel/events/event.c (limited to 'src/kernel/events/event.c') diff --git a/src/kernel/events/event.c b/src/kernel/events/event.c deleted file mode 100644 index a50e0c7..0000000 --- a/src/kernel/events/event.c +++ /dev/null @@ -1,31 +0,0 @@ -#include -#include -#include -#include - -typedef u32 (*event_func)(u8 *); - -u32 (*event_table[])() = { [MAP_KEYBOARD] = NULL, [MAP_MOUSE] = NULL }; - -u32 event_map(u32 id, u8 *function) -{ - if (id >= sizeof(event_map) / sizeof(*event_map)) - return -1; - - event_table[id] = (u32)function; - return 0; -} - -u32 event_trigger(u32 id, u8 *data) -{ - assert(id < sizeof(event_map) / sizeof(*event_map)); - - event_func location = (event_func)event_table[id]; - if (!location) { - warn("Event %d not mapped!", id); - return -1; - } - - location(data); - return 0; -} \ No newline at end of file -- cgit v1.2.3