|
Libecoli 0.11.1
Extensible COmmand LIne library
|
Assertion helpers. More...
Macros | |
| #define | ec_assert_print(expr, args...) |
| #define | EC_CHECK_ARG(cond, ret, err) |
Assertion helpers.
Helpers to check at runtime if a condition is true, or otherwise either abort (exit program) or return an error.
| #define ec_assert_print | ( | expr, | |
| args... ) |
Abort if the condition is false.
If expression is false, this macro will print an error message to standard error and terminates the program by calling abort(3).
| expr | The expression to be checked. |
| args | The format string, optionally followed by other arguments. |
| #define EC_CHECK_ARG | ( | cond, | |
| ret, | |||
| err ) |
Check a condition or return.
If the condition is true, do nothing. If it is false, set errno and return the specified value.
| cond | The condition to test. |
| ret | The value to return. |
| err | The errno to set. |