From 5af35efce67446c47c4816013cd06474631decad Mon Sep 17 00:00:00 2001 From: "Ian M." Date: Sun, 4 Oct 2026 22:00:12 +0000 Subject: state: Add atas_fatal() to terminate execution Signed-off-by: Ian M. --- core/state.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'core') diff --git a/core/state.c b/core/state.c index 8c3dea1..eaca878 100644 --- a/core/state.c +++ b/core/state.c @@ -4,7 +4,9 @@ */ #include +#include #include +#include int atas_state_init(const char *in_file, struct atas_state *state) @@ -32,3 +34,11 @@ atas_state_destroy(struct atas_state *state) fclose(state->in_file); state->in_file = NULL; } + +void +atas_fatal(struct atas_state *state) +{ + assert(state != NULL && "state cannot be NULL\n"); + atas_state_destroy(state); + exit(1); +} -- cgit v1.2.3