functions standardisees, annotees et readme en cours decriture
This commit is contained in:
74
includes/push_swap.h
Normal file
74
includes/push_swap.h
Normal file
@@ -0,0 +1,74 @@
|
||||
|
||||
#ifndef PUSH_SWAP_H
|
||||
# define PUSH_SWAP_H
|
||||
# include "../libft/includes/libft.h"
|
||||
# include <unistd.h> // read(), write(), sleep()
|
||||
# include <stdlib.h> // malloc(), free(), exit(), atoi()
|
||||
|
||||
|
||||
typedef struct s_stack
|
||||
{
|
||||
int n;
|
||||
struct s_stack *next;
|
||||
} t_stack;
|
||||
|
||||
/*
|
||||
** luke's algo
|
||||
*/
|
||||
int bubble_sort(t_stack **a, t_stack **b, t_list *solution);
|
||||
|
||||
/*
|
||||
** pushswap.c
|
||||
*/
|
||||
int check_flag(int *ac, char ***av);
|
||||
void is_valid(int ac, char **av);
|
||||
t_stack *init_stack(int ac, char **av);
|
||||
t_list *launch_algo(t_stack *stack);
|
||||
|
||||
/*
|
||||
** stop.c
|
||||
*/
|
||||
void ps_usage(void);
|
||||
void ps_error(int i);
|
||||
void ps_stop(t_stack *a, t_stack *b, t_list *lst, int i);
|
||||
|
||||
/*
|
||||
** algo.c
|
||||
*/
|
||||
void hugo_sort(t_stack **a, t_stack **b, t_list **lst);
|
||||
|
||||
/*
|
||||
** print.c
|
||||
*/
|
||||
void fill_solution(t_stack *a, t_stack *b, t_list **lst, char *c);
|
||||
void print_result(t_list *lst, int i);
|
||||
|
||||
|
||||
/*
|
||||
** swap
|
||||
*/
|
||||
t_list *sa(t_stack **stack, t_list **lst);
|
||||
t_list *sb(t_stack **stack, t_list **lst);
|
||||
t_list *ss(t_stack **a, t_stack **b, t_list **lst);
|
||||
|
||||
/*
|
||||
** push
|
||||
*/
|
||||
t_list *pa(t_stack **dst, t_stack **src, t_list **lst);
|
||||
t_list *pb(t_stack **dst, t_stack **src, t_list **lst);
|
||||
|
||||
/*
|
||||
** rotate
|
||||
*/
|
||||
t_list *ra(t_stack **stack, t_list **lst);
|
||||
t_list *rb(t_stack **stack, t_list **lst);
|
||||
t_list *rr(t_stack **a, t_stack **b, t_list **lst);
|
||||
|
||||
/*
|
||||
** reverse rotate
|
||||
*/
|
||||
t_list *rra(t_stack **stack, t_list **lst);
|
||||
t_list *rrb(t_stack **stack, t_list **lst);
|
||||
t_list *rrr(t_stack **a, t_stack **b, t_list **lst);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user