aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorCharles <sircharlesaze@gmail.com>2020-06-23 09:09:17 +0200
committerCharles <sircharlesaze@gmail.com>2020-06-23 10:31:27 +0200
commit11b258841f4a15c514c49af7d378b51cd6a8ab79 (patch)
tree0df3f625f49fc1a8ca0e74f81272120f07a35feb /include
parent58fc321ec43be4c3f7976769733116232361857a (diff)
downloadminishell-11b258841f4a15c514c49af7d378b51cd6a8ab79.tar.gz
minishell-11b258841f4a15c514c49af7d378b51cd6a8ab79.tar.bz2
minishell-11b258841f4a15c514c49af7d378b51cd6a8ab79.zip
Fixing builtin which needed to not be run in a child process, Added exit builtin
Diffstat (limited to 'include')
-rw-r--r--include/eval.h4
-rw-r--r--include/lexer.h3
-rw-r--r--include/minishell.h9
3 files changed, 9 insertions, 7 deletions
diff --git a/include/eval.h b/include/eval.h
index 97c1ce8..e300644 100644
--- a/include/eval.h
+++ b/include/eval.h
@@ -6,7 +6,7 @@
/* By: charles <charles@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/04/01 17:05:30 by charles #+# #+# */
-/* Updated: 2020/06/19 12:18:42 by charles ### ########.fr */
+/* Updated: 2020/06/23 08:33:02 by charles ### ########.fr */
/* */
/* ************************************************************************** */
@@ -35,7 +35,7 @@ typedef struct
char *exec_path;
char **argv;
t_env env;
- t_builtin_func builtin;
+ t_builtin_entry *builtin;
} t_fork_param_cmd;
# define MS_NO_FD -2
diff --git a/include/lexer.h b/include/lexer.h
index df05c20..b5df79f 100644
--- a/include/lexer.h
+++ b/include/lexer.h
@@ -6,7 +6,7 @@
/* By: nahaddac <nahaddac@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/06/19 10:51:26 by nahaddac #+# #+# */
-/* Updated: 2020/06/19 10:51:30 by nahaddac ### ########.fr */
+/* Updated: 2020/06/23 08:55:53 by charles ### ########.fr */
/* */
/* ************************************************************************** */
@@ -54,6 +54,7 @@ int lexer_verif_entre_cote(char *input, int i);
int lexe_space(char *input);
t_token *token_new(enum e_token_tag tag, char *content);
+t_token *token_new_until(enum e_token_tag tag, char *content, int n);
void token_destroy(t_token *token);
void token_destroy_lst(t_ftlst *tokens);
void token_destroy_lst2(t_ftlst *tokens1, t_ftlst *tokens2);
diff --git a/include/minishell.h b/include/minishell.h
index 5f4f56a..f2b237f 100644
--- a/include/minishell.h
+++ b/include/minishell.h
@@ -6,7 +6,7 @@
/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/02/26 15:33:51 by cacharle #+# #+# */
-/* Updated: 2020/06/18 13:45:27 by charles ### ########.fr */
+/* Updated: 2020/06/23 08:32:46 by charles ### ########.fr */
/* */
/* ************************************************************************** */
@@ -79,13 +79,14 @@ typedef int (*t_builtin_func)(char **argv, t_env env);
** \param func Associated function
*/
-struct s_builtin_entry
+typedef struct
{
char *name;
t_builtin_func func;
-};
+ bool child_process;
+} t_builtin_entry;
-t_builtin_func builtin_search_func(char *name);
+t_builtin_entry *builtin_search_func(char *name);
int builtin_echo(char **argv, t_env env);
int builtin_cd(char **argv, t_env env);