improved errors

This commit is contained in:
hugogogo
2026-05-02 22:30:31 +02:00
parent 3977e6a6bb
commit c24461cb33
4 changed files with 109 additions and 49 deletions

View File

@@ -1,17 +1,17 @@
#ifndef ERRORS_H
#define ERRORS_H
#include "../libft/includes/libft.h"
typedef enum
{
ERROR_BASIC = 0,
ERROR_UNKNOWN_TOKEN = -1,
ERROR_NUMBER_TOO_BIG = -2,
ERROR_PARSING = -3,
ERROR_TOKEN_POSITION = -4,
ERROR_BASE = 1, // Start at 1 to avoid exit(0) for errors
ERROR_UNKNOWN_TOKEN,
ERROR_NUMBER_TOO_BIG,
ERROR_PARSING,
ERROR_TOKEN_POSITION,
ERROR_VAR_DIFF,
ERROR_SENTINEL,
} program_error;
int stop_errors(program_error err, const char *details);
int stop_errors(program_error err, const char *format, ...);
#endif