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

Create and destroy deques. More...

#include "o2s/deque.h"
#include <stdlib.h>

Go to the source code of this file.

Functions

deque_t deque_new (void *storage, size_t capacity, size_t type_size)
 Contructs an deque, using externally owned memory.
deque_t deque_allocate (size_t capacity, size_t type_size)
 Constructs a deque, allocating the needed memory.
void deque_clear (deque_t *self)
 Clears properly the deque.
void deque_free (deque_t *self)
 Frees properly the deque.

Detailed Description

Create and destroy deques.

Author
Hugo FOLCHER
Antoine GAGNIERE

Definition in file constructors_destructors.c.

Function Documentation

◆ deque_allocate()

deque_t deque_allocate ( size_t capacity,
size_t type_size )

Constructs a deque, allocating the needed memory.

If the allocation failed, the capacity will be set to zero.

Definition at line 36 of file constructors_destructors.c.