Skip to content

Commit

Permalink
app_python: implement missing types for 3 params
Browse files Browse the repository at this point in the history
(cherry picked from commit 261cb0f)
(cherry picked from commit 695bdaf)
  • Loading branch information
miconda committed Sep 26, 2019
1 parent f9e3a89 commit 7ff08c1
Showing 1 changed file with 36 additions and 11 deletions.
47 changes: 36 additions & 11 deletions src/modules/app_python/apy_kemi.c
Expand Up @@ -288,16 +288,16 @@ PyObject *sr_apy_kemi_exec_func(PyObject *self, PyObject *args, int idx)
}
LM_DBG("params[%d] for: %.*s are int-int-int: [%d] [%d] [%d]\n",
i, fname.len, fname.s, vps[0].n, vps[1].n, vps[2].n);
} else if(ket->ptypes[0]==SR_KEMIP_INT && ket->ptypes[1]==SR_KEMIP_INT
&& ket->ptypes[2]==SR_KEMIP_STR) {
if(!PyArg_ParseTuple(args, "iis:kemi-param-nns", &vps[0].n,
&vps[1].n, &vps[2].s.s)) {
LM_ERR("unable to retrieve int-int-str params %d\n", i);
return sr_kemi_apy_return_false();
}
vps[2].s.len = strlen(vps[2].s.s);
LM_DBG("params[%d] for: %.*s are int-int-str: [%d] [%d] [%.*s]\n", i,
fname.len, fname.s, vps[0].n, vps[1].n, vps[2].s.len, vps[2].s.s);
} else if(ket->ptypes[0]==SR_KEMIP_INT && ket->ptypes[1]==SR_KEMIP_INT
&& ket->ptypes[2]==SR_KEMIP_STR) {
if(!PyArg_ParseTuple(args, "iis:kemi-param-nns", &vps[0].n,
&vps[1].n, &vps[2].s.s)) {
LM_ERR("unable to retrieve int-int-str params %d\n", i);
return sr_kemi_apy_return_false();
}
vps[2].s.len = strlen(vps[2].s.s);
LM_DBG("params[%d] for: %.*s are int-int-str: [%d] [%d] [%.*s]\n", i,
fname.len, fname.s, vps[0].n, vps[1].n, vps[2].s.len, vps[2].s.s);
} else if(ket->ptypes[0]==SR_KEMIP_INT && ket->ptypes[1]==SR_KEMIP_STR
&& ket->ptypes[2]==SR_KEMIP_INT) {
if(!PyArg_ParseTuple(args, "isi:kemi-param-nsn", &vps[0].n,
Expand All @@ -308,6 +308,18 @@ PyObject *sr_apy_kemi_exec_func(PyObject *self, PyObject *args, int idx)
vps[1].s.len = strlen(vps[1].s.s);
LM_DBG("params[%d] for: %.*s are int-str-int: [%d] [%.*s] [%d]\n", i,
fname.len, fname.s, vps[0].n, vps[1].s.len, vps[1].s.s, vps[2].n);
} else if(ket->ptypes[0]==SR_KEMIP_INT && ket->ptypes[1]==SR_KEMIP_STR
&& ket->ptypes[2]==SR_KEMIP_STR) {
if(!PyArg_ParseTuple(args, "iss:kemi-param-nss", &vps[0].n,
&vps[1].s.s, &vps[2].s.s)) {
LM_ERR("unable to retrieve int-str-str param %d\n", i);
return sr_kemi_apy_return_false();
}
vps[1].s.len = strlen(vps[1].s.s);
vps[2].s.len = strlen(vps[2].s.s);
LM_DBG("params[%d] for: %.*s are int-str-str: [%d] [%.*s]"
" [%.*s]\n", i, fname.len, fname.s,
vps[0].n, vps[1].s.len, vps[1].s.s, vps[2].s.len, vps[2].s.s);
} else if(ket->ptypes[0]==SR_KEMIP_STR && ket->ptypes[1]==SR_KEMIP_INT
&& ket->ptypes[2]==SR_KEMIP_INT) {
if(!PyArg_ParseTuple(args, "sii:kemi-param-snn", &vps[0].s.s,
Expand All @@ -319,6 +331,19 @@ PyObject *sr_apy_kemi_exec_func(PyObject *self, PyObject *args, int idx)
LM_DBG("params[%d] for: %.*s are str-int: [%.*s] [%d] [%d]\n", i,
fname.len, fname.s, vps[0].s.len, vps[0].s.s, vps[1].n,
vps[2].n);
} else if(ket->ptypes[0]==SR_KEMIP_STR && ket->ptypes[1]==SR_KEMIP_INT
&& ket->ptypes[2]==SR_KEMIP_STR) {
if(!PyArg_ParseTuple(args, "sis:kemi-param-ssn", &vps[0].s.s,
&vps[1].n, &vps[2].s.s)) {
LM_ERR("unable to retrieve str-int-str param %d\n", i);
return sr_kemi_apy_return_false();
}
vps[0].s.len = strlen(vps[0].s.s);
vps[2].s.len = strlen(vps[2].s.s);
LM_DBG("params[%d] for: %.*s are str-str-int: [%.*s] [%d] [%.*s]\n",
i, fname.len, fname.s,
vps[0].s.len, vps[0].s.s,
vps[1].n, vps[2].s.len, vps[2].s.s);
} else if(ket->ptypes[0]==SR_KEMIP_STR && ket->ptypes[1]==SR_KEMIP_STR
&& ket->ptypes[2]==SR_KEMIP_INT) {
if(!PyArg_ParseTuple(args, "ssi:kemi-param-ssn", &vps[0].s.s,
Expand All @@ -342,7 +367,7 @@ PyObject *sr_apy_kemi_exec_func(PyObject *self, PyObject *args, int idx)
vps[0].s.len = strlen(vps[0].s.s);
vps[1].s.len = strlen(vps[1].s.s);
vps[2].s.len = strlen(vps[2].s.s);
LM_DBG("params[%d] for: %.*s are str-str-int: [%.*s] [%.*s]"
LM_DBG("params[%d] for: %.*s are str-str-str: [%.*s] [%.*s]"
" [%.*s]\n", i, fname.len, fname.s,
vps[0].s.len, vps[0].s.s,
vps[1].s.len, vps[1].s.s, vps[2].s.len, vps[2].s.s);
Expand Down

0 comments on commit 7ff08c1

Please sign in to comment.