Просмотр исходного кода

core: kemi - changed SR_KEMIP_INTSTR to SR_KEMIP_XVAL

- added also SR_KEMIP_NULL to mark null values
Daniel-Constantin Mierla 6 лет назад
Родитель
Сommit
a9a8731d37
2 измененных файлов с 11 добавлено и 2 удалено
  1. 1 1
      src/core/kemi.c
  2. 10 1
      src/core/kemi.h

+ 1 - 1
src/core/kemi.c

@@ -2347,7 +2347,7 @@ static sr_kemi_param_map_t _sr_kemi_param_map[] = {
 	{ SR_KEMIP_INT,    str_init("int") },
 	{ SR_KEMIP_STR,    str_init("str") },
 	{ SR_KEMIP_BOOL,   str_init("bool") },
-	{ SR_KEMIP_INTSTR, str_init("int-str") },
+	{ SR_KEMIP_XVAL,   str_init("xval") },
 	{ 0, STR_NULL }
 };
 

+ 10 - 1
src/core/kemi.h

@@ -30,7 +30,8 @@
 #define SR_KEMIP_INT	(1<<0)	/* type integer */
 #define SR_KEMIP_STR	(1<<1)	/* type str* */
 #define SR_KEMIP_BOOL	(1<<2)	/* type boolean (0/1) */
-#define SR_KEMIP_INTSTR	(1<<3)	/* type integer or str* */
+#define SR_KEMIP_XVAL	(1<<3)	/* type extended value (integer, str*, ...) */
+#define SR_KEMIP_NULL	(1<<4)	/* type NULL */
 
 #define SR_KEMI_FALSE	0
 #define SR_KEMI_TRUE	1
@@ -65,6 +66,14 @@ typedef union {
 	str s;
 } sr_kemi_val_t;
 
+typedef struct sr_kemi_xval {
+	int vtype;
+	union {
+		int n;
+		str *s;
+	} v;
+} sr_kemi_xval_t;
+
 /* only sip_msg_t */
 typedef int (*sr_kemi_fm_f)(sip_msg_t*);