#include <stddef.h>
#include <stdbool.h>
Go to the source code of this file.
|
| t_vect | vect_init (size_t cap, size_t elemsize) |
| |
| bool | vect_reserve (t_vect *vect, size_t newcap) |
| |
| void * | vect_at (const t_vect *vect, size_t index) |
| |
| bool | vect_append_str (t_vect *vect, const char *value, size_t count) |
| |
| bool | vect_append_range (t_vect *vect, const void *value, size_t count) |
| |
| bool | vect_push_back (t_vect *vect, const void *elem, size_t *written_index) |
| |
| bool | vect_set (t_vect *vect, const void *elem, size_t index) |
| |
| bool | vect_remove (t_vect *vect, size_t index) |
| |
| void | vect_dispose (t_vect *vect) |
| |
| void | vect_dispose_each (t_vect *vect, void(*disposer)(void *)) |
| |
| void | vect_dispose_ptrarr (t_vect *vect) |
| |
◆ FT_VECT_EXPAND_STEP
| #define FT_VECT_EXPAND_STEP 32 |
◆ vect_append_range()
| bool vect_append_range |
( |
t_vect * |
vect, |
|
|
const void * |
value, |
|
|
size_t |
count |
|
) |
| |
Definition at line 43 of file vect_append_range.c.
static const int g_flag_not_string
static bool vect_append_internal(t_vect *vect, const void *value, size_t count, int is_str)
◆ vect_append_str()
| bool vect_append_str |
( |
t_vect * |
vect, |
|
|
const char * |
value, |
|
|
size_t |
count |
|
) |
| |
◆ vect_at()
| void* vect_at |
( |
const t_vect * |
vect, |
|
|
size_t |
index |
|
) |
| |
◆ vect_dispose()
| void vect_dispose |
( |
t_vect * |
vect | ) |
|
◆ vect_dispose_each()
| void vect_dispose_each |
( |
t_vect * |
vect, |
|
|
void(*)(void *) |
disposer |
|
) |
| |
Definition at line 25 of file vect_dispose.c.
31 while (pos < vect->len)
void * vect_at(const t_vect *vect, size_t index)
void vect_dispose(t_vect *vect)
◆ vect_dispose_ptrarr()
| void vect_dispose_ptrarr |
( |
t_vect * |
vect | ) |
|
Definition at line 41 of file vect_dispose.c.
static void ptrarr_disposer(void *ptr)
void vect_dispose_each(t_vect *vect, void(*disposer)(void *))
◆ vect_init()
| t_vect vect_init |
( |
size_t |
cap, |
|
|
size_t |
elemsize |
|
) |
| |
Definition at line 16 of file vect_init.c.
void * ft_calloc_nofill(size_t count, size_t size)
◆ vect_push_back()
| bool vect_push_back |
( |
t_vect * |
vect, |
|
|
const void * |
elem, |
|
|
size_t * |
written_index |
|
) |
| |
Definition at line 15 of file vect_push_back.c.
22 if (written_index != NULL)
23 *written_index = index;
bool vect_set(t_vect *vect, const void *elem, size_t index)
◆ vect_remove()
| bool vect_remove |
( |
t_vect * |
vect, |
|
|
size_t |
index |
|
) |
| |
Definition at line 16 of file vect_remove.c.
18 if (vect->
len <= index)
20 if ((index + 1) < vect->
len)
void * ft_memmove(void *dst, const void *src, size_t n)
◆ vect_reserve()
| bool vect_reserve |
( |
t_vect * |
vect, |
|
|
size_t |
newcap |
|
) |
| |
◆ vect_set()
| bool vect_set |
( |
t_vect * |
vect, |
|
|
const void * |
elem, |
|
|
size_t |
index |
|
) |
| |
Definition at line 16 of file vect_set.c.
20 if (vect->
p == NULL || vect->
elemsize == 0 || vect->
len < index)
22 if (vect->
cap <= index
27 if (vect->
len == index)
#define FT_VECT_EXPAND_STEP
bool vect_reserve(t_vect *vect, size_t newcap)