BYTEORDER(3bsd)

NAME
be16enc, be16dec, be32enc, be32dec, be64enc, be64dec, le16enc, le16dec, le32enc, le32dec, le64enc, le64dec - byte order operations

SYNOPSIS
#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);

DESCRIPTION

The be16enc(), be16dec(), be32enc(), be32dec(), be64enc(), be64dec(), le16enc(), le16dec(), le32enc(), le32dec(), le64enc(), and le64dec() functions encode and decode integers to/from byte strings on any alignment in big/little endian format.

SEE ALSO
byteorder(3)

HISTORY

The encode/decode functions first appeared in FreeBSD 5.1.