diff options
Diffstat (limited to 'src/lib/libc/net/htobe64.3')
-rw-r--r-- | src/lib/libc/net/htobe64.3 | 164 |
1 files changed, 0 insertions, 164 deletions
diff --git a/src/lib/libc/net/htobe64.3 b/src/lib/libc/net/htobe64.3 deleted file mode 100644 index e41c9124c4..0000000000 --- a/src/lib/libc/net/htobe64.3 +++ /dev/null | |||
@@ -1,164 +0,0 @@ | |||
1 | .\" $OpenBSD: htobe64.3,v 1.2 2024/08/03 23:06:56 guenther Exp $ | ||
2 | .\" | ||
3 | .\" Copyright (c) 1983, 1991, 1993 | ||
4 | .\" The Regents of the University of California. All rights reserved. | ||
5 | .\" | ||
6 | .\" Redistribution and use in source and binary forms, with or without | ||
7 | .\" modification, are permitted provided that the following conditions | ||
8 | .\" are met: | ||
9 | .\" 1. Redistributions of source code must retain the above copyright | ||
10 | .\" notice, this list of conditions and the following disclaimer. | ||
11 | .\" 2. Redistributions in binary form must reproduce the above copyright | ||
12 | .\" notice, this list of conditions and the following disclaimer in the | ||
13 | .\" documentation and/or other materials provided with the distribution. | ||
14 | .\" 3. Neither the name of the University nor the names of its contributors | ||
15 | .\" may be used to endorse or promote products derived from this software | ||
16 | .\" without specific prior written permission. | ||
17 | .\" | ||
18 | .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | ||
19 | .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
20 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
21 | .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | ||
22 | .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
23 | .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
24 | .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
25 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
26 | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
27 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
28 | .\" SUCH DAMAGE. | ||
29 | .\" | ||
30 | .Dd $Mdocdate: August 3 2024 $ | ||
31 | .Dt HTOBE64 3 | ||
32 | .Os | ||
33 | .Sh NAME | ||
34 | .Nm htobe64 , | ||
35 | .Nm htobe32 , | ||
36 | .Nm htobe16 , | ||
37 | .Nm be64toh , | ||
38 | .Nm be32toh , | ||
39 | .Nm be16toh , | ||
40 | .Nm betoh64 , | ||
41 | .Nm betoh32 , | ||
42 | .Nm betoh16 , | ||
43 | .Nm htole64 , | ||
44 | .Nm htole32 , | ||
45 | .Nm htole16 , | ||
46 | .Nm le64toh , | ||
47 | .Nm le32toh , | ||
48 | .Nm le16toh , | ||
49 | .Nm letoh64 , | ||
50 | .Nm letoh32 , | ||
51 | .Nm letoh16 , | ||
52 | .Nm swap64 , | ||
53 | .Nm swap32 , | ||
54 | .Nm swap16 | ||
55 | .Nd convert values between different byte orderings | ||
56 | .Sh SYNOPSIS | ||
57 | .In endian.h | ||
58 | .Ft uint64_t | ||
59 | .Fn htobe64 "uint64_t host64" | ||
60 | .Ft uint32_t | ||
61 | .Fn htobe32 "uint32_t host32" | ||
62 | .Ft uint16_t | ||
63 | .Fn htobe16 "uint16_t host16" | ||
64 | .Ft uint64_t | ||
65 | .Fn be64toh "uint64_t big64" | ||
66 | .Ft uint32_t | ||
67 | .Fn be32toh "uint32_t big32" | ||
68 | .Ft uint16_t | ||
69 | .Fn be16toh "uint16_t big16" | ||
70 | .Ft uint64_t | ||
71 | .Fn betoh64 "uint64_t big64" | ||
72 | .Ft uint32_t | ||
73 | .Fn betoh32 "uint32_t big32" | ||
74 | .Ft uint16_t | ||
75 | .Fn betoh16 "uint16_t big16" | ||
76 | .Ft uint64_t | ||
77 | .Fn htole64 "uint64_t host64" | ||
78 | .Ft uint32_t | ||
79 | .Fn htole32 "uint32_t host32" | ||
80 | .Ft uint16_t | ||
81 | .Fn htole16 "uint16_t host16" | ||
82 | .Ft uint64_t | ||
83 | .Fn letoh64 "uint64_t little64" | ||
84 | .Ft uint64_t | ||
85 | .Fn le64toh "uint64_t little64" | ||
86 | .Ft uint32_t | ||
87 | .Fn le32toh "uint32_t little32" | ||
88 | .Ft uint16_t | ||
89 | .Fn le16toh "uint16_t little16" | ||
90 | .Ft uint32_t | ||
91 | .Fn letoh32 "uint32_t little32" | ||
92 | .Ft uint16_t | ||
93 | .Fn letoh16 "uint16_t little16" | ||
94 | .Ft uint64_t | ||
95 | .Fn swap64 "uint64_t val64" | ||
96 | .Ft uint32_t | ||
97 | .Fn swap32 "uint32_t val32" | ||
98 | .Ft uint16_t | ||
99 | .Fn swap16 "uint16_t val16" | ||
100 | .Sh DESCRIPTION | ||
101 | These routines convert 16, 32 and 64-bit quantities between different | ||
102 | byte orderings. | ||
103 | The | ||
104 | .Dq swap | ||
105 | functions reverse the byte ordering of | ||
106 | the given quantity; the others convert either from/to the native | ||
107 | byte order used by the host to/from either little- or big-endian (a.k.a | ||
108 | network) order. | ||
109 | .Pp | ||
110 | Apart from the swap functions, | ||
111 | the names containing | ||
112 | .Dq be | ||
113 | convert between host and big-endian (most significant byte first) order | ||
114 | of the given quantity, while the names containing | ||
115 | .Dq le | ||
116 | convert between host and little-endian (least significant byte first) order | ||
117 | of the given quantity. | ||
118 | .Pp | ||
119 | All these functions use the numbers | ||
120 | 16, 32, or 64 for specifying the bitwidth of the quantities they operate on. | ||
121 | Currently all supported architectures are either big- or little-endian | ||
122 | so either the | ||
123 | .Dq be | ||
124 | or | ||
125 | .Dq le | ||
126 | variants are implemented as null macros. | ||
127 | .Sh SEE ALSO | ||
128 | .Xr htonl 3 | ||
129 | .Sh STANDARDS | ||
130 | The | ||
131 | .Fn htobe64 , | ||
132 | .Fn htobe32 , | ||
133 | .Fn htobe16 , | ||
134 | .Fn be64toh , | ||
135 | .Fn be32toh , | ||
136 | .Fn be16toh , | ||
137 | .Fn htole64 , | ||
138 | .Fn htole32 , | ||
139 | .Fn htole16 , | ||
140 | .Fn le64toh , | ||
141 | .Fn le32toh , | ||
142 | and | ||
143 | .Fn le16toh | ||
144 | functions conform to | ||
145 | .St -p1003.1-2024 . | ||
146 | The other functions are extensions that should not be used | ||
147 | when portability is required. | ||
148 | .Sh HISTORY | ||
149 | The | ||
150 | .Nm swap{size} | ||
151 | and | ||
152 | .Nm {src-order}to{dst-order}{size} | ||
153 | functions appeared in | ||
154 | .Bx 4.2 . | ||
155 | The | ||
156 | .Nm {src-order}{size}to{dst-order} | ||
157 | functions appeared in | ||
158 | .Ox 5.6 . | ||
159 | .Sh BUGS | ||
160 | The perceived antagonism between | ||
161 | .Sq host | ||
162 | and | ||
163 | .Sq network | ||
164 | byte order does not allow PDP-11 users to sleep soundly at night. | ||