We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 01752a2 commit de20a16Copy full SHA for de20a16
2 files changed
include/stdbigos/error.h
@@ -0,0 +1,17 @@
1
+// Copy form frogrammer9/BigOs as we might want to use this
2
+
3
+#ifndef _STDBIGOS_ERROR_H_
4
+#define _STDBIGOS_ERROR_H_
5
6
+typedef enum {
7
+ ERR_NONE = 0,
8
+ ERR_INVALID_ARGUMENT,
9
+ ERR_CRITICAL_INTERNAL_FAILURE,
10
+ ERR_HARDWARE_NOT_COMPATIBLE,
11
+ ERR_ALL_ADDRESS_SPACES_IN_USE,
12
+ ERR_PHISICAL_MEMORY_FULL,
13
+} error_t;
14
15
+const char* get_error_msg(error_t err);
16
17
+#endif //_STDBIGOS_ERROR_H_
src/lib/stdbigos/error.c
@@ -0,0 +1,11 @@
+#include <stdbigos/error.h>
+const char* get_error_msg(error_t err) {
+ switch(err) {
+ case ERR_NONE: return "";
+ case ERR_INVALID_ARGUMENT: return "Invalid argument";
+ default: return "Error message was not provided";
+ }
+}
0 commit comments