aboutsummaryrefslogtreecommitdiffstats
path: root/include/osmocore/panic.h
diff options
context:
space:
mode:
authorSylvain Munaut <tnt@246tNt.com>2010-07-25 18:08:54 +0200
committerSylvain Munaut <tnt@246tNt.com>2010-07-25 18:08:54 +0200
commitac3e61a7a6b8f56b74d4ebd9c0fcb9c5935294b1 (patch)
tree894fd9150a39bb1442467bdb1867b07d2b475cfe /include/osmocore/panic.h
parentf23ababfb2160f3189c19898c1ae5a987be1ba47 (diff)
core: Add some generic panic handling
This also includes an option for a minimal 'infinite loop' type panic that could be required for embedded target that don't have abort() or fprintf() Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Diffstat (limited to 'include/osmocore/panic.h')
-rw-r--r--include/osmocore/panic.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/osmocore/panic.h b/include/osmocore/panic.h
new file mode 100644
index 00000000..cee95358
--- /dev/null
+++ b/include/osmocore/panic.h
@@ -0,0 +1,11 @@
+#ifndef OSMOCORE_PANIC_H
+#define OSMOCORE_PANIC_H
+
+#include <stdarg.h>
+
+typedef void (*osmo_panic_handler_t)(const char *fmt, va_list args);
+
+void osmo_panic(const char *fmt, ...);
+void osmo_set_panic_handler(osmo_panic_handler_t *h);
+
+#endif