simplified error output

This commit is contained in:
hugogogo
2026-05-06 15:58:31 +02:00
parent 7f06d505d1
commit 8a479c3c3b
6 changed files with 27 additions and 61 deletions

View File

@@ -7,6 +7,8 @@
#include <stdio.h> // tmp for printf, for float debug
#include <stdarg.h> // for va_list
#include <stdbool.h>
#include <errno.h> // for errno
#include <string.h> // for strerror
/** * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* COMPUTORV1.C
@@ -96,22 +98,8 @@ void reduce(s_term *terms, double *polynom);
* UTILS/ERRORS.C
*/
typedef enum
{
ERROR_BASE = 1, // start at 1 to avoid exit(0) for errors
ARGUMENTS_ERROR,
ERROR_TOKEN_COUNT,
ERROR_UNKNOWN_TOKEN,
ERROR_NUMBER_TOO_BIG,
ERROR_PARSING,
ERROR_TERM_COUNT,
ERROR_TOKEN_POSITION,
ERROR_VAR_DIFF,
ERROR_SENTINEL, // last token not used, only for enum count
} e_program_error;
void print_state();
int stop_errors(e_program_error err, const char *format, ...);
int stop_errors(const char *format, ...);
/** * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* UTILS/PRINT_ENUMS.C