[OpenSIPS-Devel] how the parameter number is changed of the modules

Bogdan-Andrei Iancu bogdan at voice-system.ro
Thu Dec 4 13:43:33 CET 2008


Hi,

There is nothing in the middle - even if you define a 3 params function 
and do_action calls it as a 6 params function, it is not a problem in C 
- the additional params will be pushed on the stack (at function call), 
but the function will not use them.

Regards,
Bogdan

nyhenry1 wrote:
> Hi
> I do not know how the parameter number is changed in the module most
> of the function has less than 6 parameters.However in the function 
> call of the action.c file do_action in the MODULE_T case
> i f((a->elem[0].type==EXPR_ST)&&a->elem[0].u.data){
> rt_t*)(a->elem[0].u.data))->function(msg,
> (char*)a->elem[1].u.data, (char*)a->elem[2].u.data,
> (char*)a->elem[3].u.data, (char*)a->elem[4].u.data,
> (char*)a->elem[5].u.data, (char*)a->elem[6].u.data);
> there are 6 parameters for each function call no matter how it is 
> defined in the module.
> My question is the module function must be changed somewhere before it 
> is called in the do_action but actually where it is changed and how it 
> is changed. Thank you for those who read my questions.
> Xiao Han
>
>
> ------------------------------------------------------------------------
> 网易免费邮,全球最大的中文免费邮箱 <http://www.yeah.net>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Devel mailing list
> Devel at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/devel
>   




More information about the Devel mailing list