byteorder(3bsd) 3bsd byteorder(3bsd)

be16enc, be16dec, be32enc, be32dec, be64enc, be64dec, le16enc, le16dec, le32enc, le32dec, le64enc, le64decbyte order operations

library “libbsd”

#include <sys/endian.h> (See libbsd(7) for include usage.)
uint16_t
be16dec(const void *);

uint32_t
be32dec(const void *);

uint64_t
be64dec(const void *);

uint16_t
le16dec(const void *);

uint32_t
le32dec(const void *);

uint64_t
le64dec(const void *);

void
be16enc(void *, uint16_t);

void
be32enc(void *, uint32_t);

void
be64enc(void *, uint64_t);

void
le16enc(void *, uint16_t);

void
le32enc(void *, uint32_t);

void
le64enc(void *, uint64_t);

The (), (), (), (), (), (), (), (), (), (), (), and () functions encode and decode integers to/from byte strings on any alignment in big/little endian format.

byteorder(3)

The encode/decode functions first appeared in FreeBSD 5.1.

April 29, 2002 Linux 6.10.10-arch1-1