This repository has been archived on 2025-11-15. You can view files and clone it, but cannot push or open issues or pull requests.
push-swap-gero/include/push_swap.h

42 lines
1.6 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* push_swap.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: gechavia <chaviallegeraud@gmail.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/09/04 17:36:00 by gechavia #+# #+# */
/* Updated: 2025/09/04 17:36:26 by gechavia ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef PUSH_SWAP_H
# define PUSH_SWAP_H
# include <unistd.h>
# include <stdlib.h>
# include <limits.h>
typedef struct s_stack
{
int *array;
int size;
int capacity;
} t_stack;
void init_stacks(t_stack *a, t_stack *b);
void error_exit(t_stack *a, t_stack *b);
int parse_and_validate(char **argv, t_stack *a, t_stack *b);
void free_stacks(t_stack *a, t_stack *b);
int has_duplicates(t_stack *a);
void write_op(const char *s);
void normalize_stack(t_stack *a);
void swap(t_stack *s);
void push(t_stack *from, t_stack *to);
void rotate(t_stack *s);
void rrotate(t_stack *s);
void sort_three(t_stack *a);
void sort_five(t_stack *a, t_stack *b);
void sort_stack(t_stack *a, t_stack *b);
#endif