aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2005-01-10 14:46:59 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2005-01-10 14:46:59 +0000
commitc47ebe99cf8fd8835013ad794239327a6406af97 (patch)
tree94729885f0b947fa8b165ec1de895249d579c6c0 /include
parent299b57eafc306308f45ce587e29f4a71ae7d27b8 (diff)
More flagification, courtesy drumkilla (bug #3280)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@4748 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include')
-rwxr-xr-xinclude/asterisk/app.h4
-rwxr-xr-xinclude/asterisk/cdr.h7
-rwxr-xr-xinclude/asterisk/channel.h5
-rwxr-xr-xinclude/asterisk/dundi.h2
-rwxr-xr-xinclude/asterisk/utils.h27
5 files changed, 34 insertions, 11 deletions
diff --git a/include/asterisk/app.h b/include/asterisk/app.h
index 1af21f3e8..57925174b 100755
--- a/include/asterisk/app.h
+++ b/include/asterisk/app.h
@@ -60,10 +60,10 @@ int ast_dtmf_stream(struct ast_channel *chan, struct ast_channel *peer, char *di
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.
diff --git a/include/asterisk/cdr.h b/include/asterisk/cdr.h
index 807ad6419..88f210e69 100755
--- a/include/asterisk/cdr.h
+++ b/include/asterisk/cdr.h
@@ -73,7 +73,7 @@ struct ast_cdr {
/*! 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 int ast_default_amaflags;
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 */
diff --git a/include/asterisk/channel.h b/include/asterisk/channel.h
index 294d15557..4d24150db 100755
--- a/include/asterisk/channel.h
+++ b/include/asterisk/channel.h
@@ -36,6 +36,7 @@ extern "C" {
#include <asterisk/cdr.h>
#include <asterisk/monitor.h>
+#include <asterisk/utils.h>
#define AST_CHANNEL_NAME 80
@@ -238,8 +239,8 @@ struct ast_channel {
#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;
diff --git a/include/asterisk/dundi.h b/include/asterisk/dundi.h
index 5a6920b30..97d67e8d1 100755
--- a/include/asterisk/dundi.h
+++ b/include/asterisk/dundi.h
@@ -179,7 +179,7 @@ struct dundi_peer_status {
#define DEFAULT_MAXMS 2000
struct dundi_result {
- int flags;
+ unsigned int flags;
int weight;
int expiration;
int techint;
diff --git a/include/asterisk/utils.h b/include/asterisk/utils.h
index ff42c1312..ff0c2cb7e 100755
--- a/include/asterisk/utils.h
+++ b/include/asterisk/utils.h
@@ -82,6 +82,33 @@ extern unsigned int __unsigned_int_flags_dummy;
(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 {