int ctrl_a(int i, char **result) { if (i != 0) { i = 0; replace_cursor(i, ft_strlen(*result)); } return (i); }
char *print_line(char *result, int choice, int i) { clear_line(i, ft_strlen(result)); if (choice == 0) write_cmd(result, 0, 0); else ft_putstr(result); replace_cursor(i, ft_strlen(result)); if (!result[0]) result = NULL; return (result); }
void ft_read_answer(t_cmds *l_cmd, int i) { char read_char[6] = {0}; t_char *l_char; ft_putstr("\n42sh: do you wish to see all ("); ft_putnbr(i); ft_putstr(") possibilities ? [y/n] : "); ft_bzero(read_char, 5); read(0, read_char, 4); if (read_char[0] == 121) { dsp_files2(l_cmd); tputs(tgetstr("ll", NULL), 1, tputs_putchar); tputs(tgetstr("sc", NULL), 1, tputs_putchar); l_char = save_l_char(NULL, 0); ft_print_liste(l_char, NULL); save_lines_print(0, -1); } else replace_cursor(1); }