aboutsummaryrefslogtreecommitdiff
path: root/philo/include/philo.h
diff options
context:
space:
mode:
Diffstat (limited to 'philo/include/philo.h')
-rw-r--r--philo/include/philo.h24
1 files changed, 22 insertions, 2 deletions
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