i hate mondays

rework of checker parser to accomodate for string arguments
update of libft
debuged push & pop functions
still need to check for overflow arg
This commit is contained in:
Tanguy MAZE
2019-02-25 17:42:47 +01:00
parent 62764dc5e7
commit 7a2037c046
6 changed files with 64 additions and 55 deletions

View File

@@ -6,7 +6,7 @@
/* By: tmaze <tmaze@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/02/22 14:41:27 by tmaze #+# #+# */
/* Updated: 2019/02/24 17:41:40 by tmaze ### ########.fr */
/* Updated: 2019/02/25 15:11:44 by tmaze ### ########.fr */
/* */
/* ************************************************************************** */
@@ -41,9 +41,7 @@ void ps_stkpsh(t_psdata *data, char c, t_stack *new)
s = &(data->b);
if (c == 'b')
size = data->size_b;
if (s != NULL && *s == NULL && (size++))
*s = new;
else if (s != NULL && *s != NULL)
if (s != NULL)
{
ind = *s;
*s = new;
@@ -89,21 +87,9 @@ void ps_stkclean(t_psdata *data)
{
t_stack *tmp;
tmp = data->a;
while (data->a != NULL)
{
tmp = data->a;
data->a = data->a->next;
while ((tmp = ps_stkpop(data, 'a')) != NULL)
ft_memdel((void**)&tmp);
data->size_a--;
}
tmp = data->b;
while (data->b != NULL)
{
tmp = data->b;
data->b = data->b->next;
while ((tmp = ps_stkpop(data, 'b')) != NULL)
ft_memdel((void**)&tmp);
data->size_b--;
}
ft_lstdel(&(data->op), &ft_lstdelstr);
}