-
Notifications
You must be signed in to change notification settings - Fork 0
/
error.h
47 lines (38 loc) · 1 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
/*
* Project: Compiler for imperative programing language IFJ20
*
* File: error.h
* Brief: Header file for error.c
*
* Authors: Hladký Tomáš xhladk15@stud.fit.vutbr.cz
* Kostolányi Adam xkosto04@stud.fit.vutbr.cz
* Makiš Jozef xmakis00@stud.fit.vutbr.cz
* Bartko Jakub xbartk07@stud.fit.vutbr.cz
*/
#ifndef ERROR_H
#define ERROR_H
/*
Function error
--------------
Prints error message
file: name of FILE in which the error was encounteres
func: name of FUNCTION ...
msg, ...: custom message & its formatting
returns:
-----------------
Example of usage:
const char input[] = "Hello Wrld";
error(99, "code.c", "foo", "Invalid input: %s", input);
Output:
ERROR:0 Internal compiler error (compiler's fault) -- with exit code 99
code.c: foo:
Invalid input: Hello Wrld
*/
void error(
int errCode,
const char * file,
const char * func,
const char * msg, ...
);
const char * code_to_name(int);
#endif