[Asterisk-cvs] asterisk/include/asterisk channel.h, 1.63, 1.64 utils.h, 1.10, 1.11

markster at lists.digium.com markster at lists.digium.com
Wed Dec 15 22:18:42 CST 2004


Update of /usr/cvsroot/asterisk/include/asterisk
In directory mongoose.digium.com:/tmp/cvs-serv1313/include/asterisk

Modified Files:
	channel.h utils.h 
Log Message:
Merge russell's flag macro patch (with slight mods) (bug #3046)


Index: channel.h
===================================================================
RCS file: /usr/cvsroot/asterisk/include/asterisk/channel.h,v
retrieving revision 1.63
retrieving revision 1.64
diff -u -d -r1.63 -r1.64
--- channel.h	14 Dec 2004 23:36:30 -0000	1.63
+++ channel.h	16 Dec 2004 03:15:20 -0000	1.64
@@ -231,43 +231,6 @@
 #define AST_FLAG_ZOMBIE		(1 << 4)	/* if we are a zombie */
 #define AST_FLAG_EXCEPTION	(1 << 5)	/* if there is a pending exception */
 
-static inline int ast_test_flag(struct ast_channel *chan, int mode)
-{
-	return chan->flags & mode;
-}
-
-static inline void ast_set_flag(struct ast_channel *chan, int mode)
-{
-	chan->flags |= mode;
-}
-
-static inline void ast_clear_flag(struct ast_channel *chan, int mode)
-{
-	chan->flags &= ~mode;
-}
-
-static inline void ast_copy_flags(struct ast_channel *dest, struct ast_channel *src, int flags)
-{
-	dest->flags &= ~flags;
-	dest->flags |= (src->flags & flags);
-}
-
-static inline void ast_set2_flag(struct ast_channel *chan, int value, int mode)
-{
-	if (value)
-		ast_set_flag(chan, mode);
-	else
-		ast_clear_flag(chan, mode);
-}
-
-static inline void ast_dup_flag(struct ast_channel *dstchan, struct ast_channel *srcchan, int mode)
-{
-	if (ast_test_flag(srcchan, mode))
-		ast_set_flag(dstchan, mode);
-	else
-		ast_clear_flag(dstchan, mode);
-}	
-
 struct ast_bridge_config {
 	int play_to_caller;
 	int play_to_callee;

Index: utils.h
===================================================================
RCS file: /usr/cvsroot/asterisk/include/asterisk/utils.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- utils.h	17 Oct 2004 22:13:05 -0000	1.10
+++ utils.h	16 Dec 2004 03:15:20 -0000	1.11
@@ -17,6 +17,17 @@
 #include <pthread.h>
 #include <asterisk/lock.h>
 
+#define ast_test_flag(p,flag) 		((p)->flags & (flag))
+
+#define ast_set_flag(p,flag)		((p)->flags |= (flag))
+
+#define ast_clear_flag(p,flag)		((p)->flags &= ~(flag))
+
+#define ast_copy_flags(dest,src,flagz)	do { dest->flags &= ~(flagz); \
+					dest->flags |= (src->flags & flagz); } while(0)
+
+#define ast_set2_flag(p,value,flag)	((value) ? ast_set_flag(p,flag) : ast_clear_flag(p,flag))	
+
 static inline int ast_strlen_zero(const char *s)
 {
 	return (*s == '\0');




More information about the svn-commits mailing list