-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathparse_input.c
More file actions
41 lines (38 loc) · 1.47 KB
/
parse_input.c
File metadata and controls
41 lines (38 loc) · 1.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* parse_input.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: algungor <algungor@student.42istanbul.com.t+#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2026/04/27 13:46:32 by algungor #+# #+# */
/* Updated: 2026/05/06 17:23:37 by algungor ### ########.fr */
/* */
/* ************************************************************************** */
#include "push_swap.h"
int parse_input(t_stack **a, t_option *option, int ac, char **av)
{
int i;
i = 1;
option->mode = 0;
option->bench = 0;
while (i < ac)
{
if (!ft_strcmp(av[i], "--simple"))
option->mode = 1;
else if (!ft_strcmp(av[i], "--medium"))
option->mode = 2;
else if (!ft_strcmp(av[i], "--adaptive"))
option->mode = 4;
else if (!ft_strcmp(av[i], "--complex"))
option->mode = 3;
else if (!ft_strcmp(av[i], "--bench"))
option->bench = 1;
else if(!ft_strcmp(av[i], "--count"))
option->bench = 2;
else if (!parse_arg(a, av[i]))
return (0);
i++;
}
return (1);
}