XYZ would have TWO input parameters:
a pointer to the function ABC (int * _p_abc)(...);
and a one-dimensional array of arguments to invoke ABC
(int * _abc_arguments)
The XYZ would look like:
void xyz( *_p_abc, *_abc_arguments) {}
The trick is in making XYZ able to call ABC with ANY number
of input arguments.
The problem is in this.
Say, for ABC with TWO arguments like int ABC(int, int), the
call would be (int * _p_abc) (2, 3);
For THREE arguments int ABC(int,int,int) the call would be
(int * _abc)(3,4,5).
How do I make XYZ, again, to call ABC with ANY number of arguments?
One very clumsy way to do that would be to use simple SWITCH:
switch:
case 1: (int * _p_abc) (x1);
case 2: (int * _p_abc) (x1,x2);
...
case 5: (int * _p_abc) (x1,x2,x3,x4,x5);
But it's TOO clumsy. I need a more elegant way to do that.
And, of course, the above is a simplified version in that ALL
arguments are integers. I will have to make it ultimately versatile so that it would take arguments of ANY type.