Skip to content

Commit

Permalink
app_python: support for functions with more combinations of 4 params
Browse files Browse the repository at this point in the history
  • Loading branch information
miconda committed Jun 25, 2018
1 parent 08f942c commit 48de203
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions src/modules/app_python3/apy_kemi.c
Original file line number Diff line number Diff line change
Expand Up @@ -607,6 +607,14 @@ PyObject *sr_apy_kemi_exec_func(PyObject *self, PyObject *args, int idx)
ret = ((sr_kemi_fmssnn_f)(ket->func))(lmsg,
&vps[0].s, &vps[1].s, vps[2].n, vps[3].n);
return sr_kemi_apy_return_int(ket, ret);
} else if(ket->ptypes[0]==SR_KEMIP_STR
&& ket->ptypes[1]==SR_KEMIP_INT
&& ket->ptypes[2]==SR_KEMIP_INT
&& ket->ptypes[3]==SR_KEMIP_INT) {
/* snnn */
ret = ((sr_kemi_fmsnnn_f)(ket->func))(lmsg,
&vps[0].s, vps[1].n, vps[2].n, vps[3].n);
return sr_kemi_apy_return_int(ket, ret);
} else if(ket->ptypes[0]==SR_KEMIP_INT
&& ket->ptypes[1]==SR_KEMIP_STR
&& ket->ptypes[2]==SR_KEMIP_STR
Expand All @@ -615,6 +623,30 @@ PyObject *sr_apy_kemi_exec_func(PyObject *self, PyObject *args, int idx)
ret = ((sr_kemi_fmnsss_f)(ket->func))(lmsg,
vps[0].n, &vps[1].s, &vps[2].s, &vps[3].s);
return sr_kemi_apy_return_int(ket, ret);
} else if(ket->ptypes[0]==SR_KEMIP_INT
&& ket->ptypes[1]==SR_KEMIP_INT
&& ket->ptypes[2]==SR_KEMIP_STR
&& ket->ptypes[3]==SR_KEMIP_STR) {
/* nnss */
ret = ((sr_kemi_fmnnss_f)(ket->func))(lmsg,
vps[0].n, vps[1].n, &vps[2].s, &vps[3].s);
return sr_kemi_apy_return_int(ket, ret);
} else if(ket->ptypes[0]==SR_KEMIP_INT
&& ket->ptypes[1]==SR_KEMIP_INT
&& ket->ptypes[2]==SR_KEMIP_INT
&& ket->ptypes[3]==SR_KEMIP_STR) {
/* nnns */
ret = ((sr_kemi_fmnnns_f)(ket->func))(lmsg,
vps[0].n, vps[1].n, vps[2].n, &vps[3].s);
return sr_kemi_apy_return_int(ket, ret);
} else if(ket->ptypes[0]==SR_KEMIP_INT
&& ket->ptypes[1]==SR_KEMIP_INT
&& ket->ptypes[2]==SR_KEMIP_INT
&& ket->ptypes[3]==SR_KEMIP_INT) {
/* nnnn */
ret = ((sr_kemi_fmnnnn_f)(ket->func))(lmsg,
vps[0].n, vps[1].n, vps[2].n, vps[3].n);
return sr_kemi_apy_return_int(ket, ret);
} else {
LM_ERR("invalid parameters for: %.*s\n",
fname.len, fname.s);
Expand Down

0 comments on commit 48de203

Please sign in to comment.