C Tool Box 0.1.0
Loading...
Searching...
No Matches
ctb_Queue.h File Reference
#include "ctb_DList.h"
#include <stdbool.h>

Go to the source code of this file.

Data Structures

struct  ctb_Queue
 Queue data structure. More...
 

Typedefs

typedef struct ctb_Queue ctb_Queue_t
 Queue type.
 

Functions

ctb_Queue_tctb_Queue_init (ctb_Queue_t *const self)
 Initializes a queue.
 
bool ctb_Queue_isEmpty (ctb_Queue_t *const self)
 Checks if the queue is empty.
 
void ctb_Queue_enqueue (ctb_Queue_t *const self, ctb_DNode_t *const node)
 Adds a node at the end of the queue.
 
ctb_DNode_tctb_Queue_dequeue (ctb_Queue_t *const self)
 Removes and returns the first node from the queue.
 
void ctb_Queue_clear (ctb_Queue_t *const self)
 Clears the queue.
 

Function Documentation

◆ ctb_Queue_clear()

void ctb_Queue_clear ( ctb_Queue_t *const self)

Clears the queue.

Parameters
selfPointer to a queue

◆ ctb_Queue_dequeue()

ctb_DNode_t * ctb_Queue_dequeue ( ctb_Queue_t *const self)

Removes and returns the first node from the queue.

Parameters
selfPointer to a queue
Returns
Pointer to the first node in the queue

◆ ctb_Queue_enqueue()

void ctb_Queue_enqueue ( ctb_Queue_t *const self,
ctb_DNode_t *const node )

Adds a node at the end of the queue.

Parameters
selfPointer to a queue
nodePointer to the node to add

◆ ctb_Queue_init()

ctb_Queue_t * ctb_Queue_init ( ctb_Queue_t *const self)

Initializes a queue.

Parameters
selfPointer to a queue
Returns
Pointer to the initialized queue

◆ ctb_Queue_isEmpty()

bool ctb_Queue_isEmpty ( ctb_Queue_t *const self)

Checks if the queue is empty.

Parameters
selfPointer to a queue
Returns
True if the queue is empty, false otherwise