Esempio n. 1
0
File: main.c Progetto: Strade288/42
int		main(int argc, char **argv)
{
	t_lst	*a;

	a = NULL;
	if (argc < 2)
		error();
	while (argc > 1)
		lst_pushfront(&a, lst_new(ft_atoi(argv[--argc])));
	a = sort(a);
	write(1, "\b\n", 2);
	lst_del(a);
	return (0);
}
Esempio n. 2
0
void		input_handler(LP **first, INF *infos, LP **curr, char *buf)
{
	if (BUFFER == UP_KEY || BUFFER == DOWN_KEY || BUFFER == LEFT_KEY ||
		BUFFER == RIGHT_KEY)
		lst_move(curr, first, buf);
	else if ((BUFFER > 96 && BUFFER < 123) || (infos->search &&
		(BUFFER == RET_KEY || BUFFER == DEL_KEY)))
		search(curr, infos, buf);
	else if (BUFFER == SPACE_KEY)
		select_entry(curr, infos);
	else if (BUFFER == SUP_KEY)
		lst_del(first, curr);
	else if (BUFFER == RET_KEY || BUFFER == ESC_KEY)
		exit_print(buf);
	infos->curr_page = (*curr)->page;
}