Wrap C function which takes variable lengthed parameters?
greg at cosc.canterbury.ac.nz
Sun Dec 16 23:37:17 EST 2001
Just van Rossum wrote:
> But you can't contstruct a va_list and pass it to a _vararg_ function;
You can construct a wrapper that will handle up to
some maximum number of parameters, by exploiting the
fact that a varargs function doesn't care if you pass
it more parameters than it's expecting -- it will just
ignore the rest. So, you can do e.g.
/* unpack the Python args into a and NULL terminate if needed */
whatever_function(a, a, a, a, a, a, a, a,
Greg Ewing, Computer Science Dept, University of Canterbury,
Christchurch, New Zealand
To get my email address, please visit my web page:
More information about the Python-list