MushOS
0.1
A UNIX-like OS prototype, written from scratch
Loading...
Searching...
No Matches
exceptions.h
1
#ifndef MUSHLIB_EXCEPTIONS_H
2
#define MUSHLIB_EXCEPTIONS_H
3
4
#include "generic.h"
5
6
7
typedef
struct
{
8
u_byte id;
9
string
type;
10
string
message;
11
string
file;
12
u_dword line;
13
}
exception
;
14
15
typedef
void (*exception_handler)(
exception
exc);
16
17
void
throw_exception(
exception
exc);
18
void
handle_exceptions(u_byte
id
, exception_handler);
19
20
void
terminate(u_byte code);
21
22
#define throw_verbose(id, type, message) {\
23
exception exc = {id, type, message, __FILE__, __LINE__};\
24
throw_exception(exc);\
25
}
26
27
#define throw_typed(id, type) throw_verbose(id, type, nullptr)
28
29
#define throw(id) throw_typed(id, nullptr)
30
31
#endif
// MUSHLIB_EXCEPTIONS_H
exception
Definition:
exceptions.h:7
lib
base
exceptions.h
Generated on Sun Jan 29 2023 13:48:02 for MushOS by
1.9.5