Browse code

Few kamailio compatiblity macros

New macros:
* AVP_NAME_VALUE_MASK
* AVP_CORE_MASK
* AVP_SCRIPT_MASK
* avp_core_flags
* avp_script_flags
* avp_get_script_flags
* is_avp_str_name
* is_avp_str_val

Jan Janak authored on 08/03/2009 22:05:23
Showing 1 changed files
... ...
@@ -157,6 +157,17 @@ typedef struct avp_spec {
157 157
 
158 158
 #define GALIAS_CHAR_MARKER  '$'
159 159
 
160
+#define AVP_NAME_VALUE_MASK     0x0007
161
+#define AVP_CORE_MASK           0x00ff
162
+#define AVP_SCRIPT_MASK         0xff00
163
+#define avp_core_flags(f)       ((f)&0x00ff)
164
+#define avp_script_flags(f)     (((f)<<8)&0xff00)
165
+#define avp_get_script_flags(f) (((f)&0xff00)>>8)
166
+
167
+#define is_avp_str_name(a)      ((a)->flags&AVP_NAME_STR)
168
+#define is_avp_str_val(a)       ((a)->flags&AVP_VAL_STR)
169
+
170
+
160 171
 #define AVP_IS_ASSIGNABLE(ident) ( ((ident).flags & AVP_NAME_RE) == 0 && (((ident).flags & AVP_NAME) == 0 || (((ident)->flags & AVP_NAME) && (ident).name.s.len)) )
161 172
 /* Initialize memory structures */
162 173
 int init_avps(void);