WISP ERT (Client)
1.0.0
The WISP Extended Runtime (WISP side)
|
#include "defs.h"
Go to the source code of this file.
Data Structures | |
struct | wio_queue_t |
WIO circular queue type. More... | |
Macros | |
#define | WIO_QUEUE_AT(queue, type, index) ((type*)(queue->data+index*queue->item_size)) |
WIO queue member helper marco. More... | |
#define | WIO_QUEUE_BEGIN(queue, type) WIO_QUEUE_AT(queue, type, ((queue->begin==0)?(queue->capacity-1):(queue->begin-1))) |
WIO queue begin helper marco. More... | |
#define | WIO_QUEUE_END(queue, type) WIO_QUEUE_AT(queue, type, queue->end) |
WIO queue end helper marco. More... | |
Functions | |
wio_status_t | wio_queue_init (wio_queue_t *self, uint16_t item_size, uint16_t capacity) |
Initialize a WIO queue. More... | |
wio_status_t | wio_queue_fini (wio_queue_t *self) |
Finalize a WIO queue. More... | |
wio_status_t | wio_queue_push (wio_queue_t *self, const void *item) |
Push an item into the queue. More... | |
wio_status_t | wio_queue_pop (wio_queue_t *self, void *_item) |
Pop an item from the queue. More... | |
#define WIO_QUEUE_AT | ( | queue, | |
type, | |||
index | |||
) | ((type*)(queue->data+index*queue->item_size)) |
WIO queue member helper marco.
#define WIO_QUEUE_BEGIN | ( | queue, | |
type | |||
) | WIO_QUEUE_AT(queue, type, ((queue->begin==0)?(queue->capacity-1):(queue->begin-1))) |
WIO queue begin helper marco.
#define WIO_QUEUE_END | ( | queue, | |
type | |||
) | WIO_QUEUE_AT(queue, type, queue->end) |
WIO queue end helper marco.
wio_status_t wio_queue_fini | ( | wio_queue_t * | self | ) |
Finalize a WIO queue.
self | WIO queue instance. |
wio_status_t wio_queue_init | ( | wio_queue_t * | self, |
uint16_t | item_size, | ||
uint16_t | capacity | ||
) |
Initialize a WIO queue.
self | WIO queue instance. |
item_size | Queue item size. |
capacity | Queue capacity. |
wio_status_t wio_queue_pop | ( | wio_queue_t * | self, |
void * | _item | ||
) |
Pop an item from the queue.
self | WIO queue instance. |
_item | Item to be popped from the queue. |
wio_status_t wio_queue_push | ( | wio_queue_t * | self, |
const void * | item | ||
) |
Push an item into the queue.
self | WIO queue instance. |
item | Item to be pushed into the queue. |