Exemple #1
0
void	ft_l(t_steve *list, t_opts *opt)
{
	int		total;
	t_steve	*tmp;
	t_size	*space;

	total = 0;
	space = NULL;
	if (ft_ls_l(list) == 0)
	{
		tmp = list;
		while (tmp != NULL)
		{
			total = total + tmp->block;
			tmp = tmp->next;
		}
		free(tmp);
		ft_putstr("total ");
		ft_putnbr(total);
		write(1, "\n", 1);
		ft_init_space(list, &space);
		ft_add_ls_l(list, opt, space);
	}
	while (list != NULL)
		list = list->next;
}
Exemple #2
0
int		main(int argc, char **argv)
{
	t_env		e;

	e.mlx = mlx_init();
	if (e.mlx == NULL)
		return (0);
	e.win = mlx_new_window(e.mlx, 2400, 1300, "Fil de Fer");
	if (e.win == NULL)
		return (0);
	e.im = mlx_new_image(e.mlx, 2400, 1300);
	e.imb = mlx_new_image(e.mlx, 2400, 1300);
	e.x = 0;
	e.y = 0;
	e.map = NULL;
	ft_init_space(argc, argv, &e);
	mlx_key_hook(e.win, key_hook, &e);
	mlx_expose_hook(e.win, expose_hook, &e);
	mlx_loop(e.mlx);
	return (0);
}