Armadillo  0.1.1
TheexpandableOS
Typedefs | Functions
queue.h File Reference

Queue data structure. More...

#include <common/memory.h>

Go to the source code of this file.

Typedefs

typedef struct Queue queue_t
 
typedef struct Link link_t
 

Functions

queue_tqueue_new ()
 
void enqueue (queue_t *queue, void *data)
 
void enqueue_first (queue_t *queue, void *data)
 
void * dequeue (queue_t *queue)
 
void queue_destroy (queue_t *queue)
 
int list_size (queue_t *queue)
 
void * get_first_element (queue_t *queue)
 

Detailed Description

Queue data structure.

Function Documentation

◆ dequeue()

void* dequeue ( queue_t queue)

Removes the first element of a queue, and returns it.

Parameters
queueA queue.
Returns
The data element at the head of the queue.

◆ enqueue()

void enqueue ( queue_t queue,
void *  data 
)

Pushes data to the end of the queue.

Parameters
queueA queue.
dataThe data to enqueue.

◆ list_size()

int list_size ( queue_t queue)

Gives the length of a queue.

Parameters
queueA queue.
Returns
The length of a queue.

◆ queue_destroy()

void queue_destroy ( queue_t queue)

Deallocates a queue.

Parameters
queueThe queue to deallocate.

◆ queue_new()

queue_t* queue_new ( )

Allocates space for a queue and returns an empty queue Creates a new queue data structure.

Returns
A pointer to a new, empty queue.