Files
vystem-b/shelter/lib/include/std/queue.h
2026-05-27 19:34:54 +02:00

20 lines
631 B
C

// SPDX-License-Identifier: MPL-2.0
#ifndef SH_LIB_QUEUE_H
#define SH_LIB_QUEUE_H
#include "std/type.h"
#include "std/status.h"
#include "devs/input/event.h"
// Keyboard events queue structure
typedef struct {
sh_kbd_EVENT *buffer;
sh_uint32 capacity;
sh_uint32 write_index;
} sh_queue_KBD_EVENT;
// Initialize an event queue
SH_STATUS sh_queue_event_init(sh_queue_KBD_EVENT *q,sh_uint32 capacity);
// Push a keyboard event to the provided queue
SH_STATUS sh_queue_event_push(sh_queue_KBD_EVENT *q,sh_kbd_EVENT ev);
// Destroy the provided keyboard event queue
SH_STATUS sh_queue_event_destroy(sh_queue_KBD_EVENT *q);
#endif