P99
Macros
p99_map.h File Reference

macros to produce lists of statements or declarations. More...

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

Go to the source code of this file.

Macros

#define P99_AASSIGN(TARGET, SOURCE, N)
 Assign the content of array SOURCE to TARGET. More...
 
#define P99_ACCESSORS(X, N)   P00_ACCESSORS(X, N)
 
#define P99_ACOPY(TYPE, N, VAR, M)
 Expand to an array literal of type TYPE[N] copying from another array. More...
 
#define P99_ADDS(...)   P00_ADDS(P99_NARG(__VA_ARGS__),__VA_ARGS__)
 Return a token that is the sum of all arguments. More...
 
#define P99_ADESIGNATED(VAR, N)   P99_DESIGNATED(VAR, P99_ACCESSORS(, N))
 Expand to an array initializer copying array VAR for N positions. More...
 
#define P99_DESIGNATED(VAR, ...)   { P00_DESIGNATED(VAR, P99_NARG(__VA_ARGS__), __VA_ARGS__) }
 Construct a designated initializer by copying fields of VAR. More...
 
#define P99_IPOW(N, X)   P99_IF_EQ(N,0)(P99_SIGN_PROMOTE(1, X))((P99_FOR(X, N, P00_POW, P00_POW0, P99_REP(N,))))
 Compute the Nth multiplicative integer power of X. More...
 
#define P99_JOIN(...)   P99_STRCATS((char[P99_SIZEOFS(__VA_ARGS__) + 1]){ 0 }, __VA_ARGS__)
 Concatenate all arguments. More...
 
#define P99_LCOPY(TYPE, VAR, ...)   ((TYPE)P99_DESIGNATED(VAR, __VA_ARGS__))
 Construct a compound literal of type TYPE by copying fields of VAR. More...
 
#define P99_POSS(N)   P99_FOR(,N, P00_SEQ, P00_POS,)
 Produce a list of length N that has the contents of 0, 1, , N-1. More...
 
#define P99_SIZEOFS(...)   P00_SIZEOFS(P99_NARG(__VA_ARGS__),__VA_ARGS__)
 Return an expression that returns the sum of the size of all arguments. More...
 
#define P99_STRCATS(TARG, ...)
 Append all argument strings after TARG to TARG. More...
 
#define P99_STRDUP(...)   P99_STRCATS(calloc(P99_STRLENS(__VA_ARGS__) + 16, 1), __VA_ARGS__)
 Concatenate all arguments. More...
 
#define P99_STRLENS(...)   P00_STRLENS(P99_NARG(__VA_ARGS__),__VA_ARGS__)
 Return an expression that returns the sum of the lengths of all strings that are given as arguments. More...
 
#define P99_TYPEDEFS(NAME, ...)   P00_TYPEDEFS(NAME, P99_NARG(__VA_ARGS__), __VA_ARGS__)
 Take each argument on the list and transform it into a typedef of name NAME_0, NAME_1, etc. More...
 
#define P99_VASSIGNS(NAME, ...)
 Vector-assign to a list. More...
 

Detailed Description

macros to produce lists of statements or declarations.

See also
Produce C99 statements or expression lists

Definition in file p99_map.h.

void
void void
Definition: p99_bitset.h:84
P99_ADESIGNATED
#define P99_ADESIGNATED(VAR, N)
Expand to an array initializer copying array VAR for N positions.
Definition: p99_map.h:267
P99_DESIGNATED
#define P99_DESIGNATED(VAR,...)
Construct a designated initializer by copying fields of VAR.
Definition: p99_map.h:253
P99_AASSIGN
#define P99_AASSIGN(TARGET, SOURCE, N)
Assign the content of array SOURCE to TARGET.
Definition: p99_map.h:355
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_IF_LT
#define P99_IF_LT(A, B)
Test two decimal numbers A and B for whether A is strictly less than B.
Definition: p99_if.h:120
P99_BIGFUNC
#define P99_BIGFUNC(FUNC, M,...)
Realize the right associative call of binary function FUNC of all the arguments.
Definition: p99_for.h:154
P99_LCOPY
#define P99_LCOPY(TYPE, VAR,...)
Construct a compound literal of type TYPE by copying fields of VAR.
Definition: p99_map.h:299
P99_IF_VOID
#define P99_IF_VOID(...)
Definition: p99_if.h:171
P99_FOR
#define P99_FOR(NAME, N, OP, FUNC,...)
A preprocessor pseudo iterator.
Definition: p99_for.h:92