diff --git a/src/machine-c-api.h b/src/machine-c-api.h index 5b3b93846..24da6b686 100644 --- a/src/machine-c-api.h +++ b/src/machine-c-api.h @@ -61,30 +61,30 @@ typedef enum cm_pma_constant { /// \brief Error codes returned from the C API. typedef enum cm_error { - CM_ERROR_OK, - CM_ERROR_INVALID_ARGUMENT, - CM_ERROR_DOMAIN_ERROR, - CM_ERROR_LENGTH_ERROR, - CM_ERROR_OUT_OF_RANGE, - CM_ERROR_LOGIC_ERROR, - CM_ERROR_RUNTIME_ERROR, - CM_ERROR_RANGE_ERROR, - CM_ERROR_OVERFLOW_ERROR, - CM_ERROR_UNDERFLOW_ERROR, - CM_ERROR_REGEX_ERROR, - CM_ERROR_SYSTEM_ERROR, - CM_ERROR_BAD_TYPEID, - CM_ERROR_BAD_CAST, - CM_ERROR_BAD_ANY_CAST, - CM_ERROR_BAD_OPTIONAL_ACCESS, - CM_ERROR_BAD_WEAK_PTR, - CM_ERROR_BAD_FUNCTION_CALL, - CM_ERROR_BAD_ALLOC, - CM_ERROR_BAD_ARRAY_NEW_LENGTH, - CM_ERROR_BAD_EXCEPTION, - CM_ERROR_BAD_VARIANT_ACCESS, - CM_ERROR_EXCEPTION, - CM_ERROR_UNKNOWN, + CM_ERROR_OK = 0, + CM_ERROR_INVALID_ARGUMENT = -1, + CM_ERROR_DOMAIN_ERROR = -2, + CM_ERROR_LENGTH_ERROR = -3, + CM_ERROR_OUT_OF_RANGE = -4, + CM_ERROR_LOGIC_ERROR = -5, + CM_ERROR_RUNTIME_ERROR = -6, + CM_ERROR_RANGE_ERROR = -7, + CM_ERROR_OVERFLOW_ERROR = -8, + CM_ERROR_UNDERFLOW_ERROR = -9, + CM_ERROR_REGEX_ERROR = -10, + CM_ERROR_SYSTEM_ERROR = -11, + CM_ERROR_BAD_TYPEID = -12, + CM_ERROR_BAD_CAST = -13, + CM_ERROR_BAD_ANY_CAST = -14, + CM_ERROR_BAD_OPTIONAL_ACCESS = -15, + CM_ERROR_BAD_WEAK_PTR = -16, + CM_ERROR_BAD_FUNCTION_CALL = -17, + CM_ERROR_BAD_ALLOC = -18, + CM_ERROR_BAD_ARRAY_NEW_LENGTH = -19, + CM_ERROR_BAD_EXCEPTION = -20, + CM_ERROR_BAD_VARIANT_ACCESS = -21, + CM_ERROR_EXCEPTION = -22, + CM_ERROR_UNKNOWN = -23, } cm_error; /// \brief Reasons for a machine run interruption.