static int ft_st_resize(int *ac, t_choice ***ch, int **ps, t_putmenu **s) { int ret; ret = 0; if (*ch == NULL) { if (*s == NULL) ft_st_signal(0); *ac = (*s)->argc; *ps = (*s)->pos; *ch = (*s)->choice; ft_st_clear(); ret = 1; } else { if (*s == NULL && (ret = 1)) *s = (t_putmenu *)malloc(sizeof(t_putmenu)); (*s)->argc = *ac; (*s)->pos = *ps; (*s)->choice = *ch; } return (ret); }
static void ft_st_getkey_debug(char *str) { if (DEBUG) { ft_printf("-[%d:%d:%d:%d]-", str[0], str[1], str[2], str[3]); ft_st_signal(0); } return ; }
void ft_st_putcirc(int argc, t_choice **choice, int *pos, int key) { int leny; static t_putmenu *size; ft_st_caption(0, 1); ft_st_resize(&argc, &choice, &pos, &size); if ((*choice)->str == NULL) ft_st_signal(1); ft_st_color(NULL, key, 0, 0); leny = ft_st_termsize(1); ft_st_check(argc, key, choice, pos); if (ft_st_decal(argc, leny)) { ft_st_putmenu(argc, choice, *pos, key); return ; } ft_st_style(argc, choice, *pos); ft_st_caption(key, 0); return ; }