summaryrefslogtreecommitdiffstats
path: root/core/errorhelper.h
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2019-08-05 19:41:15 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-08-08 16:26:30 -0700
commit5da09a21bba0b3d8979d6b8e70baf52b0316242f (patch)
treed5524c8f5decf8948323d25b9ca8b42d8315786c /core/errorhelper.h
parent2a966ac2a9a807f4ae45d671cca8b245f8f70ece (diff)
downloadsubsurface-5da09a21bba0b3d8979d6b8e70baf52b0316242f.tar.gz
Cleanup: move error reporting function declarations to errorhelper.h
Move the declarations of the "report_error()" and "set_error_cb()" functions and the "verbose" variable to errorhelper.h. Thus, error-reporting translation units don't have to import the big dive.h header file. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'core/errorhelper.h')
-rw-r--r--core/errorhelper.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/core/errorhelper.h b/core/errorhelper.h
new file mode 100644
index 000000000..4a32754ee
--- /dev/null
+++ b/core/errorhelper.h
@@ -0,0 +1,19 @@
+// SPDX-License-Identifier: GPL-2.0
+#ifndef ERROR_HELPER_H
+#define ERROR_HELPER_H
+
+// error reporting functions
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern int verbose;
+extern int report_error(const char *fmt, ...);
+extern void set_error_cb(void(*cb)(char *)); // Callback takes ownership of passed string
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif