From 72f71d4e2bbc224744cd7694d7c2922b6dcbc1e8 Mon Sep 17 00:00:00 2001 From: Pradana Aumars Date: Wed, 2 Jun 2021 12:04:36 +0200 Subject: [PATCH] Add exception_t.exception_null to check if no exception --- src/exception_t.c | 5 +++++ src/exception_t.h | 3 +++ 2 files changed, 8 insertions(+) diff --git a/src/exception_t.c b/src/exception_t.c index da8cbaf..b5cea82 100644 --- a/src/exception_t.c +++ b/src/exception_t.c @@ -14,3 +14,8 @@ void exception_free(exception_t *e) { free(e); } + +int +exception_null(const exception_t *e) { + return e->type == NO_ERROR; +} diff --git a/src/exception_t.h b/src/exception_t.h index ba6af43..5be2cb7 100644 --- a/src/exception_t.h +++ b/src/exception_t.h @@ -21,6 +21,9 @@ exception_init(); void exception_free(exception_t *e); +int +exception_null(const exception_t *e); + char* exception_str(exception_t *e);