-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patherror.h
52 lines (46 loc) · 1.44 KB
/
error.h
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
43
44
45
46
47
48
49
50
51
52
/*********************************************
* Program : error.h
* Authors : Roman Dobiáš - xdobia11
* Adrián Tomašov - xtomas32
* Jozef Urbanovský - xurban66
* Adam Šulc - xsulca00
* Kristián Barna - xbarna02
* Skupina : 2BIB(2016)
* Created : 01.10.2016
* Compiled: gcc 4.9.2
* Project : IFJ16
*
* Notes : Definition of error module
********************************************/
// Have a look at page no.2 of assignment
enum errorTypes
{
// it's ok
SUCCESS_ERROR = 0,
// Lex. error (bad float format)
LEXICAL_ERROR = 1,
// Syntax error (violation of syntax rules)
SYNTAX_ERROR = 2,
// Undefined class/function/var, reinitialization of class, etc.
SEMANTIC_ERROR = 3,
// Semantic incompatibility of types (function parameters, function values)
SEMANTIC_TYPE_ERROR = 4,
// The rest
SEMANTIC_ERROR_REST = 6,
// Error occured during IO operation with built-in func. readDouble(), etc.
RUNTIME_READ_ERROR = 7,
// Work with uninitialized variable
RUNTIME_UNINITIALIZED = 8,
// Null division
RUNTIME_NULLDIVISION = 9,
// The rest of run-times
RUNTIME_ERROR = 10,
// Internal error (malloc failure,etc)
INTERNAL_ERROR = 99
};
// Call module dtors
void clean_up();
// Leave the process with error 'errtype'
void errorLeave(int errtype);
// Error and die with code
void error_and_die(enum errorTypes type, const char *fmt, ...);