1byteorder(3bsd)                      LOCAL                     byteorder(3bsd)
2

NAME

4     be16enc, be16dec, be32enc, be32dec, be64enc, be64dec, le16enc, le16dec,
5     le32enc, le32dec, le64enc, le64dec — byte order operations
6

LIBRARY

8     Utility functions from BSD systems (libbsd, -lbsd)
9

SYNOPSIS

11     #include <sys/endian.h>
12     (See libbsd(7) for include usage.)
13
14     uint16_t
15     be16dec(const void *);
16
17     uint32_t
18     be32dec(const void *);
19
20     uint64_t
21     be64dec(const void *);
22
23     uint16_t
24     le16dec(const void *);
25
26     uint32_t
27     le32dec(const void *);
28
29     uint64_t
30     le64dec(const void *);
31
32     void
33     be16enc(void *, uint16_t);
34
35     void
36     be32enc(void *, uint32_t);
37
38     void
39     be64enc(void *, uint64_t);
40
41     void
42     le16enc(void *, uint16_t);
43
44     void
45     le32enc(void *, uint32_t);
46
47     void
48     le64enc(void *, uint64_t);
49

DESCRIPTION

51     The be16enc(), be16dec(), be32enc(), be32dec(), be64enc(), be64dec(),
52     le16enc(), le16dec(), le32enc(), le32dec(), le64enc(), and le64dec()
53     functions encode and decode integers to/from byte strings on any align‐
54     ment in big/little endian format.
55

SEE ALSO

57     byteorder(3)
58

HISTORY

60     The encode/decode functions first appeared in FreeBSD 5.1.
61
62BSD                             April 29, 2002                             BSD
Impressum