errors.h

Defines and macros used for error management.

Authors

Mathieu Favergefav.nosp@m.erge@labr.nosp@m.i.fr
Xavier LACOSTElac.nosp@m.oste@labr.nosp@m.i.fr
Summary
errors.hDefines and macros used for error management.
Defines
DUMP_FILENAMEFile where to dump parameters array if an error occur.
Macros
ASSERTPrints an error and calls EXIT if a value is false.
ASSERTDBGIf FLAG_ASSERT is defined, call ASSERT
ASSERT_DEBUGCheck expression and print error if the assertion is not verified.
CHECK_NANCheck if the argument is equal to NaN or infinity.
EXITSet IPARM_ERROR_NUMBER to module+error, dumps parameters and exit.
RETURNIf value is different from NO_ERR, sets IPARM_ERROR_NUMBER to module+error, dumps parameters and return value.
RETURN_ERRORReturn the value
MALLOC_ERRORPrints an error message and call EXIT with MOD_UNKNOWN as module and ALLOC_ERR as error.

Defines

DUMP_FILENAME

File where to dump parameters array if an error occur.

Macros

ASSERT

Prints an error and calls EXIT if a value is false.

Parameters

exprValue to test.
moduleModule in which the test is performed.

ASSERTDBG

If FLAG_ASSERT is defined, call ASSERT

Parameters

exprValue to test.
moduleModule in which the test is performed.

ASSERT_DEBUG

Check expression and print error if the assertion is not verified.

Only performed if PASTIX_DEBUG is defined and dbg_flag is not null.

Parameters

exprExpression to check.
dbg_flagFlag indicating if check has to be performed.

CHECK_NAN

Check if the argument is equal to NaN or infinity.

Parameters

exprThe value to check.

EXIT

Set IPARM_ERROR_NUMBER to module+error, dumps parameters and exit.

Parameters

moduleModule where the error occurs.
errorValue to set IPARM_ERROR_NUMBER to.

RETURN

If value is different from NO_ERR, sets IPARM_ERROR_NUMBER to module+error, dumps parameters and return value.

Parameters

valueValue to test.
moduleModule where the error occurs.
errorValue to set <IPARM_ERROR_NUMBER> to.

RETURN_ERROR

Return the value

Parameters

valueValue to test.

MALLOC_ERROR

Prints an error message and call EXIT with MOD_UNKNOWN as module and ALLOC_ERR as error.

Set IPARM_ERROR_NUMBER to module+error, dumps parameters and exit.
Prints an error and calls EXIT if a value is false.
Close