Example #1
0
File: main.c Project: Nquere/select
int				main(int ac, char **av)
{
	char			buffer[2048];
	struct termios	t;
	char			read_char[5];
	t_l				*l;

	*read_char = 0;
	l = NULL;
	if (tgetent(buffer, getenv("TERM")) < 1)
		return (-1);
	term_no_canon(t);
	tputs(tgetstr("ti", NULL), 1, ft_int_putchar);
	tputs(tgetstr("vi", NULL), 1, ft_int_putchar);
	if ((l = (t_l *)malloc(sizeof(t_l))) == NULL)
		return (-1);
	ft_init_list(l);
	display_list(l, ac, av);
	tputs(tgetstr("ks", NULL), 1, ft_int_putchar);
	read_keys(read_char);
	tputs(tgetstr("ke", NULL), 1, ft_int_putchar);
	tputs(tgetstr("ve", NULL), 1, ft_int_putchar);
	tputs(tgetstr("te", NULL), 1, ft_int_putchar);
	term_canon(t);
	return (0);
}
Example #2
0
void shellout_wait_ret(void)
{
#ifdef FANCY_TERM
	if(term_canon(0)){
		int unget;

		fprintf(stderr, "any key to continue...");
		/* use getch() so we don't go behind ncurses' back */
		while((unget = getch()) == -1);
		term_canon(1);
		fputc('\n', stderr);
		ungetch(unget);
	}else{
#endif
		fprintf(stderr, "enter to continue...");
		for(;;){
			int c = getchar();
			if(c == EOF || c == '\n')
				break;
		}
#ifdef FANCY_TERM
	}
#endif
}