Exemple #1
0
static void conditional_word_in_line( bool alr_ign,
                                          bool exist_test,
                                              bool (*exist_funct)() )
{
    if ( get_word_in_line( statbuf) )
    {
    	bool cond = FALSE;
	if ( INVERSE( alr_ign) )
	{
	    bool exists = exist_funct( statbuf);
	    cond = BOOLVAL( exists == exist_test);
	}
	conditionally_tokenize( cond, alr_ign );
    }
}
Exemple #2
0
int					exe_funct(char *cmd)
{
	char			**tmp;

	if (!cmd)
		return (-1);
	tmp = ft_split_mult(4, cmd, ' ', '\t', '\n', '\r');
	if (exist_funct(g_tree->funct, tmp[0]))
		command_funct(g_tree->funct, tmp, 0);
	else
	{
		ft_free_array(&tmp);
		return (-1);
	}
	ft_free_array(&tmp);
	return (0);
}