Browse code

Merge commit 'origin/andrei/fixups'

* commit 'origin/andrei/fixups':
fixups: call them even for 0 params. functions
str: kamailio str_init compatibility macro
fparam_t/gparam_t unification

Andrei Pelinescu-Onciul authored on 24/11/2008 13:18:27
Showing 3 changed files
... ...
@@ -512,6 +512,11 @@ static int fix_actions(struct action* a)
512 512
 				if (cmd && cmd->c.fixup) {
513 513
 					int i;
514 514
 					DBG("fixing %s()\n", cmd->c.name);
515
+					if (t->val[1].u.number==0) {
516
+						ret = cmd->c.fixup(0, 0);
517
+						if (ret < 0)
518
+							return ret;
519
+					}
515 520
 					/* type cast NUMBER to STRING, old modules may expect
516 521
 					 * all STRING params during fixup */
517 522
 					for (i=0; i<t->val[1].u.number; i++) {
... ...
@@ -242,7 +242,9 @@ enum {
242 242
 	FPARAM_REGEX  = (1 << 3),
243 243
 	FPARAM_AVP    = (1 << 5),
244 244
 	FPARAM_SELECT = (1 << 6),
245
-	FPARAM_SUBST  = (1 << 7)
245
+	FPARAM_SUBST  = (1 << 7),
246
+	FPARAM_PVS    = (1 << 8),
247
+	FPARAM_PVE    = (1 << 9)
246 248
 };
247 249
 
248 250
 /*
... ...
@@ -257,8 +259,10 @@ typedef struct fparam {
257 259
 		int i;                    /* Integer value */
258 260
 		regex_t* regex;           /* Compiled regular expression */
259 261
 		avp_ident_t avp;          /* AVP identifier */
260
-	        select_t* select;         /* select structure */ 
261
-	        struct subst_expr* subst; /* Regex substitution */
262
+		select_t* select;         /* select structure */ 
263
+		struct subst_expr* subst; /* Regex substitution */
264
+		struct pv_spec_t* pvs;    /* kamailo pseudo-vars */
265
+		struct pv_elem_t* pve;    /* kamailo pseudo-vars */
262 266
 	} v;
263 267
 } fparam_t;
264 268
 
... ...
@@ -84,6 +84,9 @@ typedef struct _str str;
84 84
  */
85 85
 #define STR_STATIC_INIT(v) {(v), sizeof(v) - 1}
86 86
 
87
+/* kamailio compatibility macro (same thing as above) */
88
+#define str_init(v) STR_STATIC_INIT(v)
89
+
87 90
 /** Initializes ::str string with NULL pointer and zero length.
88 91
  * This is a convenience macro that can be used to initialize
89 92
  * ::str string variable to NULL string with zero length: