minishell/includes/minishell.h
2020-02-14 12:22:35 +01:00

56 lines
1.8 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* minishell.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: tmaze <tmaze@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2018/11/18 13:12:34 by tmaze #+# #+# */
/* Updated: 2020/02/01 15:57:09 by tmaze ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef MINISHELL_H
# define MINISHELL_H
# include <unistd.h>
# include <sys/stat.h>
# include "libft.h"
# define S_BIN 5
typedef struct s_builtin
{
char *cmd;
int (*f)(char **argv, t_env **env);
} t_builtin;
int cmd_env(char **argv, t_env **env);
int cmd_setenv(char **argv, t_env **env);
int cmd_unsetenv(char **argv, t_env **env);
int cmd_cd(char **argv, t_env **env);
int cmd_echo(char **argv, t_env **env);
char **res_ext(char **argv, t_env *env);
int exec_cmd(char **argv, t_env **env);
void *ft_strdel_null(char **s);
void *put_error_cd(char *file, char *msg);
int put_error_cd2(char *file, char *msg);
char *check_path_slash_cd(char *exec);
void exec_cmd_child(char *path, char **argv, char **env_tab,
t_env **env);
int ft_isin(char *str, char c);
void *put_error(char *file, char *msg);
t_env *def_env(void);
void *return_null(char *msg);
t_env *cd_updateenv(char *key, char *val, t_env **env);
#endif