[Pythonmac-SIG] calldll MAXARGS

Jack Jansen jack@oratrix.nl
Fri, 26 Nov 1999 16:44:43 +0100


> I am currently trying to use calldll, but I ran into an annoying limitation:
> calldll.newcall() only accepts 8 arguments for the C function.
> 
> I looked into the source and found the MAXARG constant in calldll.c, line 66:
> 
> > /* Other constants */
> > #define MAXNAME 31    /* Maximum size of names, for printing only */
> > #define MAXARG 8      /* Maximum number of arguments */
> 
> I changed this constant and the following format and args at line 1073:
> 
> >   /* Note: the next format depends on MAXARG */
> >   if (!PyArg_ParseTuple(args, "O!O&|O&O&O&O&O&O&O&O&", &Cdrtype, &routine,
> >       argparse_rvconv, &rvconv,
> >       argparse_conv, &argconv[0], argparse_conv, &argconv[1],
> >       argparse_conv, &argconv[2], argparse_conv, &argconv[3],
> >       argparse_conv, &argconv[4], argparse_conv, &argconv[5],
> >       argparse_conv, &argconv[6], argparse_conv, &argconv[7]))
> >       return NULL;
> 
> ...and recompiled but the result is crashing hard.

At the very least you'll also have to change the various initializers for 
stackvariables (like c_arg in cdc_call() and argconv in cdll_newcall()), and 
of course the call of (*func) in cdc_call().

But I'm surprised that there are toolbox calls that have more than 8 
arguments. What is the maximum number you have come across?
--
Jack Jansen             | ++++ stop the execution of Mumia Abu-Jamal ++++
Jack.Jansen@oratrix.com | ++++ if you agree copy these lines to your sig ++++
www.oratrix.nl/~jack    | see http://www.xs4all.nl/~tank/spg-l/sigaction.htm