actions.c \
stack_manipulation.c \
arg_parsing.c \
+ stacks_mem.c \
CHECKSOURCES := $(addprefix $(CHECKSRCDIR)/, $(CHECKSOURCES))
/* By: ljiriste <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/01/24 10:31:06 by ljiriste #+# #+# */
-/* Updated: 2024/02/06 13:19:15 by ljiriste ### ########.fr */
+/* Updated: 2024/02/06 14:21:13 by ljiriste ### ########.fr */
/* */
/* ************************************************************************** */
return (0);
}
-void init_stack(t_stack *s)
-{
- ft_vec_init(&s->stack, sizeof(int));
- s->ind = 0;
- return ;
-}
-
-void free_stack(t_stack *s)
-{
- ft_vec_free(&s->stack, NULL);
- s->ind = 0;
- return ;
-}
-
int is_sorted(t_stack *s)
{
const size_t start_ind = s->ind;
return (1);
}
-void clean_up(t_stacks *s)
-{
- free_stack(&s->a);
- free_stack(&s->b);
- return ;
-}
-
int main(int argc, char **argv)
{
t_stacks s;
/* By: ljiriste <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/01/24 12:13:51 by ljiriste #+# #+# */
-/* Updated: 2024/01/31 09:59:33 by ljiriste ### ########.fr */
+/* Updated: 2024/02/06 14:22:08 by ljiriste ### ########.fr */
/* */
/* ************************************************************************** */
t_target target;
} t_command;
+void init_stack(t_stack *s);
+void clean_up(t_stacks *s);
/*
t_action action_push;
t_action action_swap;
--- /dev/null
+/* ************************************************************************** */
+/* */
+/* ::: :::::::: */
+/* stacks_mem.c :+: :+: :+: */
+/* +:+ +:+ +:+ */
+/* By: ljiriste <marvin@42.fr> +#+ +:+ +#+ */
+/* +#+#+#+#+#+ +#+ */
+/* Created: 2024/02/06 14:20:04 by ljiriste #+# #+# */
+/* Updated: 2024/02/06 14:22:06 by ljiriste ### ########.fr */
+/* */
+/* ************************************************************************** */
+
+#include "checker.h"
+#include "libft.h"
+
+void init_stack(t_stack *s)
+{
+ ft_vec_init(&s->stack, sizeof(int));
+ s->ind = 0;
+ return ;
+}
+
+static void free_stack(t_stack *s)
+{
+ ft_vec_free(&s->stack, NULL);
+ s->ind = 0;
+ return ;
+}
+
+void clean_up(t_stacks *s)
+{
+ free_stack(&s->a);
+ free_stack(&s->b);
+ return ;
+}