Example #1
0
void	ft_del_tree(t_btree **current)
{
	if ((*current)->left)
		ft_del_tree(&(*current)->left);
	if ((*current)->right)
		ft_del_tree(&(*current)->right);
	ft_del_node(current);
}
Example #2
0
void	ft_del_htab(t_btree **hash_tab)
{
	int			i;

	i = 0;
	while (i < TAB_SIZE)
	{
		if (hash_tab[i])
			ft_del_tree(&hash_tab[i]);
		i++;
	}
}
Example #3
0
void	ft_go(char ***env)
{
	char	*tmp;
	char	**path;
	t_list	*arg;
	t_tree	*tree;

	if (!(tmp = ft_getenv("PATH", *env)))
		path = ft_path();
	else
		path = ft_strsplit(tmp, ':');
	if ((arg = ft_parser(g_e.buff))
			&& (tree = ft_make_tree(arg)))
	{
		ft_exec(tree, path, env);
		ft_del_tree(tree);
	}
	ft_tabdel(path);
	free(path);
}