ud3tn/components/platform/posix/hal_queue.c
Maximilian Nitsch 611b67fb0e refactor: cleanup includes
Removes unused includes detected by the clangd LSP.

Signed-off-by: Maximilian Nitsch <maximilian.nitsch@d3tn.com>
2026-05-20 16:16:35 +02:00

63 lines
1.3 KiB
C

// SPDX-License-Identifier: BSD-3-Clause OR Apache-2.0
/*
* hal_queue.c
*
* Description: contains the POSIX implementation of the hardware
* abstraction layer interface for thread-related functionality
*
*/
#include "platform/hal_queue.h"
#include "platform/hal_types.h"
#include "platform/posix/simple_queue.h"
#include "ud3tn/result.h"
#include <stdint.h>
QueueIdentifier_t hal_queue_create(int queue_length, int item_size)
{
return queueCreate(queue_length, item_size);
}
void hal_queue_push_to_back(QueueIdentifier_t queue, const void *item)
{
queuePush(queue, item, -1, false);
}
enum ud3tn_result hal_queue_receive(QueueIdentifier_t queue, void *targetBuffer,
int64_t timeout)
{
return queuePop(queue, targetBuffer, timeout) == 0
? UD3TN_OK : UD3TN_FAIL;
}
void hal_queue_reset(QueueIdentifier_t queue)
{
queueReset(queue);
}
enum ud3tn_result hal_queue_try_push_to_back(QueueIdentifier_t queue,
const void *item, int64_t timeout)
{
return queuePush(queue, item, timeout, false) == 0
? UD3TN_OK : UD3TN_FAIL;
}
void hal_queue_delete(QueueIdentifier_t queue)
{
queueDelete(queue);
}
enum ud3tn_result hal_queue_override_to_back(QueueIdentifier_t queue,
const void *item)
{
return queuePush(queue, item, -1, true) == 0 ? UD3TN_OK : UD3TN_FAIL;
}