ft_select.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /* ************************************************************************** */
  2. /* */
  3. /* ::: :::::::: */
  4. /* ft_select.h :+: :+: :+: */
  5. /* +:+ +:+ +:+ */
  6. /* By: bchanot <bchanot@students.42.fr> +#+ +:+ +#+ */
  7. /* +#+#+#+#+#+ +#+ */
  8. /* Created: 2016/11/02 07:00:23 by bchanot #+# #+# */
  9. /* Updated: 2016/11/08 11:19:56 by bchanot ### ########.fr */
  10. /* */
  11. /* ************************************************************************** */
  12. #ifndef FT_SELECT_H
  13. # define FT_SELECT_H
  14. # define ESCAPE 0x1B
  15. # define SPACE 0x20
  16. # define UP 0x415B1B
  17. # define DOWN 0x425B1B
  18. # define RIGHT 0x435B1B
  19. # define LEFT 0x445B1B
  20. # define ENTER 0xA
  21. # define BACKSPACE 0x7E335B1B
  22. # define DELETE 0x7F
  23. # include "../libft/includes/libft.h"
  24. # include <termios.h>
  25. typedef struct s_inf
  26. {
  27. struct termios term;
  28. char **args;
  29. int *selected;
  30. int nb;
  31. int cur;
  32. } t_inf;
  33. int sl_launch_loop(t_inf *inf);
  34. void sl_init_inf(int ac, char **av, t_inf *inf);
  35. void sl_init_term(t_inf *inf);
  36. void sl_display_screen(t_inf *inf);
  37. t_inf *sl_set_inf(t_inf *inf);
  38. void sl_set_signal(void);
  39. void sl_exit(char *str, t_inf *inf, int bool);
  40. #endif