debut du parsing :(

This commit is contained in:
Tom Moron
2024-02-06 22:23:32 +01:00
parent c13f32bf42
commit 9b80cc758f
11 changed files with 314 additions and 66 deletions

31
ft_lst_cmd.c Normal file
View File

@ -0,0 +1,31 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lst_cmd.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: tomoron <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/02/06 20:46:19 by tomoron #+# #+# */
/* Updated: 2024/02/06 22:09:09 by tomoron ### ########.fr */
/* */
/* ************************************************************************** */
#include "minishell.h"
t_cmd *ft_cmd_add_back(t_cmd *cmd, char *token)
{
t_cmd *res;
t_cmd *current;
res = ft_calloc(1, sizeof(t_cmd));
if (!res)
return (cmd);
res->token = token;
if (!cmd)
return (res);
current = cmd;
while (current->next)
current = current->next;
current->next = res;
return (cmd);
}