aboutsummaryrefslogtreecommitdiff
path: root/philo_one/src/philo_one.h
diff options
context:
space:
mode:
authorCharles Cabergs <me@cacharle.xyz>2020-09-30 07:59:27 +0200
committerCharles Cabergs <me@cacharle.xyz>2020-09-30 07:59:27 +0200
commitd7aea773431926cefb6430b948329da1662d1dee (patch)
tree984fd10acf619ee8da84e7111742399a55a02770 /philo_one/src/philo_one.h
parentb6f4db572d7d40c178ec286373422faa2172f135 (diff)
downloadphilosophers-d7aea773431926cefb6430b948329da1662d1dee.tar.gz
philosophers-d7aea773431926cefb6430b948329da1662d1dee.tar.bz2
philosophers-d7aea773431926cefb6430b948329da1662d1dee.zip
Refactoring common lib
Diffstat (limited to 'philo_one/src/philo_one.h')
-rw-r--r--philo_one/src/philo_one.h50
1 files changed, 14 insertions, 36 deletions
diff --git a/philo_one/src/philo_one.h b/philo_one/src/philo_one.h
index e92fdcd..2c04316 100644
--- a/philo_one/src/philo_one.h
+++ b/philo_one/src/philo_one.h
@@ -6,7 +6,7 @@
/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/11/24 06:11:16 by cacharle #+# #+# */
-/* Updated: 2020/09/29 14:15:47 by cacharle ### ########.fr */
+/* Updated: 2020/09/30 07:48:36 by cacharle ### ########.fr */
/* */
/* ************************************************************************** */
@@ -21,24 +21,22 @@
# include <limits.h>
# include <stdarg.h>
-typedef long int t_time;
+# include "common.h"
-typedef enum
-{
- EVENT_FORK,
- EVENT_EAT,
- EVENT_SLEEP,
- EVENT_THINK,
- EVENT_DIE
-} t_philo_event;
+// typedef long int t_time;
+
+// typedef enum
+// {
+// EVENT_FORK,
+// EVENT_EAT,
+// EVENT_SLEEP,
+// EVENT_THINK,
+// EVENT_DIE
+// } t_philo_event;
typedef struct
{
- int philo_num;
- t_time timeout_death;
- t_time timeout_eat;
- t_time timeout_sleep;
- int meal_num;
+ t_philo_args args;
bool all_alive;
pthread_mutex_t mutex_stdout;
pthread_mutex_t mutex_all_alive;
@@ -82,7 +80,7 @@ bool philos_start(
t_philo *philos,
t_routine_arg *routine_args,
int num);
-void philos_join(t_philo *philos, int num);
+void philos_detach(t_philo *philos, int num);
/*
** routine.c
@@ -100,24 +98,4 @@ void io_think(t_routine_arg *arg);
void io_sleep(t_routine_arg *arg);
void io_die(t_routine_arg *arg);
-/*
-** common.c
-*/
-
-bool parse_args(
- t_philo_conf *philo_args,
- int argc,
- char **argv);
-
-/*
-** helper.c
-*/
-
-long int h_atou_strict(char *s);
-void h_putnbr(unsigned long num);
-void h_putchar(char c);
-void h_putstr(char *s);
-int h_err(int ret, const char *format, ...);
-t_time h_time_now(void);
-
#endif