Beispiel #1
0
static t_lexer		*add_pipe_ncmd(t_lexer *node, t_parse *tree)
{
	char		**tab;
	t_inst		*last_inst;

	if (node->next->type == CMD)
		tab = ft_strsplitspace(node->next->str);
	else
		tab = ft_strsplit(node->next->str, '\0');
	last_inst = find_last_inst(tree);
	last_inst->next = init_inst(NULL);
	last_inst->next->prev = last_inst;
	last_inst->next->arg = tab;
	return (node->next->next);
}
Beispiel #2
0
void		add_info(t_env *e, t_lex *lex)
{
	t_lex	*tmp;
	char	**tab;

	tmp = lex->next;
	while (tmp && (tmp->str)[0] != '#')
	{
		tab = ft_strsplitspace(tmp->str);
		if (!ft_strcmp(tab[0], "width"))
			e->width = ft_atoi(tab[1]);
		else if (!ft_strcmp(tab[0], "height"))
			e->height = ft_atoi(tab[1]);
		else if (!ft_strcmp(tab[0], "focal"))
			e->focal = ft_atoi(tab[1]);
		else if (!ft_strcmp(tab[0], "color"))
			e->color = ft_hextoi(tab[1]);
		ft_tabfree(&tab);
		tmp = tmp->next;
	}
}