/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* f_fail.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: rbousset +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/02/14 17:19:27 by rbousset #+# #+# */ /* Updated: 2020/02/14 17:19:29 by rbousset ### ########lyon.fr */ /* */ /* ************************************************************************** */ #include #include #include #include #include #include "d_define.h" #include "s_struct.h" static void f_write_fail(const char concern[], const char msg[], t_msh *msh) { ft_dprintf(STDERR_FILENO, "%s: %s: %s\n", msh->argv[0], concern, msg); } void f_fail_no_options(const char concern[], t_msh *msh) { f_write_fail(concern, F_NO_OPTIONS, msh); } void f_fail_identifier(const char concern[], const char identifier[]) { ft_dprintf(STDERR_FILENO, "minishell: %s: `%s': not a valid identifier\n", concern, identifier); } void f_fail_too_many_args(const char concern[], t_msh *msh) { f_write_fail(concern, F_TOO_MANY_ARGS, msh); } void f_fail_non_numeric_arg(const char concern[], char *arg) { ft_dprintf(STDERR_FILENO, "minishell: %s: `%s': numerical argument required\n", concern, arg); }