From 675c60b5e05ab71390f0b909d31ae4e7e61a3a26 Mon Sep 17 00:00:00 2001 From: Andrew Kesterson Date: Mon, 22 Jun 2026 08:15:07 -0400 Subject: [PATCH] Removed AKERR_HEAP, AKERR_REGISTRY, AKERR_BEHAVIOR, they belong to libakgl. Replaced AKERR_BEHAVIOR which was ambiguous with AKERR_BADEXC which is raised when a function falls to call SUCCEED_RETURN(). --- include/akerror.tmpl.h | 34 +++++++++++++++++----------------- src/error.c | 4 +--- 2 files changed, 18 insertions(+), 20 deletions(-) diff --git a/include/akerror.tmpl.h b/include/akerror.tmpl.h index 4f50d39..56694c4 100644 --- a/include/akerror.tmpl.h +++ b/include/akerror.tmpl.h @@ -22,22 +22,22 @@ #define AKERR_LAST_ERRNO_VALUE AKERR_LAST_ERRNO_VALUE_SED -#define AKERR_NULLPOINTER (AKERR_LAST_ERRNO_VALUE + 1) -#define AKERR_OUTOFBOUNDS (AKERR_LAST_ERRNO_VALUE + 2) -#define AKERR_API (AKERR_LAST_ERRNO_VALUE + 3) -#define AKERR_ATTRIBUTE (AKERR_LAST_ERRNO_VALUE + 4) -#define AKERR_TYPE (AKERR_LAST_ERRNO_VALUE + 5) -#define AKERR_KEY (AKERR_LAST_ERRNO_VALUE + 6) -#define AKERR_HEAP (AKERR_LAST_ERRNO_VALUE + 7) -#define AKERR_INDEX (AKERR_LAST_ERRNO_VALUE + 8) -#define AKERR_FORMAT (AKERR_LAST_ERRNO_VALUE + 9) -#define AKERR_IO (AKERR_LAST_ERRNO_VALUE + 10) -#define AKERR_REGISTRY (AKERR_LAST_ERRNO_VALUE + 11) -#define AKERR_VALUE (AKERR_LAST_ERRNO_VALUE + 12) -#define AKERR_BEHAVIOR (AKERR_LAST_ERRNO_VALUE + 13) -#define AKERR_RELATIONSHIP (AKERR_LAST_ERRNO_VALUE + 14) -#define AKERR_EOF (AKERR_LAST_ERRNO_VALUE + 15) -#define AKERR_CIRCULAR_REFERENCE (AKERR_LAST_ERRNO_VALUE + 16) +#define AKERR_NULLPOINTER (AKERR_LAST_ERRNO_VALUE + 1) /** A pointer had a NULL value where such was not permissible */ +#define AKERR_OUTOFBOUNDS (AKERR_LAST_ERRNO_VALUE + 2) /** Attempt to access a datastructure outside of bounds */ +#define AKERR_API (AKERR_LAST_ERRNO_VALUE + 3) /** An otherwise unspecified API contract has been violated */ +#define AKERR_ATTRIBUTE (AKERR_LAST_ERRNO_VALUE + 4) /** Relates to accessing of attributes on objects */ +#define AKERR_TYPE (AKERR_LAST_ERRNO_VALUE + 5) /** An object had the incorrect type */ +#define AKERR_KEY (AKERR_LAST_ERRNO_VALUE + 6) /** A key was either invalid for or not present in a map */ +#define AKERR_INDEX (AKERR_LAST_ERRNO_VALUE + 8) /** An error occurred when attempting to index an indexable datastructure (other than out of bounds) */ +#define AKERR_FORMAT (AKERR_LAST_ERRNO_VALUE + 9) /** An error occurred in the formatting of an object (usually a string) */ +#define AKERR_IO (AKERR_LAST_ERRNO_VALUE + 10) /** An unspecified IO error occurred. */ +#define AKERR_VALUE (AKERR_LAST_ERRNO_VALUE + 11) /** A provided value was invalid */ +#define AKERR_RELATIONSHIP (AKERR_LAST_ERRNO_VALUE + 12) /** An error occurred in establishing, maintaining or severing a relationship between two objects */ +#define AKERR_EOF (AKERR_LAST_ERRNO_VALUE + 13) /** The end of a stream or file has been encountered */ +#define AKERR_CIRCULAR_REFERENCE (AKERR_LAST_ERRNO_VALUE + 14) /** Indicates that a circular reference has been found in a linked list */ +#define AKERR_ITERATOR_BREAK (AKERR_LAST_ERRNO_VALUE + 15) /** Used to prematurely end an iteration cycle (such as when searching a graph and the desired node has been found) */ +#define AKERR_NOT_IMPLEMENTED (AKERR_LAST_ERRNO_VALUE + 16) /** A method was called that is defined but not currently implemented */ +#define AKERR_BADEXC (AKERR_LAST_ERRNO_VALUE + 17) /** The libakerr library was given an akerr_ErrorContext to parse that did not come from AKERR_ARRAY_ERROR (likely an uninitialized pointer) */ #ifndef AKERR_MAX_ERR_VALUE #define AKERR_MAX_ERR_VALUE (AKERR_LAST_ERRNO_VALUE + 15) @@ -188,7 +188,7 @@ void akerr_init_errno(void); __stmt; \ if ( akerr_valid_error_address(__err_context) == 0 ) { \ __err_context = NULL; \ - FAIL(__err_context, AKERR_BEHAVIOR, "Received (akerr_Error *) from an invalid memory region. (Did the method finish without calling SUCCEED_RETURN?)"); \ + FAIL(__err_context, AKERR_BADEXC, "Received (akerr_ErrorContext *) from an invalid memory region. (Did the method finish without calling SUCCEED_RETURN?)"); \ } #define DETECT(__err_context, __stmt) \ diff --git a/src/error.c b/src/error.c index 91a7cf9..17423b3 100644 --- a/src/error.c +++ b/src/error.c @@ -61,15 +61,13 @@ void akerr_init() akerr_name_for_status(AKERR_ATTRIBUTE, "Attribute Error"); akerr_name_for_status(AKERR_TYPE, "Type Error"); akerr_name_for_status(AKERR_KEY, "Key Error"); - akerr_name_for_status(AKERR_HEAP, "Heap Error"); akerr_name_for_status(AKERR_INDEX, "Index Error"); akerr_name_for_status(AKERR_FORMAT, "Format Error"); akerr_name_for_status(AKERR_IO, "Input Output Error"); - akerr_name_for_status(AKERR_REGISTRY, "Registry Error"); akerr_name_for_status(AKERR_VALUE, "Value Error"); - akerr_name_for_status(AKERR_BEHAVIOR, "Behavior Error"); akerr_name_for_status(AKERR_RELATIONSHIP, "Relationship Error"); akerr_name_for_status(AKERR_CIRCULAR_REFERENCE, "Circular Reference Error"); + akerr_name_for_status(AKERR_BADEXC, "Invalid akerr_ErrorContext"); #if (defined(AKERR_USE_STDLIB) && AKERR_USE_STDLIB == 1) || (!defined(AKERR_USE_STDLIB)) akerr_init_errno(); #endif