/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_door.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: gtertysh +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/11/04 05:24:25 by gtertysh #+# #+# */ /* Updated: 2016/11/04 06:11:40 by gtertysh ### ########.fr */ /* */ /* ************************************************************************** */ #include #include "ft_door.h" void ft_putstr(char *str) { while (*str) { write(1, str, 1); str++; } write(1, "\n", 1); } t_bool close_door(t_door *door) { ft_putstr("Door closing..."); door->state = CLOSE; return (TRUE); } t_bool is_door_open(t_door *door) { ft_putstr("Door is open ?"); if (door->state == OPEN) return (TRUE); else return (FALSE); } t_bool is_door_close(t_door *door) { ft_putstr("Door is close ?"); if (door->state == CLOSE) return (TRUE); else return (FALSE); } t_bool open_door(t_door *door) { ft_putstr("Door opening..."); door->state = OPEN; return (TRUE); }