push_swap/includes/push_swap.h
Tanguy MAZE 87261ffddb Nice job for a week-end =)
finished checker programm
tested actions functions
all normed and sexy ;)
2019-03-02 18:28:51 +01:00

59 lines
1.9 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* push_swap.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: tmaze <tmaze@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/02/21 14:13:53 by tmaze #+# #+# */
/* Updated: 2019/03/02 18:21:11 by tmaze ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef PUSH_SWAP_H
# define PUSH_SWAP_H
# include <stdlib.h>
# include <unistd.h>
# include "libft.h"
# include <stdio.h>
typedef struct s_stack
{
int nb;
struct s_stack *next;
} t_stack;
typedef struct s_psdata
{
t_stack *a;
t_stack *b;
size_t size_a;
size_t size_b;
t_list *op;
} t_psdata;
char **ft_strsplitwhitespace(char *s);
int ft_iswhitespace(char c);
t_stack *ps_stknew(int nb);
void ps_stkpsh(t_psdata *data, char c, t_stack *new);
t_stack *ps_stkpop(t_psdata *data, char c);
void ps_stkclean(t_psdata *data);
void ps_initdata(t_psdata *data);
void ps_swap(t_psdata *data, char c);
void ps_sswap(t_psdata *data);
void ps_push(t_psdata *data, char c);
void ps_rot(t_psdata *data, char c);
void ps_rrot(t_psdata *data);
void ps_rerot(t_psdata *data, char c);
void ps_rrerot(t_psdata *data);
int is_op(char *buff);
int get_params(t_psdata *data, int ac, char **av);
int check_input(char *in, int *ret);
#endif