32 lines
1.3 KiB
C
32 lines
1.3 KiB
C
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* token_functions4.c :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2023/12/30 17:59:28 by maiboyer #+# #+# */
|
|
/* Updated: 2024/09/26 18:29:18 by maiboyer ### ########.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
#include "me/mem/mem.h"
|
|
#include "me/types.h"
|
|
#include "me/vec/vec_token.h"
|
|
#include <stdlib.h>
|
|
|
|
t_token *vec_token_get(t_vec_token *vec, t_usize i)
|
|
{
|
|
if (vec == NULL || vec->buffer == NULL)
|
|
return (NULL);
|
|
if (i < vec->len)
|
|
return (&vec->buffer[i]);
|
|
return (NULL);
|
|
}
|
|
|
|
t_token *vec_token_last(t_vec_token *vec)
|
|
{
|
|
if (vec == NULL || vec->len == 0)
|
|
return (NULL);
|
|
return (&vec->buffer[vec->len - 1]);
|
|
}
|