blob: a7b1ef213c2a412f3ac71ed3c75d8b15954b88f2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* free_token.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: dkaiser <dkaiser@student.42heilbronn.de +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/06/27 14:38:57 by dkaiser #+# #+# */
/* Updated: 2024/07/09 14:30:02 by dkaiser ### ########.fr */
/* */
/* ************************************************************************** */
#include "token.h"
void free_token(t_token *token)
{
if (token->previous != NULL)
token->previous->next = NULL;
if (token->next != NULL)
token->next->previous = NULL;
free(token);
}
void free_token_and_connect(t_token *token)
{
if (token->previous != NULL)
token->previous->next = token->next;
if (token->next != NULL)
token->next->previous = token->previous;
free(token);
}
|