# HG changeset patch # User bcoudurier # Date 1164981710 0 # Node ID b0d38ef4b54757aadc91e67b782988fe3a8b4525 # Parent 507ba4483ffcc40945965b73604fad6763d5fe7c add bytestream big endian 16/32 writing functions diff -r 507ba4483ffc -r b0d38ef4b547 bytestream.h --- a/bytestream.h Fri Dec 01 09:58:06 2006 +0000 +++ b/bytestream.h Fri Dec 01 14:01:50 2006 +0000 @@ -47,6 +47,20 @@ return size; } +static always_inline void bytestream_put_be32(uint8_t **b, const unsigned int value) +{ + *(*b)++ = value >> 24; + *(*b)++ = value >> 16; + *(*b)++ = value >> 8; + *(*b)++ = value; +}; + +static always_inline void bytestream_put_be16(uint8_t **b, const unsigned int value) +{ + *(*b)++ = value >> 8; + *(*b)++ = value; +} + static always_inline void bytestream_put_le32(uint8_t **b, const unsigned int value) { *(*b)++ = value;