[KLUG Programming] Passing on variable argument lists.

Robert G. Brown programming@kalamazoolinux.org
Sun, 08 Feb 2004 14:27:58 -0500


I beleive you want the man page for stdarg. These are macros for 
variable-length parameter lists.  Let us know if this is the right thing, it 
will tell me (and probably others on this list) about what you're doing.

							Regards,
							---> RGB <---

On Sun, 08 Feb 2004 14:03:07 -0500, Adam Williams <awilliam@whitemice.org> wrote:

>In C you can define a function to take a variable argument list like -
>xmlrpc_client_call_server (xmlrpc_env *env,
>                           xmlrpc_server_info *server,
>                           char *method_name,
>                           char *args_format,
>                           ...);
>- which in essence means there are as many "char *args_format"s as there
>needs to be;  and the function iterates through them.
>
>I'm curious how you can 'pass on' a variable argument list;  say have a
>function that takes one and then passws it it another, like -
>
>char* foobar(char* param1, char* param2, char* moreparams, ....) {
> ...blah...blah
>  xmlrpc_client_call_server (xmlrpc_env *env,
>                             xmlrpc_server_info *server,
>                             param2,
>                             moreparams);
> ...blah...blah
> return ...
>}
>
>Would that work?   Would xmlrpc_client_call_server accept "moreparams"
>as a bunch of arguments or would the ellipses-ness have been lost?
>
>
>_______________________________________________
>Programming mailing list
>Programming@kalamazoolinux.org
>http://www.kalamazoolinux.org/mailman/listinfo/programming