Module: sip-router
Branch: master
Commit: 290e94777e85eae44c170f3a70271e58e35bcd7c
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=290e947…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Fri Apr 17 00:30:14 2009 +0200
textops: added implementation of free_/fixup_regexp_none()
---
modules_k/textops/textops.c | 36 ++++++++++++++++++++++++++++++++++++
modules_k/textops/textops.h | 3 ++-
2 files changed, 38 insertions(+), 1 deletions(-)
diff --git a/modules_k/textops/textops.c b/modules_k/textops/textops.c
index 489db21..ae40e1a 100644
--- a/modules_k/textops/textops.c
+++ b/modules_k/textops/textops.c
@@ -1811,3 +1811,39 @@ int fixup_regexpNL_none(void** param, int param_no)
*param=re;
return 0;
}
+
+/*! \brief
+ * fixup for functions that get two parameters
+ * - first parameter is converted to regular expression structure
+ * - second parameter is not converted
+ */
+int fixup_regexp_none(void** param, int param_no)
+{
+ if (param_no != 1 && param_no != 2 )
+ {
+ LM_ERR("invalid parameter number %d\n", param_no);
+ return E_UNSPEC;
+ }
+ if (param_no == 1)
+ return fixup_regexp_null(param, 1);
+ return 0;
+}
+
+/**
+ * fixup free for functions that get two parameters
+ * - first parameter was converted to regular expression
+ * - second parameter was notconverted
+ */
+int fixup_free_regexp_none(void** param, int param_no)
+{
+ if (param_no != 1 && param_no != 2 )
+ {
+ LM_ERR("invalid parameter number %d\n", param_no);
+ return E_UNSPEC;
+ }
+ if (param_no == 1)
+ return fixup_free_regexp_null(param, 1);
+ return 0;
+}
+
+
diff --git a/modules_k/textops/textops.h b/modules_k/textops/textops.h
index 42b47ac..39168f4 100644
--- a/modules_k/textops/textops.h
+++ b/modules_k/textops/textops.h
@@ -31,5 +31,6 @@ int search_append_f(struct sip_msg*, char*, char*);
int remove_hf_f(struct sip_msg* msg, char* str_hf, char* foo);
int add_hf_helper(struct sip_msg* msg, str *str1, str *str2, gparam_p hfval, int mode,
gparam_p hfanc);
-
+int fixup_regexp_none(void** param, int param_no);
+int fixup_free_regexp_none(void** param, int param_no);
#endif /*TEXTOPS_H_*/