libmya 0.1.0
Library to parse Mya language.
Loading...
Searching...
No Matches
err.h File Reference
#include "colors.h"
Include dependency graph for err.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define ERR_CTX_SIZE   3
 
#define ERR_CTX_LINE_WRAP   80
 
#define ERR_PREFIX   C_RED "Error" C_NORMAL ": "
 
#define ERROR_IF(expr, then)
 
#define ERROR_RET(expr)
 
#define ERROR_BREAK(expr)
 

Typedefs

typedef enum error_code error_code_t
 Enumeration of error codes.
 

Enumerations

enum  error_code {
  ERR_OK = 0 ,
  ERR_EMPTY ,
  ERR_FILE_NOT_FOUND ,
  ERR_INVALID_INDEX ,
  ERR_MAX_SIZE_EXCEEDED
}
 Enumeration of error codes. More...
 

Macro Definition Documentation

◆ ERR_CTX_LINE_WRAP

#define ERR_CTX_LINE_WRAP   80

Definition at line 6 of file err.h.

◆ ERR_CTX_SIZE

#define ERR_CTX_SIZE   3

Definition at line 5 of file err.h.

◆ ERR_PREFIX

#define ERR_PREFIX   C_RED "Error" C_NORMAL ": "

Definition at line 8 of file err.h.

◆ ERROR_BREAK

#define ERROR_BREAK ( expr)
Value:
ERROR_IF(expr, break)
#define ERROR_IF(expr, then)
Definition err.h:22

Definition at line 31 of file err.h.

◆ ERROR_IF

#define ERROR_IF ( expr,
then )
Value:
{ \
error_code_t _err; \
if ((_err = (expr)) != ERR_OK) { \
then; \
} \
}
enum error_code error_code_t
Enumeration of error codes.
@ ERR_OK
Definition err.h:15

Definition at line 22 of file err.h.

22#define ERROR_IF(expr, then) \
23 { \
24 error_code_t _err; \
25 if ((_err = (expr)) != ERR_OK) { \
26 then; \
27 } \
28 }

◆ ERROR_RET

#define ERROR_RET ( expr)
Value:
ERROR_IF(expr, return _err)

Definition at line 30 of file err.h.

Typedef Documentation

◆ error_code_t

typedef enum error_code error_code_t

Enumeration of error codes.

Enumeration Type Documentation

◆ error_code

enum error_code

Enumeration of error codes.

Enumerator
ERR_OK 
ERR_EMPTY 
ERR_FILE_NOT_FOUND 
ERR_INVALID_INDEX 
ERR_MAX_SIZE_EXCEEDED 

Definition at line 13 of file err.h.

14{
15 ERR_OK = 0,
@ ERR_FILE_NOT_FOUND
Definition err.h:17
@ ERR_INVALID_INDEX
Definition err.h:18
@ ERR_EMPTY
Definition err.h:16
@ ERR_MAX_SIZE_EXCEEDED
Definition err.h:19