aboutsummaryrefslogtreecommitdiffstats
path: root/start.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-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_));
+}