aboutsummaryrefslogtreecommitdiff
path: root/include/ms_parse.h
diff options
context:
space:
mode:
authorCharles <sircharlesaze@gmail.com>2020-02-28 09:41:52 +0100
committerCharles <sircharlesaze@gmail.com>2020-02-28 12:38:58 +0100
commitcc1b57c96cc8c0fdd53e781b54a83bb9c743179a (patch)
treeb58d43c6fc5b3b57cdeb28f9a21f421d3400196c /include/ms_parse.h
parent83e7d63bc9c2d4a246df3cc8555127f3b956f960 (diff)
downloadminishell-cc1b57c96cc8c0fdd53e781b54a83bb9c743179a.tar.gz
minishell-cc1b57c96cc8c0fdd53e781b54a83bb9c743179a.tar.bz2
minishell-cc1b57c96cc8c0fdd53e781b54a83bb9c743179a.zip
Added environment and state
Also dummy files eval.c parse.c
Diffstat (limited to 'include/ms_parse.h')
-rw-r--r--include/ms_parse.h58
1 files changed, 58 insertions, 0 deletions
diff --git a/include/ms_parse.h b/include/ms_parse.h
new file mode 100644
index 0000000..043f065
--- /dev/null
+++ b/include/ms_parse.h
@@ -0,0 +1,58 @@
+/* ************************************************************************** */
+/* */
+/* ::: :::::::: */
+/* ms_parse.h :+: :+: :+: */
+/* +:+ +:+ +:+ */
+/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
+/* +#+#+#+#+#+ +#+ */
+/* Created: 2020/02/28 09:00:00 by cacharle #+# #+# */
+/* Updated: 2020/02/28 12:28:59 by cacharle ### ########.fr */
+/* */
+/* ************************************************************************** */
+
+#ifndef MS_PARSE_H
+# define MS_PARSE_H
+
+# include "minishell.h"
+
+typedef enum
+{
+ REDIRECTION_OUT,
+ REDIRECTION_IN,
+ REDIRECTION_APPEND
+} t_redirection_type;
+
+typedef struct
+{
+ char *filename;
+ t_redirection_type type;
+} t_redirection;
+
+typedef struct
+{
+ char *name;
+ char **argv;
+ t_ftlst *redirections;
+} t_command;
+
+typedef enum
+{
+ SEPARATOR_SEMICOLON,
+ SEPARATOR_PIPE,
+ SEPARATOR_AND,
+ SEPARATOR_OR,
+} t_separator;
+
+typedef struct
+{
+ t_ftlst *commands;
+ t_ftlst *separators;
+} t_parsing;
+
+/*
+** parse.c
+*/
+
+t_parsing *ms_parse(char *input);
+
+#endif