From 4d1f3f9325c706ef0b4eb1e78957f886abf28e8b Mon Sep 17 00:00:00 2001 From: Dominik Kaiser Date: Tue, 28 Jan 2025 13:06:21 +0100 Subject: [PATCH] Integrate ft_utils.h into philo.h --- philo/include/ft_utils.h | 39 --------------------------------------- philo/include/philo.h | 24 ++++++++++++++++++++++-- philo/src/ft_utils.c | 4 ++-- philo/src/philo_eat.c | 4 +--- 4 files changed, 25 insertions(+), 46 deletions(-) delete mode 100644 philo/include/ft_utils.h diff --git a/philo/include/ft_utils.h b/philo/include/ft_utils.h deleted file mode 100644 index 2299cd9..0000000 --- a/philo/include/ft_utils.h +++ /dev/null @@ -1,39 +0,0 @@ -/* ************************************************************************** */ -/* */ -/* ::: :::::::: */ -/* ft_utils.h :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: dkaiser -# include -# include - -/* -** Prints error message and returns EXIT_FAILURE -*/ -int ft_err(const char *str); - -/* -** Returns integer value from str -*/ -int ft_atoi(const char *str); - -/* -** Returns current time in milliseconds -*/ -int ft_cur_time_in_ms(void); - -/* -** Prints "timestamp_in_ms id str" -*/ -void ft_log(int id, const char *str); -#endif diff --git a/philo/include/philo.h b/philo/include/philo.h index bbc1bc2..390cadd 100644 --- a/philo/include/philo.h +++ b/philo/include/philo.h @@ -6,18 +6,18 @@ /* By: dkaiser # include # include # include +# include # define ERR_USAGE "Usage: [times_must_eat]" # define ERR_MALLOC "Memory allocation failed" @@ -56,4 +56,24 @@ int run_simulation(int nbr_of_philos, t_philo *philos, int philo_die(t_philo *philo); void philo_eat(t_philo *philo); +/* +** Prints error message and returns EXIT_FAILURE +*/ +int ft_err(const char *str); + +/* +** Returns integer value from str +*/ +int ft_atoi(const char *str); + +/* +** Returns current time in milliseconds +*/ +int ft_cur_time_in_ms(void); + +/* +** Prints "timestamp_in_ms id str" +*/ +void ft_log(int id, const char *str); + #endif diff --git a/philo/src/ft_utils.c b/philo/src/ft_utils.c index ba5756d..d77ee3f 100644 --- a/philo/src/ft_utils.c +++ b/philo/src/ft_utils.c @@ -6,11 +6,11 @@ /* By: dkaiser static void take_fork(t_philo *philo, t_fork *fork) { -- 2.47.2