More flagification, courtesy drumkilla (bug #3280)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@4748 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Mark Spencer
2005-01-10 14:46:59 +00:00
parent e7cb975021
commit 92eb0c2018
13 changed files with 168 additions and 145 deletions

View File

@@ -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.

View File

@@ -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 */

View File

@@ -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;

View File

@@ -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;

View File

@@ -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 {