Table of Contents
Many library functions return a value of type LqrRetVal. This is an enum
type which can hold the values:
LQR_OKeveryting OK
LQR_ERRORgeneric fatal error
LQR_NOMEMnot enough memory
At top level, the user should handle this values explicitely, because the library doesn't do anything else than stopping and returning an error signal in case of errors. An easy way is setting up some macros and wrap each function call with those, as shown in the example files.
Below top level, the library provides some convenient macros which can be used to wrap function calls, in order to propagate these signals:
CATCH (expr)
if expr is equal to LQR_OK
it does nothing, otherwise it returns expr
(or the result of the execution of expr
if it happens to be a function)
CATCH_F (expr)
returns LQR_ERROR if
expr is FALSE
CATCH_MEM (expr)
returns LQR_NOMEM if
expr is NULL