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

Add elements to deques. More...

#include "private.h"
#include "o2s/deque.h"
#include "o2s/preprocessing.h"
#include <iso646.h>
#include <string.h>

Go to the source code of this file.

Functions

bool deque_push_front (deque_t *self, const void *element)
 Inserts an element to the front of the queue.
bool deque_push_front_n (deque_t *self, const void *elements, size_t count)
 Inserts count elements to the front of the queue.
bool deque_push_back (deque_t *self, const void *element)
 Inserts an element to the back of the queue.
bool deque_push_back_n (deque_t *self, const void *elements, size_t count)
 Inserts count elements to the back of the queue.

Detailed Description

Add elements to deques.

Author
Hugo FOLCHER
Antoine GAGNIERE

Definition in file push.c.

Function Documentation

◆ deque_push_back()

bool deque_push_back ( deque_t * self,
const void * element )

Inserts an element to the back of the queue.

Returns
false if the queue is already full

Definition at line 59 of file push.c.

◆ deque_push_back_n()

bool deque_push_back_n ( deque_t * self,
const void * elements,
size_t count )

Inserts count elements to the back of the queue.

Returns
false if there isn't enough capacity to fit count more elements

Definition at line 68 of file push.c.

◆ deque_push_front()

bool deque_push_front ( deque_t * self,
const void * element )

Inserts an element to the front of the queue.

Returns
false if the queue is already full

Definition at line 29 of file push.c.

◆ deque_push_front_n()

bool deque_push_front_n ( deque_t * self,
const void * elements,
size_t count )

Inserts count elements to the front of the queue.

Returns
false if there isn't enough capacity to fit count more elements

Definition at line 43 of file push.c.