libmya 0.1.0
Library to parse Mya language.
Loading...
Searching...
No Matches
queue.h
Go to the documentation of this file.
1#pragma once
2
3#include "types/err.h"
4#include "types/queue.h"
5
12void
13cqueue_init(cqueue_t* queue, unsigned int max_length);
14
25cqueue_add(cqueue_t* queue, int item);
26
37cqueue_get(cqueue_t* queue, int* item);
38
51cqueue_lookup(const cqueue_t* queue, int* item, unsigned int seek);
52
61int
62cqueue_isempty(const cqueue_t* queue);
63
72int
73cqueue_isfull(const cqueue_t* queue);
74
80void
enum error_code error_code_t
Enumeration of error codes.
int cqueue_isfull(const cqueue_t *queue)
Check if the given circular queue is full.
Definition cqueue.c:74
void cqueue_close(cqueue_t *queue)
Close the given circular queue.
Definition cqueue.c:80
error_code_t cqueue_add(cqueue_t *queue, int item)
Add a value to the circular queue.
Definition cqueue.c:20
error_code_t cqueue_get(cqueue_t *queue, int *item)
Get the current value from the circular queue, removing it from the queue.
Definition cqueue.c:35
error_code_t cqueue_lookup(const cqueue_t *queue, int *item, unsigned int seek)
Get a value from the circular queue, without removing it from the queue.
Definition cqueue.c:50
void cqueue_init(cqueue_t *queue, unsigned int max_length)
Initializes a circular queue.
Definition cqueue.c:10
int cqueue_isempty(const cqueue_t *queue)
Check if the given circular queue is empty.
Definition cqueue.c:68
struct cqueue cqueue_t
Circular queue of integers.