O2S C Library 1.8.2
Provide high-level data-structures and other fundamental tools for C projects
Loading...
Searching...
No Matches
getters.c File Reference

Expose the state of a deque. More...

#include "private.h"
#include "o2s/deque.h"

Go to the source code of this file.

Functions

size_t deque_count (const deque_t *self)
 The number of elements currently held in the queue.
size_t deque_capacity (const deque_t *self)
 The maximum number of elements that can be stored.
void * deque_first (const deque_t *self)
 The current first element in the queue.
void * deque_last (const deque_t *self)
 The current last element in the queue.
bool deque_is_empty (const deque_t *self)
 True if no elements are currently stored.
bool deque_is_full (const deque_t *self)
 True if the queue reached its maximum capacity.
void * deque_get (const deque_t *self, size_t index)
 The element of the element at an arbitrary index.

Detailed Description

Expose the state of a deque.

Author
Hugo FOLCHER
Antoine GAGNIERE

Definition in file getters.c.

Function Documentation

◆ deque_first()

void * deque_first ( const deque_t * self)

The current first element in the queue.

Returns
NULL if the queue is empty

Definition at line 37 of file getters.c.

◆ deque_get()

void * deque_get ( const deque_t * self,
size_t index )

The element of the element at an arbitrary index.

Returns
NULL if the index is not a valid one

Definition at line 72 of file getters.c.

◆ deque_last()

void * deque_last ( const deque_t * self)

The current last element in the queue.

Returns
NULL if the queue is empty

Definition at line 48 of file getters.c.