-
Notifications
You must be signed in to change notification settings - Fork 0
/
push_swap.h
75 lines (69 loc) · 2.52 KB
/
push_swap.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* push_swap.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: zwalad <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/02/28 16:22:47 by zwalad #+# #+# */
/* Updated: 2022/03/23 21:40:38 by zwalad ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef PUSH_SWAP_H
# define PUSH_SWAP_H
# include <unistd.h>
# include <stdio.h>
# include <stdlib.h>
# include "ft_printf/ft_printf.h"
typedef struct t_swap
{
int stack;
struct t_swap *next;
}t_swap;
typedef struct t_stacks
{
t_swap *a;
t_swap *b;
int *tab;
int arg;
}t_stacks;
size_t ps_strlen(char *s);
int ps_atoi(char *str);
void check_dup(char *argv[], int j);
void ps_lstadd_back(t_swap *lst, t_swap *new);
int ps_lstsize(t_swap *lst);
t_swap *ps_lstlast(t_swap *lst);
t_swap *ps_lstnew(int content);
t_swap *ps_lstadd_front(t_swap *lst, t_swap *new);
t_swap *swap_a(t_swap *a);
t_swap *swap_b(t_swap *b);
t_stacks *swap_ab(t_stacks *p);
t_swap *push_b(t_stacks *p);
t_swap *push_a(t_stacks *p);
t_swap *rotate_a(t_swap *a);
t_swap *rotate_b(t_swap *b);
t_stacks *rotate_ab(t_stacks *p);
t_swap *r_rotate_a(t_swap *a);
t_swap *r_rotate_b(t_swap *b);
t_stacks *r_rotate_ab(t_stacks *p);
t_swap *sub_three(t_swap *a);
t_stacks *stack_init(t_stacks *p, char *argv[], int argc, int i);
int le_index(int i, t_swap *a);
char **ps_split(char *s, char c);
int low_find(t_swap *a);
t_swap *push_three(t_swap *a);
t_stacks *push_five2(t_stacks *p);
t_stacks *push_five(t_stacks *p, int i);
int check_sorted(t_stacks *p, int argc);
void herror(int i);
int ps_isdigit(char c);
int le_len(t_swap *a);
t_stacks *sort_tab(t_stacks *p);
void ps_looot(t_stacks *p);
t_stacks *get_lower(t_stacks *p, int low);
t_swap *get_highest(t_swap *b, int i);
t_stacks *ps_indixing(t_stacks *p);
t_stacks *fix_zsh(char **av, t_stacks *p);
char *ps_substr(char *s, unsigned int start, size_t len);
t_stacks *mini_main(t_stacks *p, int argc, char *argv[]);
#endif