summaryrefslogtreecommitdiffhomepage
path: root/Kernel/KernelKit/HError.hpp
blob: df12641edf40b9f4fa4b3cf449482ee54539a87e (plain)
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
53
54
55
/* -------------------------------------------

	Copyright ZKA Technologies

------------------------------------------- */

#pragma once

#include <NewKit/Defines.hpp>

/// @file HError.hpp
/// @brief Local Process Codes.

#define ErrLocalIsOk()	 (Kernel::ProcessScheduler::The().Leak().TheCurrent().Leak().GetLocalCode() == Kernel::kErrorSuccess)
#define ErrLocalFailed() (Kernel::ProcessScheduler::The().Leak().TheCurrent().Leak().GetLocalCode() != Kernel::kErrorSuccess)
#define ErrLocal()		 Kernel::ProcessScheduler::The().Leak().TheCurrent().Leak().GetLocalCode()

namespace Kernel
{
	typedef Int32 HError;

	inline constexpr HError kErrorSuccess			 = 0;
	inline constexpr HError kErrorExecutable		 = 33;
	inline constexpr HError kErrorExecutableLib		 = 34;
	inline constexpr HError kErrorFileNotFound		 = 35;
	inline constexpr HError kErrorDirectoryNotFound	 = 36;
	inline constexpr HError kErrorDiskReadOnly		 = 37;
	inline constexpr HError kErrorDiskIsFull		 = 38;
	inline constexpr HError kErrorProcessFault		 = 39;
	inline constexpr HError kErrorSocketHangUp		 = 40;
	inline constexpr HError kErrorThreadLocalStorage = 41;
	inline constexpr HError kErrorMath				 = 42;
	inline constexpr HError kErrorNoNetwork			 = 43;
	inline constexpr HError kErrorHeapOutOfMemory	 = 44;
	inline constexpr HError kErrorNoSuchDisk		 = 45;
	inline constexpr HError kErrorFileExists		 = 46;
	inline constexpr HError kErrorFormatFailed		 = 47;
	inline constexpr HError kErrorNetworkTimeout	 = 48;
	inline constexpr HError kErrorInternal			 = 49;
	inline constexpr HError kErrorForkAlreadyExists	 = 50;
	inline constexpr HError kErrorOutOfTeamSlot		 = 51;
	inline constexpr HError kErrorHeapNotPresent	 = 52;
	inline constexpr HError kErrorNoEntrypoint		 = 53;
	inline constexpr HError kErrorDiskIsCorrupted	 = 54;
	inline constexpr HError kErrorDisk				 = 55;
	inline constexpr HError kErrorInvalidData		 = 56;
	inline constexpr HError kErrorAsync				 = 57;
	inline constexpr HError kErrorNonBlocking		 = 58;
	inline constexpr HError kErrorIPC				 = 59;
	inline constexpr HError kErrorSign				 = 60;
	inline constexpr HError kErrorUnimplemented		 = 0;

	Void	err_bug_check_raise(void) noexcept;
	Boolean err_bug_check(void) noexcept;
} // namespace Kernel