aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDominik Kaiser2024-08-11 11:18:26 +0200
committerDominik Kaiser2024-08-11 11:18:26 +0200
commit8cf2aec82f98094d8175c5e5daaaa115f9b64fc2 (patch)
tree9c06dfc42031efc26f1fdfeec4bca8c975c4199c /include
parentc7a4494fd97b7e80665cbd47ed96bc37bf5800e5 (diff)
parent8abf7abdc9d49f52c4fcad0afc92730c4c195b7f (diff)
downloadminishell-8cf2aec82f98094d8175c5e5daaaa115f9b64fc2.tar.gz
minishell-8cf2aec82f98094d8175c5e5daaaa115f9b64fc2.zip
Merge changes from main into parser branch
Diffstat (limited to 'include')
-rw-r--r--include/env.h23
-rw-r--r--include/minishell.h3
-rw-r--r--include/token.h5
3 files changed, 28 insertions, 3 deletions
diff --git a/include/env.h b/include/env.h
new file mode 100644
index 0000000..1ea6f2e
--- /dev/null
+++ b/include/env.h
@@ -0,0 +1,23 @@
+/* ************************************************************************** */
+/* */
+/* ::: :::::::: */
+/* env.h :+: :+: :+: */
+/* +:+ +:+ +:+ */
+/* By: dkaiser <dkaiser@student.42heilbronn.de +#+ +:+ +#+ */
+/* +#+#+#+#+#+ +#+ */
+/* Created: 2024/08/08 16:53:39 by dkaiser #+# #+# */
+/* Updated: 2024/08/08 17:05:11 by dkaiser ### ########.fr */
+/* */
+/* ************************************************************************** */
+
+typedef struct s_env {
+ char *name;
+ char *value;
+ struct s_env *next;
+} t_env;
+
+char *env_get(t_env *env, char *name);
+void env_export(t_env *env, char *name, char *value);
+void env_unset(t_env *env, char *name);
+char **env_to_strlst(t_env *env);
+t_env **env_from_strlst(char **lst);
diff --git a/include/minishell.h b/include/minishell.h
index b21acbc..4f04682 100644
--- a/include/minishell.h
+++ b/include/minishell.h
@@ -6,7 +6,7 @@
/* By: dkaiser <dkaiser@student.42heilbronn.de +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/06/22 17:14:49 by dkaiser #+# #+# */
-/* Updated: 2024/08/02 13:55:48 by dkaiser ### ########.fr */
+/* Updated: 2024/08/11 10:59:16 by dkaiser ### ########.fr */
/* */
/* ************************************************************************** */
@@ -16,6 +16,7 @@
# include "debug_tools.h"
# include "ast.h"
# include "token.h"
+# include "env.h"
# include "libft.h"
# include <stdio.h>
# include <readline/readline.h>
diff --git a/include/token.h b/include/token.h
index 72ca5e5..49d51e1 100644
--- a/include/token.h
+++ b/include/token.h
@@ -3,10 +3,10 @@
/* ::: :::::::: */
/* token.h :+: :+: :+: */
/* +:+ +:+ +:+ */
-/* By: dkaiser <dkaiser@student.42heilbronn.de +#+ +:+ +#+ */
+/* By: chuhlig <chuhlig@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/06/27 13:27:18 by dkaiser #+# #+# */
-/* Updated: 2024/08/02 14:13:19 by dkaiser ### ########.fr */
+/* Updated: 2024/08/11 11:00:22 by dkaiser ### ########.fr */
/* */
/* ************************************************************************** */
@@ -47,5 +47,6 @@ t_token *new_redir_token(int type, t_token *previous,
void free_token(t_token *token);
void free_token_and_connect(t_token *token);
void free_tokens(t_token *tokens);
+void tokenizer(char *s, t_token **token_list);
#endif