blob: eb94c9f6bc2365d4c0d49e78282575593909206c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* error.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/01/11 13:33:14 by cacharle #+# #+# */
/* Updated: 2020/01/11 13:34:18 by cacharle ### ########.fr */
/* */
/* ************************************************************************** */
#include "cub3d.h"
void error_put_usage_exit(char *name)
{
ft_putstr_fd(name, STDERR_FILENO);
ft_putendl_fd(": missing file operand", STDERR_FILENO);
ft_putstr_fd("Usage: ", STDERR_FILENO);
ft_putstr_fd(name, STDERR_FILENO);
ft_putendl_fd(" [.cub file] [--save]", STDERR_FILENO);
exit(EXIT_FAILURE);
}
void error_put(char *message)
{
ft_putstr("Error\nCouldnt ");
ft_putendl(message);
}
void *error_put_return(char *message)
{
error_put(message);
return (NULL);
}
void *error_put_return_state_destroy(char *message, t_state *state)
{
state_destroy(state);
return (error_put_return(message));
}
void *error_put_return_lines_state_destroy(
char *message, t_state *state, char **lines)
{
helper_free_splited(lines);
return (error_put_return_state_destroy(message, state));
}
|