Exemple #1
0
static EngineState
default_command(Command* cmd) {
    CmdData *cd = get_cmd_data(cmd);
    switch (lookup_command(cd->tag)) {
    case TRANSFORM_CMD:
        // for now let's assume we've been handed something
        // which should should be 'returned' from transform
        process_cmd(cd);
    }
    return Ok;
};
Exemple #2
0
int		parsexec(char *cmd, t_shell *shell)
{
	int		ret;
	t_cmd	*cmd_data;
	t_tree	*cmd_tree;

	g_is_a_term = 0;
	if ((cmd = add_some_space(cmd)) == NULL
		|| (cmd_data = get_cmd_data(cmd)) == NULL)
		return (-1);
	lexing(cmd_data);
	if ((ret = replace_var(cmd_data, shell)) != -1
		&& ret != -2 && parsing(cmd_data))
	{
		if ((cmd_tree = get_tree(cmd_data)) == NULL
			|| exec_tree(cmd_tree, shell) == -1)
			return (-1);
		clean_memory(cmd_tree, cmd_data, cmd);
	}
	return (ret);
}