aboutsummaryrefslogtreecommitdiffstats
path: root/include/asterisk/utils.h
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-12-16 03:15:20 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-12-16 03:15:20 +0000
commitee9a76e7cb3df0d6b28229e8ae7b1667e4a48c3f (patch)
tree7f1ec5178785b3a1389a6a65e35a0d1c1a19c0f6 /include/asterisk/utils.h
parentfed41bbca3a3e921a4a8000dcdd82800987770a9 (diff)
Merge russell's flag macro patch (with slight mods) (bug #3046)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@4469 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include/asterisk/utils.h')
-rwxr-xr-xinclude/asterisk/utils.h11
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');