[sr-dev] git:master: core: add is_in_str macro to ut. h and remove all local definitions

Alex Hermann alex at speakup.nl
Sat Aug 20 10:25:28 CEST 2011


Module: sip-router
Branch: master
Commit: 7d5f08c3b594bf2444901caa6f8bdf56dcb60ba5
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=7d5f08c3b594bf2444901caa6f8bdf56dcb60ba5

Author: Alex Hermann <alex at speakup.nl>
Committer: Alex Hermann <alex at speakup.nl>
Date:   Fri Aug 19 11:40:57 2011 +0200

core: add is_in_str macro to ut.h and remove all local definitions

---

 modules_k/pv/pv_trans.c      |    1 -
 modules_k/sqlops/sql_trans.c |    3 +--
 modules_k/textops/txt_var.c  |    3 +--
 pvapi.c                      |    2 --
 ut.h                         |    3 +++
 5 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/modules_k/pv/pv_trans.c b/modules_k/pv/pv_trans.c
index a3175f6..0b38238 100644
--- a/modules_k/pv/pv_trans.c
+++ b/modules_k/pv/pv_trans.c
@@ -47,7 +47,6 @@
 #include "../../lib/kcore/strcommon.h"
 #include "pv_trans.h"
 
-#define is_in_str(p, in) (p<in->s+in->len && *p)
 
 /*! transformation buffer size */
 #define TR_BUFFER_SIZE 65536
diff --git a/modules_k/sqlops/sql_trans.c b/modules_k/sqlops/sql_trans.c
index 50ecc06..eaf3fb8 100644
--- a/modules_k/sqlops/sql_trans.c
+++ b/modules_k/sqlops/sql_trans.c
@@ -28,12 +28,11 @@
 #include "../../mem/mem.h"
 #include "../../dprint.h"
 #include "../../trim.h"
+#include "../../ut.h"
 #include "../../lib/kcore/strcommon.h"
 
 #include "sql_trans.h"
 
-#define is_in_str(p, in) (p<in->s+in->len && *p)
-
 #define TR_BUFFER_SIZE 2048
 
 
diff --git a/modules_k/textops/txt_var.c b/modules_k/textops/txt_var.c
index c63e3a0..ca11a9e 100644
--- a/modules_k/textops/txt_var.c
+++ b/modules_k/textops/txt_var.c
@@ -29,11 +29,10 @@
 #include "../../dprint.h"
 #include "../../trim.h"
 #include "../../re.h"
+#include "../../ut.h"
 
 #include "txt_var.h"
 
-#define is_in_str(p, in) (p<in->s+in->len && *p)
-
 int tr_txt_eval_re(struct sip_msg *msg, tr_param_t *tp, int subtype,
 		pv_value_t *val)
 {
diff --git a/pvapi.c b/pvapi.c
index 242093c..eb3069c 100644
--- a/pvapi.c
+++ b/pvapi.c
@@ -40,8 +40,6 @@
 #include "pvapi.h"
 #include "pvar.h"
 
-#define is_in_str(p, in) (p<in->s+in->len && *p)
-
 #define PV_TABLE_SIZE	16 /*!< pseudo-variable table size */
 #define TR_TABLE_SIZE	4  /*!< PV transformation size */
 
diff --git a/ut.h b/ut.h
index 04ce934..eaec93f 100644
--- a/ut.h
+++ b/ut.h
@@ -158,6 +158,9 @@
 	*((_dest)++) = _c;
 
 
+#define is_in_str(p, in) (p < in->s + in->len && *p)
+
+
 /* links a value to a msgid */
 struct msgid_var{
 	union{




More information about the sr-dev mailing list