P99
Macros | Enumerations | Functions
p99_block.h File Reference

Macros that implement controlling blocks. More...

#include "p99_int.h"
+ Include dependency graph for p99_block.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define P99_ALLOW(NAME)
 Allow the use of feature NAME inside the dependent code. More...
 
#define P99_AVOID   for (;0;)
 
#define P99_BLK_MARK(X)
 mark the assembler of a block just before and after More...
 
#define P99_BLOCK(...)   P99_PREFER(__VA_ARGS__) P99_NOP
 
#define P99_BLOCK_DOCUMENT
 Add some default documentation and links to the following block macro. More...
 
#define P99_CHECK_RETURN
 Insert code checks for bare return statements inside P99_UNWIND_PROTECT. More...
 
#define P99_DECLARE_INHIBIT(NAME)   enum { P00_INHIBIT(NAME,) = 0 }
 Declare a feature NAME that can be inhibited or allowed at compile time in certain parts of code. More...
 
#define P99_GUARDED_BLOCK(T, NAME, INITIAL, BEFORE, AFTER)
 A meta-macro to protect a dependent block or statement by a guard variable NAME of type T. More...
 
#define P99_HANDLE_ERRNO
 Handle and reset errno. More...
 
#define P99_INHIBIT(NAME)
 Inhibit the use of feature NAME inside the dependent code. More...
 
#define P99_INHIBIT_CHECK(NAME)   switch (P99_STRINGIFY(P00_INHIBIT(NAME,))[P00_INHIBIT(NAME,)]) default:
 Error out at compile time if NAME is inhibited. More...
 
#define P99_INVARIANT(EXPR)   P99_PROTECTED_BLOCK(assert((EXPR) && "failed at beginning of block"), assert((EXPR) && "failed at end of block"))
 Assert runtime condition EXPR when entering or leaving the dependent block. More...
 
#define P99_MARK(X)   P99_NOP
 mark the produced assembler with a comment that contains the source line number and the token X More...
 
#define P99_NOP   ((void)0)
 Do nothing. More...
 
#define P99_PROTECT
 The pseudo label to which we jump when we unwind the stack with P99_UNWIND. More...
 
#define P99_PROTECTED_BLOCK(BEFORE, AFTER)
 A meta-macro to protect a dependent block or statement by the statements BEFORE that is executed before the block and AFTER that is executed afterward. More...
 
#define P99_SIMPLE_BLOCKS   0
 A bug avoiding macro to reduce the depth of some code produced by P99. More...
 
#define P99_UNCASE   P00_UNCASE :
 A command prefixed with this cannot be a case target from surrounding scopes. More...
 
#define P99_UNWIND(X)   p00_unwind(p00_unwind_top, p99_unwind_level, (X))
 Preliminary resume from one or several levels of nested P99_UNWIND_PROTECT. More...
 
#define p99_unwind_code   ((int)(p00_unwind_top[0].p00_code))
 The code an eventual call to P99_UNWIND. More...
 
#define P99_UNWIND_PROTECT
 Unwind execution from several levels of nesting inside a function. More...
 
#define P99_UNWIND_RETURN
 Return from the enclosing function after unwinding all levels of nested P99_UNWIND_PROTECT. More...
 
#define P99_XCASE   P99_AVOID case
 
#define P99_XDEFAULT   P99_AVOID default
 

Enumerations

enum  
 
enum  p99_unwind { p99_unwind_level = 0 , p99_unwind_return = INT_MAX }
 

Functions

 for (_Bool p00=1;p00 &&({ { __VA_ARGS__ } 1;});p00=0) typedef enum p00_uncase_enum
 Prefer the statements in the argument list over the statement or block that follows. More...
 

Detailed Description

Macros that implement controlling blocks.

See also
Preprocessor Blocks

Definition in file p99_block.h.

P99_UNWIND_RETURN
#define P99_UNWIND_RETURN
Return from the enclosing function after unwinding all levels of nested P99_UNWIND_PROTECT.
Definition: p99_block.h:691
p99_unwind_return
@ p99_unwind_return
Definition: p99_block.h:490
P99_PROTECT
#define P99_PROTECT
The pseudo label to which we jump when we unwind the stack with P99_UNWIND.
Definition: p99_block.h:719
P99_INVARIANT
#define P99_INVARIANT(EXPR)
Assert runtime condition EXPR when entering or leaving the dependent block.
Definition: p99_block.h:744
P99_XCASE
#define P99_XCASE
P99_HANDLE_ERRNO
#define P99_HANDLE_ERRNO
Handle and reset errno.
Definition: p99_block.h:471
P99_ALLOW
#define P99_ALLOW(NAME)
Allow the use of feature NAME inside the dependent code.
Definition: p99_block.h:158
P99_PASTE2
#define P99_PASTE2(_1, _2)
Paste two token sequences at their junction.
Definition: p99_paste.h:82
P99_UNWIND
#define P99_UNWIND(X)
Preliminary resume from one or several levels of nested P99_UNWIND_PROTECT.
Definition: p99_block.h:664
P99_XDEFAULT
#define P99_XDEFAULT
P99_DECLARE_INHIBIT
#define P99_DECLARE_INHIBIT(NAME)
Declare a feature NAME that can be inhibited or allowed at compile time in certain parts of code.
Definition: p99_block.h:130
P99_UNWIND_PROTECT
#define P99_UNWIND_PROTECT
Unwind execution from several levels of nesting inside a function.
Definition: p99_block.h:612
P99_MARK
#define P99_MARK(X)
mark the produced assembler with a comment that contains the source line number and the token X
Definition: p99_block.h:95
P99_AVOID
#define P99_AVOID
for
for(_Bool p00=1;p00 &&({ { __VA_ARGS__ } 1;});p00=0) typedef enum p00_uncase_enum
Prefer the statements in the argument list over the statement or block that follows.
Definition: p99_block.h:327
P99_UNLIKELY
#define P99_UNLIKELY(...)
Mark the conditional expression as being unlikely.
Definition: p99_compiler.h:994
errno
errno
Definition: p99_constraint.h:199