/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* philo.h :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: narnaud +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2022/05/16 14:03:01 by narnaud #+# #+# */ /* Updated: 2022/05/20 11:51:03 by narnaud ### ########.fr */ /* */ /* ************************************************************************** */ #ifndef PHILO_H # define PHILO_H # include # include # include # include # include # include # include # include # include # include # include # include enum e_params { PHILO_AMOUNT, DIE_TIME, EAT_DURATION, SLEEP_DURATION, MEALS_AMOUNT, }; typedef struct s_table t_table; typedef struct s_philo { int id; int meals_done; int last_meal_time; t_table *table; } t_philo; typedef struct s_table { int param[5]; int i; sem_t *sptr; sem_t *talk; t_philo *philos; int time; int *pid; } t_table; /***************************/ t_table *parsing(char **argv); int gettime(void); void safe_print(t_philo *philo, char *str); #endif