From a7f23a39aacfa0e885d5dbbab8eaeefb21a054c9 Mon Sep 17 00:00:00 2001 From: Antoine Riard Date: Wed, 15 Mar 2017 20:52:38 +0100 Subject: [PATCH] ft_error_message --- libft/Makefile | 2 ++ libft/includes/error.h | 2 +- libft/includes/libft.h | 4 +++- libft/src/btree/btree_map.c | 2 +- libft/src/ft_printf/ft_error_message.c | 19 +++++++++++++++++++ libft/src/printing/ft_error_message.c | 19 +++++++++++++++++++ 6 files changed, 45 insertions(+), 3 deletions(-) create mode 100644 libft/src/ft_printf/ft_error_message.c create mode 100644 libft/src/printing/ft_error_message.c diff --git a/libft/Makefile b/libft/Makefile index 3fafa5ef..4ece6170 100644 --- a/libft/Makefile +++ b/libft/Makefile @@ -65,6 +65,7 @@ dlst/ft_dlstrtostr.c\ dlst/ft_dlstsize.c\ error/error.c\ ft_printf/ft_conversion.c\ +ft_printf/ft_error_message.c\ ft_printf/ft_fmt_simplify.c\ ft_printf/ft_fmt_validate_conv.c\ ft_printf/ft_fmt_validate_flags.c\ @@ -131,6 +132,7 @@ mem/ft_memmove.c\ mem/ft_memset.c\ mem/ft_realloc.c\ path/ft_path_notdir.c\ +printing/ft_error_message.c\ printing/ft_putchar.c\ printing/ft_putendl.c\ printing/ft_putnbr.c\ diff --git a/libft/includes/error.h b/libft/includes/error.h index 7c00d0b2..bedd6e31 100644 --- a/libft/includes/error.h +++ b/libft/includes/error.h @@ -6,7 +6,7 @@ /* By: jhalford +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/03/14 15:34:21 by jhalford #+# #+# */ -/* Updated: 2017/03/14 20:25:26 by jhalford ### ########.fr */ +/* Updated: 2017/03/15 20:51:28 by ariard ### ########.fr */ /* */ /* ************************************************************************** */ diff --git a/libft/includes/libft.h b/libft/includes/libft.h index d1255b0b..56cdf59b 100644 --- a/libft/includes/libft.h +++ b/libft/includes/libft.h @@ -6,7 +6,7 @@ /* By: jhalford +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/11/07 13:49:04 by jhalford #+# #+# */ -/* Updated: 2017/03/14 20:24:05 by jhalford ### ########.fr */ +/* Updated: 2017/03/15 20:51:55 by ariard ### ########.fr */ /* */ /* ************************************************************************** */ @@ -80,6 +80,8 @@ void ft_putendl(char const *s); void ft_putnbr(long n); void ft_putnbr_hex(long n); +int ft_error_message(char *message); + int ft_putchar_fd(int c, int fd); void ft_putstr_fd(char const *s, int fd); void ft_putendl_fd(char const *s, int fd); diff --git a/libft/src/btree/btree_map.c b/libft/src/btree/btree_map.c index deb32d44..b7751156 100644 --- a/libft/src/btree/btree_map.c +++ b/libft/src/btree/btree_map.c @@ -6,7 +6,7 @@ /* By: jhalford +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/03/08 11:50:46 by jhalford #+# #+# */ -/* Updated: 2017/03/08 12:03:17 by jhalford ### ########.fr */ +/* Updated: 2017/03/15 18:43:15 by ariard ### ########.fr */ /* */ /* ************************************************************************** */ diff --git a/libft/src/ft_printf/ft_error_message.c b/libft/src/ft_printf/ft_error_message.c new file mode 100644 index 00000000..ed47e8d2 --- /dev/null +++ b/libft/src/ft_printf/ft_error_message.c @@ -0,0 +1,19 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_error_message.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: ariard +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2017/03/15 20:47:31 by ariard #+# #+# */ +/* Updated: 2017/03/15 20:50:50 by ariard ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "libft.h" + +int ft_error_message(char *message) +{ + ft_dprintf(2, message); + return (-1); +} diff --git a/libft/src/printing/ft_error_message.c b/libft/src/printing/ft_error_message.c new file mode 100644 index 00000000..2eb9f7d3 --- /dev/null +++ b/libft/src/printing/ft_error_message.c @@ -0,0 +1,19 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_error_message.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: ariard +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2017/03/15 20:47:31 by ariard #+# #+# */ +/* Updated: 2017/03/15 20:50:58 by ariard ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "libft.h" + +int ft_error_message(char *message) +{ + ft_dprintf(2, message); + return (-1); +}