Skip to content

Commit

Permalink
updating pointer caller
Browse files Browse the repository at this point in the history
  • Loading branch information
biralavor committed Jun 6, 2024
1 parent 19ef4c3 commit ef8fc04
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions program_to_test/src/push_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,35 @@
/* By: umeneses <umeneses@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/05/09 18:34:31 by umeneses #+# #+# */
/* Updated: 2024/06/05 12:07:50 by umeneses ### ########.fr */
/* Updated: 2024/06/06 15:15:27 by umeneses ### ########.fr */
/* */
/* ************************************************************************** */

#include "push_swap.h"

int main(int argc, char **argv)
{
t_stack *list;
t_stack *stack_a;
t_stack *stack_b;

if (argc <= 2)
{
ft_error_msg("Not enough arguments. Please provide at leats 2 numbers");
}
list = NULL;
list = ft_lts_buildstack_argv(list, argv);
ft_lst_printf_int_content("testing main list content:", list);
ft_printf("testing main list size: %d\n", ft_lstsize_int((t_list *)list));
if (!ft_is_sorted(list))
stack_a = NULL;
stack_b = NULL;
stack_a = ft_lts_buildstack_argv(&stack_a, argv);
ft_lst_printf_int_content("testing main list content:", stack_a);
ft_printf("testing main list size: %d\n", ft_lstsize_int((t_list *)stack_a));
if (!ft_is_sorted(stack_a))
{
if (ft_lstsize_int((t_list *)list) == 2)
ft_sort_2_nbrs(&list);
if (ft_lstsize_int((t_list *)list) == 3)
ft_sort_3_nbrs(&list);
ft_lst_printf_int_content("updated main list content:", list);
if (ft_lstsize_int((t_list *)stack_a) == 2)
ft_sort_2_nbrs(&stack_a);
if (ft_lstsize_int((t_list *)stack_a) == 3)
ft_sort_3_nbrs(&stack_a);
ft_lst_printf_int_content("updated main list content:", stack_a);
}
ft_lstclear_single_ptr(list);
ft_lstclear_single_ptr(stack_a);
ft_lstclear_single_ptr(stack_b);
return (0);
}

0 comments on commit ef8fc04

Please sign in to comment.