libmya 0.1.0
Library to parse Mya language.
Loading...
Searching...
No Matches
err.h
Go to the documentation of this file.
1#pragma once
2
3#include "colors.h"
4
5#define ERR_CTX_SIZE 3
6#define ERR_CTX_LINE_WRAP 80
7
8#define ERR_PREFIX C_RED "Error" C_NORMAL ": "
9
21
22#define ERROR_IF(expr, then) \
23 { \
24 error_code_t _err; \
25 if ((_err = (expr)) != ERR_OK) { \
26 then; \
27 } \
28 }
29
30#define ERROR_RET(expr) ERROR_IF(expr, return _err)
31#define ERROR_BREAK(expr) ERROR_IF(expr, break)
enum error_code error_code_t
Enumeration of error codes.
error_code
Enumeration of error codes.
Definition err.h:14
@ ERR_FILE_NOT_FOUND
Definition err.h:17
@ ERR_INVALID_INDEX
Definition err.h:18
@ ERR_OK
Definition err.h:15
@ ERR_EMPTY
Definition err.h:16
@ ERR_MAX_SIZE_EXCEEDED
Definition err.h:19