Compiling!

This commit is contained in:
Maieul BOYER 2024-04-30 14:20:06 +02:00
parent 019d25174c
commit a22b9ea234
No known key found for this signature in database
24 changed files with 607 additions and 113 deletions

View file

@ -53,5 +53,6 @@ void vec_buf_str_iter(t_vec_buf_str *vec,
void vec_buf_str_reverse(t_vec_buf_str *vec);
void vec_buf_str_sort(t_vec_buf_str *vec,
t_vec_buf_str_sort_fn is_sorted);
t_error vec_buf_str_back(t_vec_buf_str *vec, t_buffer_str **out);
#endif

View file

@ -53,5 +53,6 @@ void vec_str_iter(t_vec_str *vec,
void vec_str_reverse(t_vec_str *vec);
void vec_str_sort(t_vec_str *vec,
t_vec_str_sort_fn is_sorted);
t_error vec_str_back(t_vec_str *vec, t_str **out);
#endif

View file

@ -53,5 +53,6 @@ void vec_u8_iter(t_vec_u8 *vec,
void vec_u8_reverse(t_vec_u8 *vec);
void vec_u8_sort(t_vec_u8 *vec,
t_vec_u8_sort_fn is_sorted);
t_error vec_u8_back(t_vec_u8 *vec, t_u8 **out);
#endif

View file

@ -71,3 +71,14 @@ void vec_buf_str_reverse(t_vec_buf_str *vec)
i++;
}
}
t_error vec_buf_str_back(t_vec_buf_str *vec, t_buffer_str **out)
{
t_buffer_str *temporary;
if (out == NULL)
out = &temporary;
if (vec->len != 0)
return (*out = &vec->buffer[vec->len - 1], true);
return (false);
}

View file

@ -71,3 +71,14 @@ void vec_str_reverse(t_vec_str *vec)
i++;
}
}
t_error vec_str_back(t_vec_str *vec, t_str **out)
{
t_str *temporary;
if (out == NULL)
out = &temporary;
if (vec->len != 0)
return (*out = &vec->buffer[vec->len - 1], true);
return (false);
}

View file

@ -71,3 +71,14 @@ void vec_u8_reverse(t_vec_u8 *vec)
i++;
}
}
t_error vec_u8_back(t_vec_u8 *vec, t_u8 **out)
{
t_u8 *temporary;
if (out == NULL)
out = &temporary;
if (vec->len != 0)
return (*out = &vec->buffer[vec->len - 1], true);
return (false);
}