浏览代码

- more flexibil interface for accessing avps

Bogdan-Andrei Iancu 21 年之前
父节点
当前提交
a564ae7a65
共有 2 个文件被更改,包括 14 次插入4 次删除
  1. 11 3
      usr_avp.c
  2. 3 1
      usr_avp.h

+ 11 - 3
usr_avp.c

@@ -27,6 +27,7 @@
  * History:
  * ---------
  *  2004-07-21  created (bogdan)
+ *  2004-10-09  interface more flexibil - more function available (bogdan)
  */
 
 
@@ -141,7 +142,9 @@ error:
 }
 
 
-inline static str* get_avp_name(struct usr_avp *avp)
+/* get value functions */
+
+inline str* get_avp_name(struct usr_avp *avp)
 {
 	switch ( avp->flags&(AVP_NAME_STR|AVP_VAL_STR) )
 	{
@@ -164,8 +167,6 @@ inline static str* get_avp_name(struct usr_avp *avp)
 }
 
 
-/* get value functions */
-
 inline void get_avp_val(struct usr_avp *avp, int_str *val)
 {
 	if (avp==0 || val==0)
@@ -192,6 +193,13 @@ inline void get_avp_val(struct usr_avp *avp, int_str *val)
 }
 
 
+struct usr_avp** get_avp_list( )
+{
+	assert( crt_avps!=0 );
+	return crt_avps;
+}
+
+
 
 
 /* search functions */

+ 3 - 1
usr_avp.h

@@ -68,9 +68,11 @@ void destroy_avp( struct usr_avp *avp);
 void destroy_avp_list( struct usr_avp **list );
 void destroy_avp_list_unsafe( struct usr_avp **list );
 
-/* get val func */
+/* get func */
 void get_avp_val(struct usr_avp *avp, int_str *val );
+str* get_avp_name(struct usr_avp *avp);
 struct usr_avp** set_avp_list( struct usr_avp **list );
+struct usr_avp** get_avp_list( );
 
 
 #endif