/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_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 "ft_d_define.h" static void ft_write_fail(const char concern[], const char msg[]) { ft_dprintf(STDERR_FILENO, "minishell: %s: %s\n", concern, msg); } void ft_fail_no_options(const char concern[]) { ft_write_fail(concern, FT_FAIL_NO_OPTIONS); } void ft_fail_identifier(const char concern[], const char identifier[]) { ft_dprintf(STDERR_FILENO, "minishell: %s: `%s': not a valid identifier\n", concern, identifier); } void ft_fail_too_many_args(const char concern[]) { ft_write_fail(concern, FT_FAIL_TOO_MANY_ARGS); } void ft_fail_alloc(void) { ft_write_fail("minishell", FT_FAIL_ALLOC); exit(FT_RET_ALLOC); }