Moved code and assets for the game to a seperate folder. Moved jansson and raylib to third_party.
This commit is contained in:
27
src/game/shared/squeue.h
Normal file
27
src/game/shared/squeue.h
Normal file
@@ -0,0 +1,27 @@
|
||||
#ifndef SQUEUE_H
|
||||
#define SQUEUE_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdbool.h>
|
||||
#include <string.h>
|
||||
|
||||
// FIFO.
|
||||
|
||||
typedef struct {
|
||||
void *buffer;
|
||||
uint16_t head;
|
||||
uint16_t tail;
|
||||
uint16_t count;
|
||||
uint16_t capacity;
|
||||
size_t element_size;
|
||||
} SQueue;
|
||||
|
||||
bool squeue_init(SQueue *q, uint16_t capacity, size_t element_size);
|
||||
void squeue_free(SQueue *q);
|
||||
|
||||
bool squeue_push(SQueue *q, const void *elem);
|
||||
bool squeue_pop(SQueue *q, void *out);
|
||||
bool squeue_peek(const SQueue *q, void *out);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user