P99

◆ P99_LIFO_CLEAR

#define P99_LIFO_CLEAR (   L)
Value:
({ \
register const P99_MACRO_VAR(p00_l, (L)); \
P99_TP_TYPE_STATE(p00_l) p00_state = P99_TP_STATE_INITIALIZER(p00_l, 0); \
/* be sure that the result can not be used as an lvalue */ \
register P99_TP_TYPE(p00_l)* p00_r = P99_TP_STATE_GET(&p00_state); \
for (; p00_r; p00_r = P99_TP_STATE_GET(&p00_state)) { \
if (P99_TP_STATE_COMMIT(&p00_state)) \
break; \
} \
p00_r; \
})

Atomically clear an atomic LIFO L and return a pointer to the start of the list that it previously contained.

See also
P99_LIFO
P99_LIFO_DECLARE
P99_LIFO_PUSH
P99_LIFO_TOP
Remarks
argument 0 maybe evaluated several times for its type but only once for its value

Definition at line 161 of file p99_lifo.h.

P99_MACRO_VAR
#define P99_MACRO_VAR(NAME, EXPR, QUAL)
Define a variable with NAME that has the type and value of EXPR.
Definition: p99_for.h:1268
P99_TP_STATE_GET
#define P99_TP_STATE_GET(TPS)
p99_extension
#define p99_extension
Mark an expression as using a compiler extension.
Definition: p99_compiler.h:210
P99_TP_STATE_INITIALIZER
#define P99_TP_STATE_INITIALIZER(TP, P)
P99_TP_TYPE
#define P99_TP_TYPE(TP)
P99_TP_STATE_COMMIT
#define P99_TP_STATE_COMMIT(TPS)