organised functions into multiple files and did some more norming

This commit is contained in:
mdev9
2024-04-24 11:06:03 +02:00
parent ab5190ee8f
commit 20037a4609
10 changed files with 276 additions and 223 deletions

View File

@ -6,44 +6,12 @@
/* By: marde-vr <marde-vr@42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/03/05 18:19:26 by marde-vr #+# #+# */
/* Updated: 2024/04/23 16:58:07 by tomoron ### ########.fr */
/* Updated: 2024/04/24 10:51:28 by marde-vr ### ########.fr */
/* */
/* ************************************************************************** */
#include "minishell.h"
void free_fds(t_msh *msh)
{
int i;
if (msh->fds)
{
i = 0;
while (msh->fds[i])
{
free(msh->fds[i]);
msh->fds[i] = 0;
i++;
}
free(msh->fds);
msh->fds = 0;
}
}
void free_msh(t_msh *msh)
{
if (msh)
{
free_env(msh->env);
free(msh->pids);
free_cmd(msh->cmds_head);
free_fds(msh);
free(msh->here_doc_filename);
free_token(msh->tokens);
free(msh);
}
}
void ft_exit(t_msh *msh, int exit_code)
{
set_echoctl(msh->echoctl);