Пример #1
0
static int		ft_key_hook_2(int keycode, t_env *env)
{
	if (keycode == PUP)
		env->f.iter_max += 10;
	else if (keycode == PDOWN)
		env->f.iter_max -= 10;
	else if (keycode == Z)
		env->f.color = 1;
	else if (keycode == X)
		env->f.color = 2;
	else if (keycode == R)
		ft_reset(env);
	else
		ft_change(env, keycode);
	return (0);
}
Пример #2
0
int		ft_mainbis(t_ints a, t_tab pn, char *av)
{
	char	buffer;
	int		c;

	c = 1;
	if (ft_strcmp(av, "-C") == 0)
		c = 0;
	while (read(a.fd, &buffer, 1) != 0)
	{
		pn.next[a.c16] = buffer;
		a.c16++;
		a.ctt++;
		if (a.c16 == 16)
		{
			a.star = ft_print(pn, a.ctt - a.c16, a.star, c);
			a.c16 = 0;
			pn = ft_change(pn);
		}
	}
	if (pn.next[0] != '\0')
		ft_print(pn, a.ctt - a.c16, 0, c);
	return (a.ctt);
}