Dynarr 0.0.1
C dynamic array
Loading...
Searching...
No Matches

Main dynarr methods. More...

Collaboration diagram for Lifetime:

Macros

#define dynarr_create(...)
 Dynarr constructor.
 

Functions

vector_tvector_create_ (const vector_opts_t *const opts)
 
void vector_destroy (vector_t *const vector)
 
vector_tvector_clone (const vector_t *const vector)
 
vector_status_t vector_resize (vector_t **const vector, const size_t capacity, const vector_status_t error)
 
dynarr_t * dynarr_create_ (const dynarr_opts_t *const opts)
 Constructor of the dynamic array.
 
void dynarr_destroy (dynarr_t *const dynarr)
 Deallocates a dynamic array.
 
dynarr_t * dynarr_clone (const dynarr_t *const dynarr)
 Duplicate a dynarr.
 

Detailed Description

Main dynarr methods.

Macro Definition Documentation

◆ dynarr_create

#define dynarr_create ( ...)
Value:
__VA_ARGS__ \
}) \
#define DYNARR_DEFAULT_ARGS
Definition dynarr.h:59
dynarr_t * dynarr_create_(const dynarr_opts_t *const opts)
Constructor of the dynamic array.
Definition dynarr.c:89
Dynarr creating options.
Definition dynarr.h:25

Dynarr constructor.

Wrapper over dynarr_create_ . Provides default values.

See also
vector_create
Examples
create.c, and input_strings.c.

Definition at line 81 of file dynarr.h.

Function Documentation

◆ dynarr_create_()

dynarr_t * dynarr_create_ ( const dynarr_opts_t *const opts)

Constructor of the dynamic array.

Dynamic array constructor function that initializes array with properties packed in opts struct. Space for initial_cap elements will be reserved. Array will not be able to shrink below initial_cap. In case of allocation fail null pointer will be returned.

Parameters
[in]optsConfiguration of the dynarr to create.

Definition at line 89 of file dynarr.c.

Here is the call graph for this function:

◆ dynarr_destroy()

void dynarr_destroy ( dynarr_t *const dynarr)

Deallocates a dynamic array.

After the call pointer will be invalidated.

Parameters
[in]dynarrInstance of a dynarr.

Definition at line 136 of file dynarr.c.

Here is the call graph for this function:

◆ dynarr_clone()

dynarr_t * dynarr_clone ( const dynarr_t *const dynarr)

Duplicate a dynarr.

Makes an exact copy of the whole dynarr. (Allocation fail prone).

Parameters
[in]dynarrInstance of a dynarr.
Returns
new duplicated instance of a dynarr.

Definition at line 129 of file dynarr.c.

Here is the call graph for this function: