58QSC_CPLUSPLUS_ENABLED_START
108#define QSC_QUEUE_ALIGNMENT 64ULL
114#define QSC_QUEUE_MAX_DEPTH 64UL
202#if defined(QSC_DEBUG_MODE)
211QSC_CPLUSPLUS_ENABLED_END
Asynchronous Thread and Mutex Management Functions.
Contains common definitions for the Quantum Secure Cryptographic (QSC) library.
#define QSC_EXPORT_API
API export macro for Microsoft compilers when importing from a DLL.
Definition qsccommon.h:645
#define QSC_QUEUE_MAX_DEPTH
The maximum queue depth.
Definition queue.h:114
QSC_EXPORT_API void qsc_queue_push(qsc_queue_state *ctx, const uint8_t *input, size_t inplen, uint64_t tag)
Add an item to the queue.
Definition queue.c:241
QSC_EXPORT_API size_t qsc_queue_items(const qsc_queue_state *ctx)
Get the number of items in the queue.
Definition queue.c:137
QSC_EXPORT_API uint64_t qsc_queue_pop(qsc_queue_state *ctx, uint8_t *output, size_t otplen)
Returns the first member of the queue, and erases that item from the queue.
Definition queue.c:191
QSC_EXPORT_API void qsc_queue_initialize(qsc_queue_state *ctx, size_t depth, size_t width)
Initialize the queue state.
Definition queue.c:73
QSC_EXPORT_API void qsc_queue_dispose(qsc_queue_state *ctx)
Destroy the queue state.
Definition queue.c:7
QSC_EXPORT_API bool qsc_queue_empty(const qsc_queue_state *ctx)
Get the empty status from the queue.
Definition queue.c:173
QSC_EXPORT_API bool qsc_queue_full(const qsc_queue_state *ctx)
Get the full status from the queue.
Definition queue.c:155
QSC_EXPORT_API void qsc_queue_flush(qsc_queue_state *ctx, uint8_t *output)
Flush the content of the queue to an array.
Definition queue.c:44
Contains the queue context state.
Definition queue.h:120
size_t width
Definition queue.h:126
uint64_t tags[QSC_QUEUE_MAX_DEPTH]
Definition queue.h:122
size_t count
Definition queue.h:123
size_t position
Definition queue.h:125
size_t depth
Definition queue.h:124
qsc_mutex opmtx
Definition queue.h:127
uint8_t ** queue
Definition queue.h:121