aboutsummaryrefslogtreecommitdiffstats
path: root/start.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2019-04-13 22:00:04 +0200
committerMattias Andrée <maandree@kth.se>2019-04-13 22:00:04 +0200
commit05ad06600b712a29bc99a65ae89f38d4d8f30371 (patch)
tree1d7d8a6ac3b83c0150635a2e81dd51d4e648e4b3 /start.c
parentDocument fields for error details (diff)
downloadliberror-05ad06600b712a29bc99a65ae89f38d4d8f30371.tar.gz
liberror-05ad06600b712a29bc99a65ae89f38d4d8f30371.tar.bz2
liberror-05ad06600b712a29bc99a65ae89f38d4d8f30371.tar.xz
Add liberror_start and liberror_end
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'start.c')
-rw-r--r--start.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/start.c b/start.c
new file mode 100644
index 0000000..788011f
--- /dev/null
+++ b/start.c
@@ -0,0 +1,16 @@
+/* See LICENSE file for copyright and license details. */
+#include "internal.h"
+
+
+void
+liberror_start(struct liberror_state *state)
+{
+ state->backtrace = liberror_saved_backtrace;
+ liberror_saved_backtrace = NULL;
+ state->have_error = liberror_have_error_;
+ liberror_have_error_ = 0;
+ state->errnum = errno;
+ errno = 0;
+ memcpy(&state->error, &liberror_error_, sizeof(liberror_error_));
+ memset(&liberror_error_, 0, sizeof(liberror_error_));
+}