summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorluther <luther@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2000-07-15 01:54:38 +0000
committerluther <luther@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2000-07-15 01:54:38 +0000
commitffb238ae00d27929b687b3163e42fed6960bf892 (patch)
tree56cdb6eab46f3ad1ac6ffe0238e82c24a6785b72
parentfb390c865774882d5babf1eba8c29e77d042a338 (diff)
downloadATCD-ffb238ae00d27929b687b3163e42fed6960bf892.tar.gz
Fri Jul 14 20:49:46 2000 Luther J Baker <luther@cs.wustl.edu>
-rw-r--r--PACE/ChangeLog8
-rw-r--r--PACE/pace/config/utility.h18
2 files changed, 25 insertions, 1 deletions
diff --git a/PACE/ChangeLog b/PACE/ChangeLog
index b06261e5950..12dbf1ca4af 100644
--- a/PACE/ChangeLog
+++ b/PACE/ChangeLog
@@ -1,3 +1,9 @@
+Fri Jul 14 20:49:46 2000 Luther J Baker <luther@cs.wustl.edu>
+
+ * pace/config/utility.h:
+
+ Added some neat :-) ACE_* macro utilities.
+
Fri Jul 14 20:38:44 2000 Luther J Baker <luther@cs.wustl.edu>
* pace/win32/dirent.inl:
@@ -31,7 +37,7 @@ Fri Jul 14 19:06:09 2000 John Heitmann <jwh1@cs.wustl.edu>
* pace/pthread.h:
* pace/unistd.h:
- Removed a duplicate closing }.
+pp Removed a duplicate closing }.
* pace/pthread.h:
Added (void) in arguments to pointers to functions
diff --git a/PACE/pace/config/utility.h b/PACE/pace/config/utility.h
index 03f5602eff3..0db90ebd4de 100644
--- a/PACE/pace/config/utility.h
+++ b/PACE/pace/config/utility.h
@@ -28,4 +28,22 @@ return ( (errno = ENOTSUP), FAILVALUE)
# define PACE_ERRNO_NO_SUPPORT() errno=ENOTSUP
+/* A couple useful inline functions for checking whether bits are
+ enabled or disabled.
+ */
+# define PACE_POW(X) (((X) == 0)?1:(X-=1,X|=X>>1,X|=X>>2,X|=X>>4,X|=X>>8,X|=X>>16,(++X)))
+# define PACE_EVEN(NUM) (((NUM) & 1) == 0)
+# define PACE_ODD(NUM) (((NUM) & 1) == 1)
+# define PACE_BIT_ENABLED(WORD, BIT) (((WORD) & (BIT)) != 0)
+# define PACE_BIT_DISABLED(WORD, BIT) (((WORD) & (BIT)) == 0)
+# define PACE_BIT_CMP_MASK(WORD, BIT, MASK) (((WORD) & (BIT)) == MASK)
+# define PACE_SET_BITS(WORD, BITS) (WORD |= (BITS))
+# define PACE_CLR_BITS(WORD, BITS) (WORD &= ~(BITS))
+
+/* Turn a number into a string. */
+# define PACE_ITOA(X) #X
+
+/* Create a string of a server address with a "host:port" format. */
+# define PACE_SERVER_ADDRESS(H,P) H":"P
+
#endif /* PACE_CONFIG_UTILITY_H */