41 lines
744 B
C
41 lines
744 B
C
#ifndef QUEUE_H
|
|
#define QUEUE_H
|
|
|
|
#include "utils.h"
|
|
#include "node.h"
|
|
|
|
/**
|
|
* @brief Initializes the queue with a maximum number of elements
|
|
* @param max_elements The maximum number of elements the queue can hold
|
|
*/
|
|
void q_init(int max_elements);
|
|
|
|
/**
|
|
* @brief Pushes a node into the queue
|
|
* @param n The node to push into the queue
|
|
*/
|
|
void q_push(Node* n);
|
|
|
|
/**
|
|
* @brief Returns the node from the front of the queue
|
|
* @return The node from the front of the queue
|
|
*/
|
|
Node* q_pop();
|
|
|
|
/**
|
|
* @brief Returns the current size of the queue
|
|
* @return The current size of the queue
|
|
*/
|
|
int q_size();
|
|
|
|
/**
|
|
* @brief Clears the queue without freeing memory
|
|
*/
|
|
void q_clear();
|
|
|
|
/**
|
|
* @brief Reset the queue memory
|
|
*/
|
|
void q_destroy();
|
|
|
|
#endif |