Repository navigation
Expand file tree
/
Copy patherror_args.c
More file actions
35 lines (32 loc) · 1.49 KB
/
Copy patherror_args.c
File metadata and controls
35 lines (32 loc) · 1.49 KB
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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* error_args.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: eblackbu <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/05/03 13:58:51 by eblackbu #+# #+# */
/* Updated: 2020/05/03 13:58:53 by eblackbu ### ########.fr */
/* */
/* ************************************************************************** */
#include "asm.h"
void print_error_with_arg(char *str, int num_arg)
{
ft_printf_error(str);
ft_putnbr(num_arg);
ft_putchar('\n');
}
void error_args(int code, int num_arg)
{
if (code == ERR_INV_TYPE)
print_error_with_arg("invalid type of argument ", num_arg);
if (code == ERR_COUNT_ARGS)
ft_printf_error("invalid count of arguments\n");
if (code == ERR_INV_ARG)
print_error_with_arg("invalid argument ", num_arg);
if (code == ERR_UNKNOWN_LABEL)
print_error_with_arg("unknown label in argument ", num_arg);
if (code == ERR_INV_REG)
print_error_with_arg("invalid number of registry, argument ", num_arg);
exit(-1);
}