P99
Macros | Functions | Variables
p99_try.h File Reference
#include "p99_constraint.h"
#include "p99_lifo.h"
+ Include dependency graph for p99_try.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define P99_CATCH(...)
 Designate a block that is executed regardless of the exceptions that were encountered in the corresponding try block. More...
 
#define P99_FINALLY
 Designate a block that is executed regardless of the exceptions that were encountered in the corresponding try block. More...
 
#define P99_RETHROW   p00_jmp_throw(p00_code, p00_unwind_top, 0, 0, 0)
 Stop execution at the current point inside a P99_FINALLY or P99_CATCH clause and propagate the same exception that led here to the next level. More...
 
#define P99_THROW(X)   p00_jmp_throw((X), p00_unwind_top, P99_STRINGIFY(__LINE__), __func__, "throw")
 Stop execution at the current point and signal an exception of value X to the next P99_TRY clause on the call stack, if any. More...
 
#define P99_THROW_ASSERT(E, ...)   (void)p00_throw_call_zero(!(__VA_ARGS__), E, p00_unwind_top, P99_STRINGIFY(__LINE__), __func__, "failed assertion: ``" #__VA_ARGS__ "''")
 Replacement for assert that throw a catchable exception. More...
 
#define P99_THROW_CALL_NEG(F, E, ...)   P00_THROW_CALL_NEG(F, E, __VA_ARGS__)
 Wrap a function call to F such that it throws an error on negative return. More...
 
#define P99_THROW_CALL_NEGATE(F, E, ...)   P00_THROW_CALL_NEGATE(F, E, __VA_ARGS__)
 Wrap a function call to F such that it throws an error on negative return. More...
 
#define P99_THROW_CALL_NOT_ZERO(F, E, ...)   p00_throw_call_zero(!F(__VA_ARGS__), E, p00_unwind_top, P99_STRINGIFY(__LINE__), __func__, #F ", zero return")
 Wrap a function call to F such that it throws an error on failure. More...
 
#define P99_THROW_CALL_RANGE(F, ...)
 Wrap a function call to F such that it throws an error on failure. More...
 
#define P99_THROW_CALL_RANGE_ARG_0   permitted
 
#define P99_THROW_CALL_RANGE_ARG_1   permitted
 
#define P99_THROW_CALL_RANGE_ARG_2   permitted
 
#define P99_THROW_CALL_RANGE_ARG_3   permitted
 
#define P99_THROW_CALL_RANGE_ARG_4   permitted
 
#define P99_THROW_CALL_THRD(F, ...)   p00_throw_call_thrd(F(__VA_ARGS__), p00_unwind_top, P99_STRINGIFY(__LINE__), __func__, #F ", no thrd_success")
 Wrap a "thread" function call to F such that it throws an error on failure. More...
 
#define P99_THROW_CALL_VOIDP(F, E, ...)   P00_THROW_CALL_VOIDP(F, E, __VA_ARGS__)
 Wrap a function call to F such that it throws an error on invalid return. More...
 
#define P99_THROW_CALL_ZERO(F, E, ...)   p00_throw_call_zero(F(__VA_ARGS__), E, p00_unwind_top, P99_STRINGIFY(__LINE__), __func__, #F ", non-zero return")
 Wrap a function call to F such that it throws an error on failure. More...
 
#define P99_THROW_ERRNO   p00_throw_errno(p00_unwind_top, EINVAL, P99_STRINGIFY(__LINE__), __func__, "THROW_ERRNO")
 Capture, clean and throw the current value of errno. More...
 
#define P99_TRY
 Create a block that can catch exceptions. More...
 

Functions

void p99_jmp_report (errno_t p00_cond)
 Report the origin and cause of an error. More...
 
union p00_tp_p00_jmp_buf0_ptr P99_TP (p00_jmp_buf0_ptr)
 
union p00_tp_glue_p00_jmp_buf0_ptr P99_TP_STATE (p00_jmp_buf0_ptr)
 

Variables

 P99_TSS_DECLARE_LOCAL
 
thrd_timedout
@ thrd_timedout
returned by a timed wait function to indicate that the time specified in the call was reached without...
Definition: p99_tss.h:114
P99_TRY
#define P99_TRY
Create a block that can catch exceptions.
Definition: p99_try.h:585
P99_THROW
#define P99_THROW(X)
Stop execution at the current point and signal an exception of value X to the next P99_TRY clause on ...
Definition: p99_try.h:128
P99_SER
#define P99_SER(MACRO,...)
Apply the macro MACRO to the rest of the argument list.
Definition: p99_for.h:264
f
f
Definition: p99_str.h:138
p99_jmp_report
void p99_jmp_report(errno_t p00_cond)
Report the origin and cause of an error.
Definition: p99_try.h:70
P99_FINALLY
#define P99_FINALLY
Designate a block that is executed regardless of the exceptions that were encountered in the correspo...
Definition: p99_try.h:630
P99_NOP
#define P99_NOP
Do nothing.
Definition: p99_block.h:297
P99_STD_REAL_TYPES
#define P99_STD_REAL_TYPES
Definition: p99_type.h:290
P99_UNWIND_PROTECT
#define P99_UNWIND_PROTECT
Unwind execution from several levels of nesting inside a function.
Definition: p99_block.h:612
P99_THROW_ERRNO
#define P99_THROW_ERRNO
Capture, clean and throw the current value of errno.
Definition: p99_try.h:269
thrd_nomem
@ thrd_nomem
returned by a function to indicate that the requested operation failed because it was unable to alloc...
Definition: p99_tss.h:133
P99_RETHROW
#define P99_RETHROW
Stop execution at the current point inside a P99_FINALLY or P99_CATCH clause and propagate the same e...
Definition: p99_try.h:495
P99_IF_EMPTY
#define P99_IF_EMPTY(...)
Definition: p99_if.h:153
P99_CATCH
#define P99_CATCH(...)
Designate a block that is executed regardless of the exceptions that were encountered in the correspo...
Definition: p99_try.h:676