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

Remove elements from deques. More...

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

Go to the source code of this file.

Functions

bool deque_pop_front (deque_t *self, void *destination)
 Pops the front-most element of the queue, copying it to destination.
bool deque_pop_front_n (deque_t *self, void *destination, size_t count)
 Pops the count first elements of the queue.
bool deque_pop_back (deque_t *self, void *destination)
 Pops the last element in the queue.
bool deque_pop_back_n (deque_t *self, void *destination, size_t count)
 Pops the count last elements in the queue.

Detailed Description

Remove elements from deques.

Author
Hugo FOLCHER
Antoine GAGNIERE

Definition in file pop.c.

Function Documentation

◆ deque_pop_back()

bool deque_pop_back ( deque_t * self,
void * destination )

Pops the last element in the queue.

Returns
false if the queue is empty

Definition at line 76 of file pop.c.

◆ deque_pop_back_n()

bool deque_pop_back_n ( deque_t * self,
void * destination,
size_t count )

Pops the count last elements in the queue.

Returns
false if the queue contains less than count elements

Definition at line 91 of file pop.c.

◆ deque_pop_front()

bool deque_pop_front ( deque_t * self,
void * destination )

Pops the front-most element of the queue, copying it to destination.

If destination is NULL, it will be discarded

Returns
false if the queue is empty

Definition at line 29 of file pop.c.

◆ deque_pop_front_n()

bool deque_pop_front_n ( deque_t * self,
void * destination,
size_t count )

Pops the count first elements of the queue.

If destination is NULL, they will be discarded

Returns
false if there is less than count elements stored

Definition at line 45 of file pop.c.