[OpenSER-Devel] Request for comment: module interface extension
Dan Pascu
dan at ag-projects.com
Mon Dec 17 16:49:37 UTC 2007
On Monday 17 December 2007, Henning Westerholt wrote:
> I take a look into this mechanism. You simply change the char** to the
> va_list type.
No I don't.
> Additionally you need to call va_start and va_end at
> every access to the commands. You need to carry the number of
> parameters with you in both cases, as va_args return undefined results
No I don't. You misunderstood what I propose. Check my last email where I
gave more detail. What I'm thinking of will give variable arguments
without changing the actual model at all.
> if you access parameters that are not included in the actual function
> call. You can not access the parameters simply here with array indexes
> like command[0], its necessary to walk linear over the list every time.
> You need to specify the actual type of every parameter that you want to
> access for the va_arg call.
> I do not think this make the whole stuff more transparent or
> convinient.
That's because you think of something different than what I had in mind.
> I think its mainly a matter of taste. Both ways of specifying
> additional parameters are roughly equivalent.
hardly
> I would go with the
> char** case, because its more comfortable, as you don't need the
> va_start, va_end stuff,
again, you don't
> and you can access the commands just with an
> array index.
in what I propose you access the arguments just like function arguments.
no array, no va_something unless you want to write a single function to
handle multiple signatures.
--
Dan
More information about the Devel
mailing list