aboutsummaryrefslogtreecommitdiff
path: root/include/error.h
blob: 2326d1a4f9119c0bc738b2fc5030605dac7611be (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
/* ************************************************************************** */
/*                                                                            */
/*                                                        :::      ::::::::   */
/*   error.h                                            :+:      :+:    :+:   */
/*                                                    +:+ +:+         +:+     */
/*   By: charles <me@cacharle.xyz>                  +#+  +:+       +#+        */
/*                                                +#+#+#+#+#+   +#+           */
/*   Created: 2020/08/27 20:34:25 by charles           #+#    #+#             */
/*   Updated: 2020/09/10 14:48:42 by charles          ###   ########.fr       */
/*                                                                            */
/* ************************************************************************** */

#ifndef ERROR_H
# define ERROR_H

# include <stdarg.h>
# include "libft_io.h"

/*
** error.c
*/

enum
{
	ERR_NONE = 1024,
	ERR_FATAL,
	ERR_SYNTAX,
	ERR_OPEN,
	ERR_AMBIGUOUS_REDIR,
	ERR_CMD_NOT_FOUND,
	ERR_IS_DIRECTORY,
	ERR_ERRNO,
};

typedef int t_err;

void					errorf(const char *format, ...);
void					verrorf(const char *format, va_list ap);
void					error_set_status(int status);
int						error_get_status(int status);

#endif