66 lines
2.5 KiB
C
Executable file
66 lines
2.5 KiB
C
Executable file
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* push_swap.h :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2024/03/07 11:11:07 by rparodi #+# #+# */
|
|
/* Updated: 2024/04/18 14:51:13 by rparodi ### ########.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
#ifndef PUSH_SWAP_H
|
|
# define PUSH_SWAP_H
|
|
|
|
# include <unistd.h>
|
|
# include <stdlib.h>
|
|
# include <limits.h>
|
|
|
|
typedef struct s_list
|
|
{
|
|
int value;
|
|
int index;
|
|
struct s_list *next;
|
|
} t_list;
|
|
|
|
int is_sorted(t_list **stack);
|
|
int pa(t_list **stack_a, t_list **stack_b);
|
|
int pb(t_list **stack_a, t_list **stack_b);
|
|
int sa(t_list **stack_a);
|
|
int sb(t_list **stack_b);
|
|
int ss(t_list **stack_a, t_list **stack_b);
|
|
int ra(t_list **stack_a);
|
|
int rb(t_list **stack_b);
|
|
int rr(t_list **stack_a, t_list **stack_b);
|
|
int rra(t_list **stack_a);
|
|
int rrb(t_list **stack_b);
|
|
int rrr(t_list **stack_a, t_list **stack_b);
|
|
int index_distance_head(t_list **stack, int index);
|
|
int ft_isdigit(int c);
|
|
int get_min(t_list **stack, int val);
|
|
int ft_lstsize(t_list *head);
|
|
long ft_atoi(const char *nptr);
|
|
char *ft_strchr(const char *s, int c);
|
|
char *ft_strdup(const char *s);
|
|
char *ft_substr(char const *s, unsigned int start, size_t len);
|
|
char **ft_split(char const *s);
|
|
void free_string(char **str);
|
|
void ft_lstadd_front(t_list **stack, t_list *new);
|
|
void ft_lstadd_back(t_list **stack, t_list *new);
|
|
void *ft_memcpy(void *dest, const void *src, size_t n);
|
|
void free_stack(t_list **stack);
|
|
void index_stack(t_list **stack);
|
|
void error_message(char *msg, t_list **maix, t_list **sb, char **s);
|
|
void check_args(char **argv);
|
|
void sort_3(t_list **stack_a);
|
|
void sort_4(t_list **stack_a, t_list **stack_b);
|
|
void sort_5(t_list **stack_a, t_list **stack_b);
|
|
void simple_sort(t_list **stack_a, t_list **stack_b);
|
|
void radix_sort(t_list **stack_a, t_list **stack_b);
|
|
size_t ft_strlcpy(char *dst, const char *src, size_t size);
|
|
size_t ft_len(const char *str);
|
|
t_list *ft_lstnew(int content);
|
|
t_list *ft_lstlast(t_list *head);
|
|
|
|
#endif
|