-
Notifications
You must be signed in to change notification settings - Fork 0
/
util_parse_opt.c
36 lines (33 loc) · 1.21 KB
/
util_parse_opt.c
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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* util_parse_opt.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: yongmkim <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/03/23 12:47:03 by yongmkim #+# #+# */
/* Updated: 2022/03/23 12:58:48 by yongmkim ### ########seoul.kr */
/* */
/* ************************************************************************** */
#include "pushswap.h"
int fn_is_argc_end(char **argv, t_parse *parse)
{
if (*argv[parse->argc_idx] == '\0')
{
if (parse->is_find == 0)
{
parse->key = ERROR;
return (0);
}
parse->argc_idx++;
parse->is_find = 0;
return (1);
}
return (0);
}
void fn_mv_atoi_init(t_atoi *info)
{
info->sum = 0;
info->sign = 1;
info->cnt = 0;
}