aboutsummaryrefslogtreecommitdiff
path: root/philo/include
diff options
context:
space:
mode:
authorDominik Kaiser2025-01-28 13:06:21 +0100
committerDominik Kaiser2025-01-28 13:06:21 +0100
commit4d1f3f9325c706ef0b4eb1e78957f886abf28e8b (patch)
tree1c48f69b10966c21cd738cc712be841228186f99 /philo/include
parent5c7f172387e6c2bae5476d721509ee7c065002a6 (diff)
downloadPhilosophers-4d1f3f9325c706ef0b4eb1e78957f886abf28e8b.tar.gz
Philosophers-4d1f3f9325c706ef0b4eb1e78957f886abf28e8b.zip
Integrate ft_utils.h into philo.h
Diffstat (limited to 'philo/include')
-rw-r--r--philo/include/ft_utils.h39
-rw-r--r--philo/include/philo.h24
2 files changed, 22 insertions, 41 deletions
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 <dkaiser@student.42heilbronn.de +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2025/01/17 11:57:44 by dkaiser #+# #+# */
-/* Updated: 2025/01/21 12:04:07 by dkaiser ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#ifndef FT_UTILS_H
-# define FT_UTILS_H
-
-# include <stdio.h>
-# include <stdlib.h>
-# include <sys/time.h>
-
-/*
-** 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 <dkaiser@student.42heilbronn.de +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/01/17 10:23:19 by dkaiser #+# #+# */
-/* Updated: 2025/01/26 12:05:33 by dkaiser ### ########.fr */
+/* Updated: 2025/01/28 13:06:11 by dkaiser ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef PHILO_H
# define PHILO_H
-# include "ft_utils.h"
# include <pthread.h>
# include <stdio.h>
# include <stdlib.h>
# include <unistd.h>
+# include <sys/time.h>
# define ERR_USAGE "Usage: <nbr_of_philos> <ttd> <tte> <tts> [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