This commit is contained in:
Maieul BOYER 2024-07-14 11:26:15 +02:00
parent 5778b13f72
commit 5c7b8cde0d
No known key found for this signature in database
8 changed files with 174 additions and 74 deletions

View file

@ -12,7 +12,7 @@
#include "../includes/minishell.h"
// void ft_exec_cmd(t_utils *utils, t_str cmd, t_str cmd_args[])
// void ft_exec_cmd(t_state *utils, t_str cmd, t_str cmd_args[])
// {
// if (execve(cmd, cmd_args, utils->envp) == -1)
// {
@ -22,7 +22,7 @@
// }
// }
//
// void ft_other_cmd(t_utils *shcat, t_usize i, t_usize prev_i)
// void ft_other_cmd(t_state *shcat, t_usize i, t_usize prev_i)
// {
// pid_t pid;
// t_i32 options;

View file

@ -34,7 +34,7 @@ void ft_free_strs(t_str *strs)
ft_free(strs);
}
void ft_free_utils(t_utils *s)
void ft_free_utils(t_state *s)
{
if (s->str_input)
mem_free(s->str_input);
@ -45,7 +45,7 @@ void ft_free_utils(t_utils *s)
ts_parser_delete(s->parser.parser);
}
void ft_exit(t_utils *maiboyerlpb, t_u8 exit_status)
void ft_exit(t_state *maiboyerlpb, t_u8 exit_status)
{
if (maiboyerlpb != NULL)
ft_free_utils(maiboyerlpb);

View file

@ -116,13 +116,13 @@ t_node parse_str(t_parser *parser, t_const_str input)
return (parse_to_nodes(parser->parser, input));
}
void exec_shcat(t_utils *shcat)
void exec_shcat(t_state *shcat)
{
print_node_data(&shcat->current_node, 0);
free_node(shcat->current_node);
}
void ft_take_args(t_utils *shcat)
void ft_take_args(t_state *shcat)
{
t_str cmd;
@ -163,14 +163,14 @@ void free_myparser(t_parser self)
t_i32 main(t_i32 argc, t_str argv[], t_str envp[])
{
t_utils utils;
t_state utils;
(void)argc;
(void)argv;
(void)envp;
if (install_signal())
me_abort("Unable to install signals");
utils = (t_utils){};
utils = (t_state){};
utils.parser = create_myparser();
utils.env = create_env_map();
if (populate_env(utils.env, envp))