This commit is contained in:
mcolonna 2024-07-01 11:23:31 +02:00
parent 0bcb738496
commit 147743058d
4 changed files with 29 additions and 28 deletions

View file

@ -6,7 +6,7 @@
/* By: mcolonna <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/04/24 13:47:40 by mcolonna #+# #+# */
/* Updated: 2024/06/27 14:47:14 by mcolonna ### ########.fr */
/* Updated: 2024/07/01 11:15:33 by mcolonna ### ########.fr */
/* */
/* ************************************************************************** */
@ -20,13 +20,13 @@
// Global variables for all the parsing functions
typedef struct s_parsing_args
{
t_memclass mc; // mc freed given to parse_command
t_command r; // t_command that parse_command will return
t_stream stream; // stream reading the command string
t_list calls; // list of calls
bool got_first_call; // already got at least the first program call?
const char *heredoc; // EOF line for heredoc. NULL if no heredoc
t_list *variables; // list of current variables
t_memclass mc;
t_command r;
t_stream stream;
t_list calls;
bool got_first_call;
const char *heredoc;
t_list *variables;
t_env *env;
} t_parsing_args;

View file

@ -6,7 +6,7 @@
/* By: mcolonna <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/04/24 13:47:40 by mcolonna #+# #+# */
/* Updated: 2024/06/28 14:33:14 by mcolonna ### ########.fr */
/* Updated: 2024/07/01 13:38:03 by mcolonna ### ########.fr */
/* */
/* ************************************************************************** */
@ -15,8 +15,10 @@
void variables_set(t_list *variables, const char *name, const char *value)
{
variables_find(variables, name)->value = (
str_dup(fatal_error, variables->mc, value));
t_variable *var;
var = variables_find(variables, name);
var->value = str_dup(fatal_error, variables->mc, value);
}
const char *variables_get(t_list *variables, const char *name)