aboutsummaryrefslogtreecommitdiffstats
path: root/include/asterisk/utils.h
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/asterisk/utils.h
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/asterisk/utils.h')
-rwxr-xr-xinclude/asterisk/utils.h27
1 files changed, 27 insertions, 0 deletions
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 {