Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- typedef struct s_exec
- {
- int value;
- void (*ft_get)(void);
- } t_exec;
- static void ft_exec_cmd(int input)
- {
- int i;
- t_exec ft_ptr[] =
- {
- {DELETE, &ft_del},
- {BACKSPACE, &ft_del},
- {SPACE, &ft_space},
- {UP, &ft_up},
- {DOWN, &ft_down},
- {RIGHT, &ft_right},
- {LEFT, &ft_left},
- {-1, NULL}
- };
- i = 0;
- if (ft_check_window() == 1)
- return ;
- while (ft_ptr[i].value != -1)
- {
- if (ft_ptr[i].value == input)
- ft_ptr[i].ft_get();
- i++;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement