P99
Macros
p99_logical.h File Reference

macros to handle Boolean conditions at compile time. More...

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

Go to the source code of this file.

Macros

#define P99_ADD(_0, _1)
 add two decimal numbers More...
 
#define P99_ALLBUTLAST(...)   P99_PASTE2(P00_PRE,P99_PRED(P00_NARG(__VA_ARGS__)))(__VA_ARGS__,)
 Obtain all elements but the last of a list. More...
 
#define P99_EVAL(EDEC)   P99_PASTE2(P00_dec_eval_, EDEC)
 evaluate the result of one of the arithmetic preprocessor More...
 
#define P99_IF_INT(TOK)   P99_IF_EQ_1(P99_IS_INT(TOK))
 
#define P99_IS_EQ(_0, _1)   P99_HAS_COMMA(P99_PASTE4(P00_IS_, _0, _EQ_, _1)())
 Determine if the two tokens _0 and _1 are equal. More...
 
#define P99_IS_GE(_0, _1)   P00_GE( P99_IS_EQ_0(_1), P99_CHS(_0, P99_SELS(_1, P00_ALL_ZEROES()), P00_ALL_ONES()))
 a decimal greater or equal operator More...
 
#define P99_IS_GT(_0, _1)   P99_IS_LT(_1, _0)
 a decimal greater than operator More...
 
#define P99_IS_INT(...)   P00_IS_INT(P99_IS_EQ_signed(__VA_ARGS__), P99_IS_EQ_int(__VA_ARGS__))
 
#define P99_IS_LE(_0, _1)   P99_IS_GE(_1, _0)
 a decimal less or equal operator More...
 
#define P99_IS_LT(_0, _1)   P00_LT( P99_IS_EQ_0(_1), P99_CHS(_0, P99_SELS(_1, P00_ALL_ONES()), P00_ALL_ZEROES()))
 a decimal less than operator More...
 
#define P99_IS_VOID(...)   P00_IS_VOID(P99_IS_EMPTY(__VA_ARGS__), P99_IS_EQ_void(__VA_ARGS__))
 Test whether or not its argument is empty or if it consists of the word void. More...
 
#define P99_LAST(...)   P99_CHS(P99_PRED(P00_NARG(__VA_ARGS__)), __VA_ARGS__,)
 Obtain the last element of a list. More...
 
#define P99_LOGIC_AND(A, B)   P00_LOGIC_AND(P99_LOGIC_EVAL(A), P99_LOGIC_EVAL(B))
 Do a logical and of the arguments. More...
 
#define P99_LOGIC_EVAL(_0)   P00_EVAL_0(P99_IS_EMPTY(_0), P99_IS_EQ_0(_0))
 Do a evaluation of the argument. More...
 
#define P99_LOGIC_NOT(A)   P00_NOT_0(P99_IS_EMPTY(_0), P99_IS_EQ_0(_0))
 Do a logical negation of the argument. More...
 
#define P99_LOGIC_OR(A, B)   P00_LOGIC_OR(P99_LOGIC_EVAL(A), P99_LOGIC_EVAL(B))
 Do a logical inclusive or of the arguments. More...
 
#define P99_LOGIC_XOR(A, B)   P99_IS_EQ(P99_LOGIC_NOT(A), P99_LOGIC_EVAL(B))
 Do a logical exclusive or of the arguments. More...
 
#define P99_MINUS(_0, _1)   P00_MINUS(_0, _1, P99_IS_EQ(_0, _1), P99_IS_EQ_0(_0), P99_IS_EQ_0(_1))
 substract two decimal numbers More...
 
#define P99_MOD(A, B)   P00_MOD(A, P99_DUPL(32, P99_SELS(B, P00_ASCENDING())))
 Generate the modulus of non-negative decimal numbers A and B at preprocessing time. More...
 
#define P99_MUL(A, B)   P99_PASTE3(P00_MUL_, P99_IS_EQ_0(A), P99_IS_EQ_0(B))(A, B)
 Generate the product of non-negative decimal numbers A and B at preprocessing time. More...
 
#define P99_PASTE(...)   P00_PASTE(P00_NARG(__VA_ARGS__), __VA_ARGS__)
 A left-to-right associative paste operator. More...
 
#define P99_PRED(N)   P00_PRED(N)
 Macro that expands to the predecessor of decimal constant N. More...
 

Detailed Description

macros to handle Boolean conditions at compile time.

Definition in file p99_logical.h.

P99_SELS
#define P99_SELS(N,...)
Definition: p99_list.h:50
P99_NARG
#define P99_NARG(...)
Return the length of the variable length argument list, where an empty argument list is considered to...
Definition: p99_args.h:117
P99_MINUS
#define P99_MINUS(_0, _1)
substract two decimal numbers
Definition: p99_logical.h:243
P99_PASTE
#define P99_PASTE(...)
A left-to-right associative paste operator.
Definition: p99_logical.h:357