curl-library
Max number of args to curl_formadd()
Date: Fri, 22 Nov 2002 02:24:49 -0800 (PST)
Still trying to get the curl_formadd() function
implemented across FreePascal/Delphi/Kylix.
Delphi and Kylix understand something called a
"varargs" directive that allows the function to
be called just as it would be in "C".
But FreePascal takes a slightly different approach,
so I need to declare overloaded versions for each
possible number of arguments.
As far as i can tell, the criteria is something
like this:
1. The first two arguments are always pointers to
Curl_httppost pointers.
2. Between the second and last arguments is *some*
number of pairs of arguments, always in the form
of a flag followed by a value. ( Is this correct? )
3, The last argument is always the "CURLFORM_END"
flag.
So the question is, just how many possible flag/value
pairs can there be? Maybe six? Or maybe five thousand?
There appears to be nineteen flags, but some of them,
like CURLFORM_OBSOLETE and CURLFORM_LASTENTRY would
never be used, while others, like
CURLFORM_COPYCONTENTS
and CURLFORM_PTRCONTENTS would be mutually exclusive.
Using the example from the man page, it looks like
this one has the longest argument list:
curl_formadd(
&post, &last,
CURLFORM_COPYNAME, "html_code_with_hole",
CURLFORM_PTRCONTENTS, htmlbuffer,
CURLFORM_CONTENTSLENGTH, htmlbufferlength,
CURLFORM_CONTENTTYPE, "text/html",
CURLFORM_END);
- This uses four flag/value pairs for a total of
eleven parameters.
Would there ever be a situation where someone might
need more?
Thanks in advance,
- Jeff
__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus – Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
Received on 2002-11-22