Exemplo n.º 1
0
void		ft_prompt(t_env *env, int change)
{
	char	*pwd;

	if (change)
		pwd = ft_set_pwd(env);
	else
		pwd = ft_set_var(env, "PWD");
	ft_putstr_color(pwd, GREEN, 1);
	ft_putstr_color("$>", RED, 0);
}
Exemplo n.º 2
0
void			print_help(void)
{
	ft_putendl("Usage : ./rtv1 [options]");
	ft_putendl_color("Available options :", TERM_BLACK);
	ft_putstr_color("-v,      	:   ", TERM_BLACK);
	ft_putendl_color("display rays and scene infos", TERM_BLACK);
	ft_putstr_color("-V   		:   ", TERM_BLACK);
	ft_putendl_color("display only rays infos", TERM_BLACK);
	ft_putstr_color("-s1 -s2 -s3   	:   ", TERM_BLACK);
	ft_putendl_color("load defaults scenes", TERM_BLACK);
}
Exemplo n.º 3
0
void	error(int error, int send_perror, char *str)
{
	if (send_perror == 1)
	{
		ft_putstr_color("Error \x1B[0m: ", RED);
		perror("");
	}
	else
	{
		ft_putstr_color("Error", RED);
		ft_putstr(" : ");
		ft_putendl(str);
	}
	exit(error);
}
Exemplo n.º 4
0
void		show_finish(char **map, t_size *size, int win, time_t *t)
{
	int		i;
	int		j;
	time_t	res;
	double	timer;

	res = time(&res);
	timer = difftime(res, *t);
	timer = timer;
	ft_putstr("\033[H\033[2J");
	win = win;
	i = 0;
	j = 0;
	show_column_number(size);
	show_border_line(size, '_');
	while (i < size->h)
    {
		show_beg_of_line(i + 1);
		while (j < size->l)
		{
			show_carac(map[i][j], 0, 1);
			j++;
		}
		ft_putstr("|\n");
		j = 0;
		i++;
	}
	show_border_line(size, '-');
	if (win == 0)
	{
		ft_putstr_color("You win the GAME!\n\n", M2);
		/* ft_putstr("Time taken: ");
		ft_putnbr((int)timer);
		ft_putstr(" seconds.\n");*/
	}
	else
		ft_putstr_color("You lose the GAME... 2 times!\n", M1);
	ft_putstr("Made By Jchichep alias Bueno\n");
	quit();
}
Exemplo n.º 5
0
Arquivo: exit.c Projeto: fdeage/asm
int			exit_asm(t_file *file)
{
	int	leaks;

	ft_putstr_color("TRY EXITING... ", COL_GREEN);
	free_lines(file);
	close(file->fd_s);
	close(file->fd_cor);
	if (file->name_s)
		free(file->name_s);
	if (file->name_cor)
		free(file->name_cor);
	leaks = file->options;
	free(file);
	ft_putstr_color("SUCCESSFUL EXIT!\n", COL_GREEN);
	if ((leaks & T_OPTION_LEAKS) == T_OPTION_LEAKS)
	{
		ft_putstr_color("Leaks mode activated...\n", COL_YELLOW);
		while (42)
			usleep(10000);
	}
	return (EXIT_SUCCESS);
}
Exemplo n.º 6
0
static void	ft_print(int t)
{
	(void)t;
	ft_putstr_color("\n$>", RED, 0);
}