minishell/src/utils/init_minishell.c
2025-02-26 16:17:07 +01:00

33 lines
1.2 KiB
C

/* ************************************************************************** */
/* */
/* :::::::: */
/* init_minishell.c :+: :+: */
/* +:+ */
/* By: whaffman <whaffman@student.codam.nl> +#+ */
/* +#+ */
/* Created: 2025/02/05 16:03:03 by whaffman #+# #+# */
/* Updated: 2025/02/26 16:16:37 by whaffman ######## odam.nl */
/* */
/* ************************************************************************** */
#include "minishell.h"
t_minishell *init_minishell(void)
{
t_minishell *msh;
msh = malloc(sizeof(t_minishell));
if (!msh)
{
perror("failed assigning msh memory");
exit(EXIT_FAILURE);
}
msh->environment = NULL;
msh->line = NULL;
msh->lexer = NULL;
msh->tokens = NULL;
msh->commands = NULL;
msh->freelist = NULL;
return (msh);
}