From 3bb997212b3a0d140a34932f9deff52793673d49 Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Wed, 16 Sep 2020 16:40:22 +0200 Subject: Added g_state to store global variables, Refactoring tok_assign_str --- include/minishell.h | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/minishell.h b/include/minishell.h index 58afe7f..2f64269 100644 --- a/include/minishell.h +++ b/include/minishell.h @@ -6,7 +6,7 @@ /* By: cacharle +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/02/26 15:33:51 by cacharle #+# #+# */ -/* Updated: 2020/09/16 16:07:36 by charles ### ########.fr */ +/* Updated: 2020/09/16 16:26:25 by charles ### ########.fr */ /* */ /* ************************************************************************** */ @@ -50,8 +50,14 @@ typedef t_ftvec* t_env; -extern int g_last_status; -extern char *g_progname; +typedef struct +{ + int last_status; + char *progname; + +} t_state; + +extern t_state g_state; /* ** path.c @@ -127,6 +133,6 @@ void print_prompt(void); ** setup.c */ -bool setup(char *first_arg, t_env env); +bool setup(char *first_arg, t_env env); #endif -- cgit