mirror of
https://github.com/halleysfifthinc/AVCLAN-Mockingboard.git
synced 2026-08-07 01:13:18 +00:00
20 lines
618 B
C
20 lines
618 B
C
#pragma once
|
|
|
|
#include <stdint.h>
|
|
|
|
typedef struct Queue_struct {
|
|
uint8_t write;
|
|
uint8_t read;
|
|
uint8_t size; // MUST be a power of 2 (qMask depends on it)
|
|
void **buf; // size entries, owned by caller
|
|
} Queue_t;
|
|
|
|
void constructQueue(Queue_t *q, void **slots, void *items, uint8_t itemSize,
|
|
uint8_t len, uint8_t constructFull);
|
|
void constructEmptyQueue(Queue_t *q, void **slots, uint8_t len);
|
|
uint8_t isEmpty(const Queue_t *q);
|
|
static inline void incrementRead(Queue_t *q) { q->read++; }
|
|
uint8_t pushQueue(Queue_t *q, void *x);
|
|
void *peekQueue(const Queue_t *q);
|
|
void *popQueue(Queue_t *q);
|