[SR-Dev] git:sip-router: mod if: more prototypes and defines

Henning Westerholt henning.westerholt at 1und1.de
Thu Nov 20 18:02:28 CET 2008


On Thursday 20 November 2008, Andrei Pelinescu-Onciul wrote:
> [..]
> Example for a variable number of parameters function:
>
> static cmd_export_t cmds[]={
>     {"print", print_f_0, 0, 0, REQUEST_ROUTE},   // overload test
>     {"print", print_f_1, 1, print_fixup_f_1, REQUEST_ROUTE},
>     {"print", print_f_2, 2, print_fixup_f_2, REQUEST_ROUTE},
>     {"print", (cmd_function)print_f_var, VAR_PARAM_NO, 0,  REQUEST_ROUTE},
>      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>     {0, 0, 0, 0, 0}
> };

Hi Andrei,

thank you for providing this. I found working with a bunch of function 
parametern is much more natural then providing different "avp_foo" variables 
that are used in other modules as a workaround. Where one should check for a 
valid number of parameters  when this VAR_PARAM_NO is used? In the fixup 
function, or the function implementation?

Cheers,

Henning



More information about the sr-dev mailing list