Skip to content

Commit

Permalink
app_python: fix for executing kemi functions with 4 or more params
Browse files Browse the repository at this point in the history
- more combinations for 4 params

(cherry picked from commit 551e4d3)
  • Loading branch information
miconda committed May 31, 2018
1 parent b25d700 commit 7999ddc
Showing 1 changed file with 31 additions and 15 deletions.
46 changes: 31 additions & 15 deletions src/modules/app_python/apy_kemi.c
Expand Up @@ -578,21 +578,37 @@ PyObject *sr_apy_kemi_exec_func(PyObject *self, PyObject *args, int idx)
break;
case 4:
if(ket->ptypes[0]==SR_KEMIP_STR
|| ket->ptypes[1]==SR_KEMIP_STR
|| ket->ptypes[2]==SR_KEMIP_STR
|| ket->ptypes[3]==SR_KEMIP_STR) {
&& ket->ptypes[1]==SR_KEMIP_STR
&& ket->ptypes[2]==SR_KEMIP_STR
&& ket->ptypes[3]==SR_KEMIP_STR) {
/* ssss */
ret = ((sr_kemi_fmssss_f)(ket->func))(lmsg,
&vps[0].s, &vps[1].s, &vps[2].s, &vps[3].s);
return sr_kemi_apy_return_int(ket, ret);
} else if(ket->ptypes[0]==SR_KEMIP_STR
|| ket->ptypes[1]==SR_KEMIP_STR
|| ket->ptypes[2]==SR_KEMIP_INT
|| ket->ptypes[3]==SR_KEMIP_INT) {
&& ket->ptypes[1]==SR_KEMIP_STR
&& ket->ptypes[2]==SR_KEMIP_STR
&& ket->ptypes[3]==SR_KEMIP_INT) {
/* ssnn */
ret = ((sr_kemi_fmsssn_f)(ket->func))(lmsg,
&vps[0].s, &vps[1].s, &vps[2].s, vps[3].n);
return sr_kemi_apy_return_int(ket, ret);
} else if(ket->ptypes[0]==SR_KEMIP_STR
&& ket->ptypes[1]==SR_KEMIP_STR
&& ket->ptypes[2]==SR_KEMIP_INT
&& ket->ptypes[3]==SR_KEMIP_INT) {
/* ssnn */
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_INT
&& ket->ptypes[1]==SR_KEMIP_STR
&& ket->ptypes[2]==SR_KEMIP_STR
&& ket->ptypes[3]==SR_KEMIP_STR) {
/* ssnn */
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 {
LM_ERR("invalid parameters for: %.*s\n",
fname.len, fname.s);
Expand All @@ -601,10 +617,10 @@ PyObject *sr_apy_kemi_exec_func(PyObject *self, PyObject *args, int idx)
break;
case 5:
if(ket->ptypes[0]==SR_KEMIP_STR
|| ket->ptypes[1]==SR_KEMIP_STR
|| ket->ptypes[2]==SR_KEMIP_STR
|| ket->ptypes[3]==SR_KEMIP_STR
|| ket->ptypes[4]==SR_KEMIP_STR) {
&& ket->ptypes[1]==SR_KEMIP_STR
&& ket->ptypes[2]==SR_KEMIP_STR
&& ket->ptypes[3]==SR_KEMIP_STR
&& ket->ptypes[4]==SR_KEMIP_STR) {
/* sssss */
ret = ((sr_kemi_fmsssss_f)(ket->func))(lmsg,
&vps[0].s, &vps[1].s, &vps[2].s, &vps[3].s,
Expand All @@ -618,11 +634,11 @@ PyObject *sr_apy_kemi_exec_func(PyObject *self, PyObject *args, int idx)
break;
case 6:
if(ket->ptypes[0]==SR_KEMIP_STR
|| ket->ptypes[1]==SR_KEMIP_STR
|| ket->ptypes[2]==SR_KEMIP_STR
|| ket->ptypes[3]==SR_KEMIP_STR
|| ket->ptypes[4]==SR_KEMIP_STR
|| ket->ptypes[5]==SR_KEMIP_STR) {
&& ket->ptypes[1]==SR_KEMIP_STR
&& ket->ptypes[2]==SR_KEMIP_STR
&& ket->ptypes[3]==SR_KEMIP_STR
&& ket->ptypes[4]==SR_KEMIP_STR
&& ket->ptypes[5]==SR_KEMIP_STR) {
/* ssssss */
ret = ((sr_kemi_fmssssss_f)(ket->func))(lmsg,
&vps[0].s, &vps[1].s, &vps[2].s, &vps[3].s,
Expand Down

0 comments on commit 7999ddc

Please sign in to comment.