init structs
This commit is contained in:
@@ -8,21 +8,7 @@
|
||||
# include <unistd.h>
|
||||
# include <pthread.h>
|
||||
|
||||
typedef struct s_conditions
|
||||
{
|
||||
int n_phi; // number_of_philosophers
|
||||
int t_die; // time_to_die
|
||||
int t_eat; // time_to_eat
|
||||
int t_slp; // time_to_sleep
|
||||
int n_eat; // [number_of_times_each_philosopher_must_eat]
|
||||
} t_conditions;
|
||||
|
||||
typedef struct s_philo
|
||||
{
|
||||
t_conditions *conditions;
|
||||
int philo_nbr;
|
||||
struct s_philo *prev;
|
||||
struct s_philo *next;
|
||||
} t_philo;
|
||||
# include "philo_struct.h"
|
||||
# include "philo_proto.h"
|
||||
|
||||
#endif
|
||||
|
||||
8
headers/philo_proto.h
Normal file
8
headers/philo_proto.h
Normal file
@@ -0,0 +1,8 @@
|
||||
#ifndef PHILO_PROTO_H
|
||||
# define PHILO_PROTO_H
|
||||
|
||||
// init.c
|
||||
t_philo *init(char **av);
|
||||
|
||||
#endif
|
||||
|
||||
21
headers/philo_struct.h
Normal file
21
headers/philo_struct.h
Normal file
@@ -0,0 +1,21 @@
|
||||
#ifndef PHILO_STRUCT_H
|
||||
# define PHILO_STRUCT_H
|
||||
|
||||
typedef struct s_conditions
|
||||
{
|
||||
int n_phi; // number_of_philosophers
|
||||
int t_die; // time_to_die
|
||||
int t_eat; // time_to_eat
|
||||
int t_slp; // time_to_sleep
|
||||
int n_eat; // [number_of_times_each_philosopher_must_eat]
|
||||
} t_conditions;
|
||||
|
||||
typedef struct s_philo
|
||||
{
|
||||
t_conditions *conditions;
|
||||
int philo_nbr;
|
||||
struct s_philo *prev;
|
||||
struct s_philo *next;
|
||||
} t_philo;
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user