P99
Defines
Default arguments and types for functions
C Programming facilities

As a C++ like feature, this series of macros can be used to provide default arguments to functions and also to improve type safety for variadic functions. More...

+ Collaboration diagram for Default arguments and types for functions:

Defines

#define P99_CALL_DEFARG(NAME, M,...)   NAME(__VA_ARGS__)
 Define a replacement macro for functions that can provide default arguments to the underlying real function.
#define P99_CALL_DEFARG_LIST(NAME, M,...)   __VA_ARGS__
 Expand an argument list with default arguments.
#define P99_CALL_VA_ARG(NAME, M, T,...)   NAME(__VA_ARGS__)
 Assure type safety for variadic functions.
#define P99_DECLARE_DEFARG(NAME,...)
 Provide default arguments for macro NAME.
#define P99_DEFARG_DOCU(NAME)
 Provide a documentation section to a function defined with P99_CALL_DEFARG.
#define P99_DEFINE_DEFARG(NAME,...)
 Define the symbols that are declared through a corresponding call P99_DECLARE_DEFARG.
#define P99_INSTANTIATE(RT, NAME,...)   RT NAME(__VA_ARGS__)
 Instantiate an inline function.
#define P99_PROTOTYPE(...)
 Define the prototype of function NAME.

Detailed Description

As a C++ like feature, this series of macros can be used to provide default arguments to functions and also to improve type safety for variadic functions.

This goes in several parts.

Another feature that is provided here is a macro that allows you to prescribe a certain type to the arguments of a variadic function. In plain C these are dangerous, since C cannot guess the type that the implementation of the function expects. P99_CALL_VA_ARG may be used to overcome this problem.

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines