Module: kamailio
Branch: master
Commit: 19e91e097a851cc8c169c9c3144e2ab7669a5b71
URL:
https://github.com/kamailio/kamailio/commit/19e91e097a851cc8c169c9c3144e2ab…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2024-03-22T09:43:25+01:00
core: fixup helpers for functions with strings and output variable params
---
Modified: src/core/mod_fix.c
Modified: src/core/mod_fix.h
---
Diff:
https://github.com/kamailio/kamailio/commit/19e91e097a851cc8c169c9c3144e2ab…
Patch:
https://github.com/kamailio/kamailio/commit/19e91e097a851cc8c169c9c3144e2ab…
---
diff --git a/src/core/mod_fix.c b/src/core/mod_fix.c
index 10be560982f..520ed44708c 100644
--- a/src/core/mod_fix.c
+++ b/src/core/mod_fix.c
@@ -730,11 +730,11 @@ int fixup_free_spve_spve_igp(void **param, int param_no)
/**
*
*/
-int fixup_spve_pvar(void **param, int param_no)
+int fixup_spve_n_pvar(void **param, int n, int param_no)
{
- if(param_no == 1)
+ if(param_no >= 1 && param_no <= n)
return fixup_spve_null(param, 1);
- if(param_no == 2)
+ if(param_no == n + 1)
return fixup_pvar_null(param, 1);
return E_UNSPEC;
}
@@ -742,15 +742,79 @@ int fixup_spve_pvar(void **param, int param_no)
/**
*
*/
-int fixup_free_spve_pvar(void **param, int param_no)
+int fixup_free_spve_n_pvar(void **param, int n, int param_no)
{
- if(param_no == 1)
+ if(param_no >= 1 && param_no <= n)
return fixup_free_spve_null(param, 1);
- if(param_no == 2)
+ if(param_no == n + 1)
return fixup_free_pvar_null(param, 1);
return E_UNSPEC;
}
+/**
+ *
+ */
+int fixup_spve_pvar(void **param, int param_no)
+{
+ return fixup_spve_n_pvar(param, 1, param_no);
+}
+
+/**
+ *
+ */
+int fixup_free_spve_pvar(void **param, int param_no)
+{
+ return fixup_free_spve_n_pvar(param, 1, param_no);
+}
+
+/**
+ *
+ */
+int fixup_spve2_pvar(void **param, int param_no)
+{
+ return fixup_spve_n_pvar(param, 2, param_no);
+}
+
+/**
+ *
+ */
+int fixup_free_spve2_pvar(void **param, int param_no)
+{
+ return fixup_free_spve_n_pvar(param, 2, param_no);
+}
+
+/**
+ *
+ */
+int fixup_spve3_pvar(void **param, int param_no)
+{
+ return fixup_spve_n_pvar(param, 3, param_no);
+}
+
+/**
+ *
+ */
+int fixup_free_spve3_pvar(void **param, int param_no)
+{
+ return fixup_free_spve_n_pvar(param, 3, param_no);
+}
+
+/**
+ *
+ */
+int fixup_spve4_pvar(void **param, int param_no)
+{
+ return fixup_spve_n_pvar(param, 4, param_no);
+}
+
+/**
+ *
+ */
+int fixup_free_spve4_pvar(void **param, int param_no)
+{
+ return fixup_free_spve_n_pvar(param, 4, param_no);
+}
+
/**
*
*/
diff --git a/src/core/mod_fix.h b/src/core/mod_fix.h
index 3143f060426..a202c4ade2b 100644
--- a/src/core/mod_fix.h
+++ b/src/core/mod_fix.h
@@ -148,6 +148,12 @@ int fixup_spve_igp(void **param, int param_no);
int fixup_free_spve_igp(void **param, int param_no);
int fixup_spve_pvar(void **param, int param_no);
int fixup_free_spve_pvar(void **param, int param_no);
+int fixup_spve2_pvar(void **param, int param_no);
+int fixup_free_spve2_pvar(void **param, int param_no);
+int fixup_spve3_pvar(void **param, int param_no);
+int fixup_free_spve3_pvar(void **param, int param_no);
+int fixup_spve4_pvar(void **param, int param_no);
+int fixup_free_spve4_pvar(void **param, int param_no);
int fixup_spve_spve_igp(void **param, int param_no);
int fixup_free_spve_spve_igp(void **param, int param_no);