rework of checker parser to accomodate for string arguments update of libft debuged push & pop functions still need to check for overflow arg
55 lines
1.7 KiB
C
55 lines
1.7 KiB
C
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* push_swap.h :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: tmaze <tmaze@student.42.fr> +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2019/02/21 14:13:53 by tmaze #+# #+# */
|
|
/* Updated: 2019/02/25 15:57: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);
|
|
|
|
#endif
|