From 22ae5a6a98ec6aa98207bddc37a1200ea74d134b Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Tue, 9 Jun 2020 18:38:43 +0200 Subject: Add liberror_pop_error and liberror_set_error_existing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- liberror.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'liberror.h') diff --git a/liberror.h b/liberror.h index 1e57502..4d222e6 100644 --- a/liberror.h +++ b/liberror.h @@ -353,6 +353,24 @@ void liberror_set_error(const char[256], const char[64], const char[64], long lo */ void liberror_set_error_errno(const char[256], const char[64], int); +/** + * Remove the current error and, if the + * specified error is non-`NULL`, replace it + * with the the specified error + * + * @param error The error to set as the current error, must not + * be the pointer returned by liberror_get_error() + * for any thread, including the current thread, + * the function will copy and deallocate this error + */ +void liberror_set_error_existing(struct liberror_error *); + +/** + * Remove the current error and, if the error + * has a cause, replace it with its cause + */ +void liberror_pop_error(void); + /** * The an error, its backtrace, and its * cause (recursively) -- cgit v1.2.3-70-g09d2