summaryrefslogtreecommitdiff
path: root/source4/lib/util
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2006-12-31 12:28:16 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:30:36 -0500
commite57c36ecba516992d70592a1a35fc8bc466b5faa (patch)
treeb9c22e1a7b2f512cf5940e83b9fb9e9dd8c7c751 /source4/lib/util
parent0244585e84d697f26de049654a682fa5529399ba (diff)
downloadsamba-e57c36ecba516992d70592a1a35fc8bc466b5faa.tar.gz
samba-e57c36ecba516992d70592a1a35fc8bc466b5faa.tar.bz2
samba-e57c36ecba516992d70592a1a35fc8bc466b5faa.zip
r20436: add more comments and add macros signed versions of the 64 bit
macros metze (This used to be commit e77d0d1532e800e0a7b0a4a30cf9b4d97761ee52)
Diffstat (limited to 'source4/lib/util')
-rw-r--r--source4/lib/util/byteorder.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/source4/lib/util/byteorder.h b/source4/lib/util/byteorder.h
index 941dee9e88..823287f075 100644
--- a/source4/lib/util/byteorder.h
+++ b/source4/lib/util/byteorder.h
@@ -73,13 +73,17 @@ reasoning behind them. byteorder.h defines the following macros:
SVAL(buf,pos) - extract a 2 byte SMB value
IVAL(buf,pos) - extract a 4 byte SMB value
-SVALS(buf,pos) signed version of SVAL()
-IVALS(buf,pos) signed version of IVAL()
+BVAL(buf,pos) - extract a 8 byte SMB value
+SVALS(buf,pos) - signed version of SVAL()
+IVALS(buf,pos) - signed version of IVAL()
+BVALS(buf,pos) - signed version of BVAL()
SSVAL(buf,pos,val) - put a 2 byte SMB value into a buffer
SIVAL(buf,pos,val) - put a 4 byte SMB value into a buffer
+SBVAL(buf,pos,val) - put a 8 byte SMB value into a buffer
SSVALS(buf,pos,val) - signed version of SSVAL()
SIVALS(buf,pos,val) - signed version of SIVAL()
+SBVALS(buf,pos,val) - signed version of SBVAL()
RSVAL(buf,pos) - like SVAL() but for NMB byte ordering
RSVALS(buf,pos) - like SVALS() but for NMB byte ordering
@@ -218,7 +222,9 @@ static __inline__ void st_le32(uint32_t *addr, const uint32_t val)
#define VWV(vwv) ((vwv)*2)
/* 64 bit macros */
-#define SBVAL(p, ofs, v) (SIVAL(p,ofs,(v)&0xFFFFFFFF), SIVAL(p,(ofs)+4,((uint64_t)(v))>>32))
#define BVAL(p, ofs) (IVAL(p,ofs) | (((uint64_t)IVAL(p,(ofs)+4)) << 32))
+#define BVALS(p, ofs) ((int64_t)BVAL(p,ofs))
+#define SBVAL(p, ofs, v) (SIVAL(p,ofs,(v)&0xFFFFFFFF), SIVAL(p,(ofs)+4,((uint64_t)(v))>>32))
+#define SBVALS(p, ofs, v) (SBVAL(p,ofs,(uint64_t)v))
#endif /* _BYTEORDER_H */