2
0
Эх сурвалжийг харах

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

Alex Hermann 14 жил өмнө
parent
commit
7d5f08c3b5

+ 0 - 1
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

+ 1 - 2
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
 
 

+ 1 - 2
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)
 {

+ 0 - 2
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 */
 

+ 3 - 0
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{