[Asterisk-cvs] asterisk/include/asterisk app.h, 1.23, 1.24 cdr.h, 1.16, 1.17 channel.h, 1.70, 1.71 dundi.h, 1.5, 1.6 utils.h, 1.15, 1.16

markster at lists.digium.com markster at lists.digium.com
Mon Jan 10 08:42:44 CST 2005


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

Modified Files:
	app.h cdr.h channel.h dundi.h utils.h 
Log Message:
More flagification, courtesy drumkilla (bug #3280)


Index: app.h
===================================================================
RCS file: /usr/cvsroot/asterisk/include/asterisk/app.h,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- app.h	9 Jan 2005 09:01:40 -0000	1.23
+++ app.h	10 Jan 2005 14:46:59 -0000	1.24
@@ -60,10 +60,10 @@
 int ast_linear_stream(struct ast_channel *chan, const char *filename, int fd, int allowoverride);
 
 //! Stream a file with fast forward, pause, reverse.
-int ast_control_streamfile(struct ast_channel *chan, char *file, char *fwd, char *rev, char *stop, char *pause, int skipms);
+int ast_control_streamfile(struct ast_channel *chan, const char *file, const char *fwd, const char *rev, const char *stop, const char *pause, int skipms);
 
 //! Play a stream and wait for a digit, returning the digit that was pressed
-int ast_play_and_wait(struct ast_channel *chan, char *fn);
+int ast_play_and_wait(struct ast_channel *chan, const char *fn);
 
 //! Record a file for a max amount of time (in seconds), in a given list of formats separated by '|', outputting the duration of the recording, and with a maximum
 //  permitted silence time in milliseconds of 'maxsilence' under 'silencethreshold' or use '-1' for either or both parameters for defaults.

Index: cdr.h
===================================================================
RCS file: /usr/cvsroot/asterisk/include/asterisk/cdr.h,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- cdr.h	27 Oct 2004 03:33:14 -0000	1.16
+++ cdr.h	10 Jan 2005 14:46:59 -0000	1.17
@@ -73,7 +73,7 @@
 	/*! What account number to use */
 	char accountcode[20];			
 	/*! flags */
-	int flags;				
+	unsigned int flags;				
 	/* Unique Channel Identifier */
 	char uniqueid[32];
 	/* User field */
@@ -249,11 +249,6 @@
 
 extern char ast_default_accountcode[20];
 
-#define ast_cdr_compare_flag(flags, flag) (flags & (flag))
-#define ast_cdr_has_flag(cdr, flag) ((cdr)->flags & (flag))
-#define ast_cdr_add_flag(cdr, flag) ((cdr)->flags |= (flag))
-#define ast_cdr_del_flag(cdr, flag) ((cdr)->flags &= ~(flag))
-
 extern struct ast_cdr *ast_cdr_append(struct ast_cdr *cdr, struct ast_cdr *newcdr);
 
 #endif /* _CDR_H */

Index: channel.h
===================================================================
RCS file: /usr/cvsroot/asterisk/include/asterisk/channel.h,v
retrieving revision 1.70
retrieving revision 1.71
diff -u -d -r1.70 -r1.71
--- channel.h	9 Jan 2005 19:40:01 -0000	1.70
+++ channel.h	10 Jan 2005 14:46:59 -0000	1.71
@@ -36,6 +36,7 @@
 
 #include <asterisk/cdr.h>
 #include <asterisk/monitor.h>
+#include <asterisk/utils.h>
 
 
 #define AST_CHANNEL_NAME 80
@@ -238,8 +239,8 @@
 #define AST_FEATURE_FLAG_NEEDSDTMF		(1 << 0)
 
 struct ast_bridge_config {
-	unsigned int features_caller;
-	unsigned int features_callee;
+	struct ast_flags features_caller;
+	struct ast_flags features_callee;
 	long timelimit;
 	long play_warning;
 	long warning_freq;

Index: dundi.h
===================================================================
RCS file: /usr/cvsroot/asterisk/include/asterisk/dundi.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- dundi.h	28 Oct 2004 19:55:18 -0000	1.5
+++ dundi.h	10 Jan 2005 14:46:59 -0000	1.6
@@ -179,7 +179,7 @@
 #define DEFAULT_MAXMS				2000
 
 struct dundi_result {
-	int flags;
+	unsigned int flags;
 	int weight;
 	int expiration;
 	int techint;

Index: utils.h
===================================================================
RCS file: /usr/cvsroot/asterisk/include/asterisk/utils.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- utils.h	8 Jan 2005 19:00:46 -0000	1.15
+++ utils.h	10 Jan 2005 14:46:59 -0000	1.16
@@ -82,6 +82,33 @@
 						(p)->flags &= ~(flag); \
 					} while (0)
 
+/* Non-type checking variations for non-unsigned int flags.  You
+   should only use non-unsigned int flags where required by 
+   protocol etc and if you know what you're doing :)  */
+#define ast_test_flag_nonstd(p,flag) 		({ \
+					((p)->flags & (flag)); \
+					})
+
+#define ast_set_flag_nonstd(p,flag) 		do { \
+					((p)->flags |= (flag)); \
+					} while(0)
+
+#define ast_clear_flag_nonstd(p,flag) 		do { \
+					((p)->flags &= ~(flag)); \
+					} while(0)
+
+#define ast_copy_flags_nonstd(dest,src,flagz)	do { \
+					(dest)->flags &= ~(flagz); \
+					(dest)->flags |= ((src)->flags & (flagz)); \
+					} while (0)
+
+#define ast_set2_flag_nonstd(p,value,flag)	do { \
+					if (value) \
+						(p)->flags |= (flag); \
+					else \
+						(p)->flags &= ~(flag); \
+					} while (0)
+
 #define AST_FLAGS_ALL UINT_MAX
 
 struct ast_flags {




More information about the svn-commits mailing list