[OpenSER-Devel] SF.net SVN: openser: [2662] trunk/modules

Dan Pascu dan at ag-projects.com
Mon Sep 3 17:15:31 CEST 2007


On Monday 03 September 2007, Henning Westerholt wrote:
> Well, i don't think introducing a wrapper function for all fixup
> functions is really pretty.

I disagree. The module is the only one that has (and should have) 
knowledge of which parameter means what. You moved that decision in a 
function that wants to be generic and this created all the mess.

> Perhaps we can introduce a additional 
> parameter to the function interface? E.g.:
>
> fixup_str2int(void ** param, int param_no, int expected_param_no)
> and return an error if param_no > expected_param?

Then what about a function that receives 2 parameters, a str and an int 
which both need conversion from char* to str respectively int? Will you 
write another special conversion function to handle both arguments? What 
if the function changes and receives the int on the first position and 
the string on the second? How many conversion functions will we need to 
cover all cases?

-- 
Dan



More information about the Devel mailing list