diff options
author | Mark Spencer <markster@digium.com> | 2004-12-16 03:15:20 +0000 |
---|---|---|
committer | Mark Spencer <markster@digium.com> | 2004-12-16 03:15:20 +0000 |
commit | cadb8d010b824f7f89a61b9441406f4b33914911 (patch) | |
tree | 7f1ec5178785b3a1389a6a65e35a0d1c1a19c0f6 /include/asterisk/utils.h | |
parent | da6073e8c604c4904286e4ac23c5bfdc2a1b447d (diff) |
Merge russell's flag macro patch (with slight mods) (bug #3046)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@4469 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'include/asterisk/utils.h')
-rwxr-xr-x | include/asterisk/utils.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/asterisk/utils.h b/include/asterisk/utils.h index 7c47fac89..b70a1ffca 100755 --- a/include/asterisk/utils.h +++ b/include/asterisk/utils.h @@ -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'); |