summaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/apimagic/apimagic.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/include/apimagic/apimagic.h b/include/apimagic/apimagic.h
index add4e08..1d51bd9 100644
--- a/include/apimagic/apimagic.h
+++ b/include/apimagic/apimagic.h
@@ -41,6 +41,23 @@ extern "C" {
#define AMGC_DRIVER_VERSION 0x0010
#define AMGC_DRIVER_DRY_RUN 0x0020
+/* error flags */
+#define AMGC_ERROR_TOP_LEVEL 0x0001
+#define AMGC_ERROR_NESTED 0x0002
+#define AMGC_ERROR_CHILD 0x0004
+#define AMGC_ERROR_CUSTOM 0x0008
+
+enum amgc_custom_error {
+ AMGC_ERR_FLOW_ERROR,
+ AMGC_ERR_FLEE_ERROR,
+ AMGC_ERR_NULL_CONTEXT,
+ AMGC_ERR_NULL_SOURCE,
+ AMGC_ERR_INVALID_CONTEXT,
+ AMGC_ERR_INVALID_SOURCE,
+ AMGC_ERR_SOURCE_SIZE_ZERO,
+ AMGC_ERR_CAP,
+};
+
enum amgc_action_type {
AMGC_ACTION_NONE,
AMGC_ACTION_OUTPUT,
@@ -81,6 +98,18 @@ struct amgc_action {
int subset;
};
+struct amgc_error_info {
+ const struct amgc_driver_ctx * edctx;
+ const struct amgc_unit_ctx * euctx;
+ const char * eunit;
+ int esyscode;
+ int elibcode;
+ const char * efunction;
+ int eline;
+ unsigned eflags;
+ void * eany;
+};
+
struct amgc_common_ctx {
uint64_t drvflags;
uint64_t actflags;
@@ -95,6 +124,7 @@ struct amgc_driver_ctx {
const char * program;
const char * module;
const struct amgc_common_ctx * cctx;
+ struct amgc_error_info ** errv;
void * any;
int status;
int nerrors;