summaryrefslogtreecommitdiff
path: root/src/errors.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/errors.h')
-rw-r--r--src/errors.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/errors.h b/src/errors.h
new file mode 100644
index 0000000..add5b3c
--- /dev/null
+++ b/src/errors.h
@@ -0,0 +1,25 @@
+#ifndef __ERRORS_H
+#define __ERRORS_H
+
+#include "port/sys.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef signed int error_t;
+
+#define OK 0 /* no error, everything is fine */
+#define ERR_OUT_OF_MEMORY -1 /* out of memory in malloc */
+#define ERR_INVALID_STATE -2 /* the object is called in an illegal moment */
+#define ERR_INVALID_VALUE -3 /* invalid parameter to a function */
+#define ERR_INTERNAL -4 /* internal error of the object, usualy rare */
+#define ERR_PROGRAMMING -5 /* programming mistake, should not happen */
+#define ERR_NOT_IMPLEMENTED -6 /* not implemented yet */
+#define ERR_TIMEOUT -7 /* timeout */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* ifndef __ERRORS_H */