From 11490a493511c4f760af74c12cb7da15b2b404a2 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Wed, 16 Sep 2020 21:38:19 +0200 Subject: Added *very* basic keymap parsing --- libc/inc/sys.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'libc') diff --git a/libc/inc/sys.h b/libc/inc/sys.h index 839d6be..86f530b 100644 --- a/libc/inc/sys.h +++ b/libc/inc/sys.h @@ -20,13 +20,15 @@ enum sys { SYS_REGISTER, // Register for event SYS_UNREGISTER, // Unregister event SYS_SEND, // Send message to process - SYS_RECEIVE // Receive message (non-blocking/sync) + SYS_RECEIVE, // Receive message (non-blocking/sync) + SYS_GETPID // Get the process ID }; -enum message_type { MSG_NEW_WINDOW, MSG_REDRAW, EVENT_KEYBOARD, EVENT_MOUSE }; + +enum event_type { EVENT_KEYBOARD, EVENT_MOUSE, EVENT_MAX }; struct message { int src; - enum message_type type; + int type; void *data; }; @@ -78,6 +80,7 @@ int sysv(enum sys num, ...); #define msg_send(pid, type, msg) sys3(SYS_SEND, (int)(pid), (int)(type), (int)(msg)) #define msg_receive() (struct message *)sys0(SYS_RECEIVE) +#define getpid() (int)sys0(SYS_GETPID) static inline struct message *msg_receive_loop() { struct message *msg; -- cgit v1.2.3