push_swap/includes/push_swap.h
Tanguy MAZE beba6ce86f lazy week-end stuff B)
started conversion of functions to data structure system
still WIP
added first iteration of int parser
does not check for int overflow
2019-02-23 18:35:46 +01:00

49 lines
1.6 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* push_swap.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: tmaze <tmaze@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/02/21 14:13:53 by tmaze #+# #+# */
/* Updated: 2019/02/23 15:46:05 by tmaze ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef PUSH_SWAP_H
# define PUSH_SWAP_H
# include <stdlib.h>
# include <unistd.h>
# include "libft.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;
t_stack *ps_stknew(int nb);
void *ps_stkpsh(t_stack **s, t_stack *new);
t_stack *ps_stkpop(t_stack **s);
void ps_stkclean(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_stack **s);
void ps_rrerot(t_stack **a, t_stack **b);
#endif