aboutsummaryrefslogtreecommitdiff
path: root/philo_one/common.c
diff options
context:
space:
mode:
authorCharles Cabergs <me@cacharle.xyz>2020-09-28 15:02:51 +0200
committerCharles Cabergs <me@cacharle.xyz>2020-09-28 15:02:51 +0200
commitac4278405b7a258010219499cccc0dd978201caf (patch)
tree501b23b1874b6fa264c9b612d0fe5b5ebc9cd26a /philo_one/common.c
parentf0a36076950bf0c3356ad73382ce3d341cdb0463 (diff)
downloadphilosophers-ac4278405b7a258010219499cccc0dd978201caf.tar.gz
philosophers-ac4278405b7a258010219499cccc0dd978201caf.tar.bz2
philosophers-ac4278405b7a258010219499cccc0dd978201caf.zip
Added argument error reporting
Diffstat (limited to 'philo_one/common.c')
-rw-r--r--philo_one/common.c32
1 files changed, 0 insertions, 32 deletions
diff --git a/philo_one/common.c b/philo_one/common.c
deleted file mode 100644
index f67cd48..0000000
--- a/philo_one/common.c
+++ /dev/null
@@ -1,32 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* common.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2020/02/08 23:12:55 by cacharle #+# #+# */
-/* Updated: 2020/09/27 10:36:31 by charles ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "philo_one.h"
-
-bool parse_args(t_philo_conf *philo_args, int argc, char **argv)
-{
- if (argc != 5 && argc != 6)
- return (false);
- if ((philo_args->philo_num = h_atou_strict(argv[1])) == -1
- || (philo_args->timeout_death = h_atou_strict(argv[2])) == -1
- || (philo_args->timeout_eat = h_atou_strict(argv[3])) == -1
- || (philo_args->timeout_sleep = h_atou_strict(argv[4])) == -1)
- return (false);
- if (argc == 6)
- {
- if ((philo_args->meal_num = h_atou_strict(argv[5])) == -1)
- return (false);
- }
- else
- philo_args->meal_num = 1;
- return (true);
-}