lastest
This commit is contained in:
parent
3c4dbf912b
commit
1b2796bdaf
@ -6,7 +6,7 @@
|
||||
/* By: tmaze <tmaze@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2019/02/21 14:13:53 by tmaze #+# #+# */
|
||||
/* Updated: 2019/03/16 13:32:59 by tmaze ### ########.fr */
|
||||
/* Updated: 2019/03/20 12:24:09 by tmaze ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -51,7 +51,7 @@ void ps_rrerot(t_psdata *data);
|
||||
int is_op(char *buff);
|
||||
t_list *add_op(t_psdata *data, char *op);
|
||||
int get_params(t_psdata *data, int ac, char **av, int viz);
|
||||
int check_input(char *in, int *ret);
|
||||
int check_input(t_psdata *data, char *in, int *ret);
|
||||
|
||||
void mark_groups(t_psdata *data);
|
||||
t_stack *get_last_a(t_psdata *data);
|
||||
|
@ -6,7 +6,7 @@
|
||||
/* By: tmaze <tmaze@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2019/02/23 13:35:15 by tmaze #+# #+# */
|
||||
/* Updated: 2019/03/19 16:44:06 by tmaze ### ########.fr */
|
||||
/* Updated: 2019/03/20 12:26:46 by tmaze ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
/* By: tmaze <tmaze@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2019/02/25 12:44:08 by tmaze #+# #+# */
|
||||
/* Updated: 2019/03/18 15:13:10 by tmaze ### ########.fr */
|
||||
/* Updated: 2019/03/20 12:27:42 by tmaze ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -22,9 +22,10 @@ void ps_initdata(t_psdata *data)
|
||||
data->viz = '\0';
|
||||
}
|
||||
|
||||
int check_input(char *in, int *ret)
|
||||
int check_input(t_psdata *data, char *in, int *ret)
|
||||
{
|
||||
int i;
|
||||
t_stack *ptr;
|
||||
|
||||
i = 0;
|
||||
if (in[i] && ft_issign(in[i]))
|
||||
@ -32,7 +33,16 @@ int check_input(char *in, int *ret)
|
||||
while (in[i] && ft_isdigit(in[i]))
|
||||
i++;
|
||||
if (in[i] == '\0' && ft_hasdigit(in) && ft_atois(in, ret))
|
||||
{
|
||||
ptr = data->a;
|
||||
while (ptr)
|
||||
{
|
||||
if (*ret == ptr->nb)
|
||||
return (0);
|
||||
ptr = ptr->next;
|
||||
}
|
||||
return (1);
|
||||
}
|
||||
return (0);
|
||||
}
|
||||
|
||||
@ -48,7 +58,7 @@ int get_params(t_psdata *data, int ac, char **av, int viz)
|
||||
{
|
||||
if (i == 1 && viz && ft_strcmp(av[i], "-v") == 0)
|
||||
data->viz = 'a';
|
||||
else if (check_input(av[i], &nb) && (new = ps_stknew(nb)) != NULL)
|
||||
else if (check_input(data, av[i], &nb) && (new = ps_stknew(nb)) != NULL)
|
||||
{
|
||||
new->ind = 0;
|
||||
ps_stkpsh(data, 'a', new);
|
||||
@ -60,7 +70,7 @@ int get_params(t_psdata *data, int ac, char **av, int viz)
|
||||
return (0);
|
||||
}
|
||||
}
|
||||
return (1);
|
||||
return (ac != 1);
|
||||
}
|
||||
|
||||
int is_op(char *buff)
|
||||
|
Loading…
x
Reference in New Issue
Block a user