168 lines
4.6 KiB
Groff
168 lines
4.6 KiB
Groff
|
.\" Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org>
|
|||
|
.\" All rights reserved.
|
|||
|
.\"
|
|||
|
.\" Redistribution and use in source and binary forms, with or without
|
|||
|
.\" modification, are permitted provided that the following conditions
|
|||
|
.\" are met:
|
|||
|
.\" 1. Redistributions of source code must retain the above copyright
|
|||
|
.\" notice, this list of conditions and the following disclaimer.
|
|||
|
.\" 2. Redistributions in binary form must reproduce the above copyright
|
|||
|
.\" notice, this list of conditions and the following disclaimer in the
|
|||
|
.\" documentation and/or other materials provided with the distribution.
|
|||
|
.\"
|
|||
|
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
|||
|
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|||
|
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|||
|
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
|||
|
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|||
|
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|||
|
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|||
|
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|||
|
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|||
|
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|||
|
.\" SUCH DAMAGE.
|
|||
|
.\"
|
|||
|
.\" %FreeBSD: src/share/man/man9/byteorder.9,v 1.6 2003/05/21 17:32:55 ru Exp %
|
|||
|
.\"
|
|||
|
.\" $FreeBSD$
|
|||
|
.Dd April 29, 2002
|
|||
|
.Dt BYTEORDER 9
|
|||
|
.Os
|
|||
|
.Sh ̾<EFBFBD><EFBFBD>
|
|||
|
.Nm bswap16 , bswap32 , bswap64 ,
|
|||
|
.Nm be16toh , be32toh , be64toh , htobe16 , htobe32 , htobe64 ,
|
|||
|
.Nm htole16 , htole32 , htole64 , le16toh , le32toh , le64toh ,
|
|||
|
.Nm be16enc , be16dec , be32enc , be32dec , be64enc , be64dec ,
|
|||
|
.Nm le16enc , le16dec , le32enc , le32dec , le64enc , le64dec
|
|||
|
.Nd <EFBFBD>Х<EFBFBD><EFBFBD>ȥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
.Sh <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
.In sys/endian.h
|
|||
|
.Ft uint16_t
|
|||
|
.Fn bswap16 "uint16_t int16"
|
|||
|
.Ft uint32_t
|
|||
|
.Fn bswap32 "uint32_t int32"
|
|||
|
.Ft uint64_t
|
|||
|
.Fn bswap64 "uint64_t int64"
|
|||
|
.Ft uint16_t
|
|||
|
.Fn be16toh "uint16_t big16"
|
|||
|
.Ft uint32_t
|
|||
|
.Fn be32toh "uint32_t big32"
|
|||
|
.Ft uint64_t
|
|||
|
.Fn be64toh "uint64_t big64"
|
|||
|
.Ft uint16_t
|
|||
|
.Fn htobe16 "uint16_t host16"
|
|||
|
.Ft uint32_t
|
|||
|
.Fn htobe32 "uint32_t host32"
|
|||
|
.Ft uint64_t
|
|||
|
.Fn htobe64 "uint64_t host64"
|
|||
|
.Ft uint16_t
|
|||
|
.Fn htole16 "uint16_t host16"
|
|||
|
.Ft uint32_t
|
|||
|
.Fn htole32 "uint32_t host32"
|
|||
|
.Ft uint64_t
|
|||
|
.Fn htole64 "uint64_t host64"
|
|||
|
.Ft uint16_t
|
|||
|
.Fn le16toh "uint16_t little16"
|
|||
|
.Ft uint32_t
|
|||
|
.Fn le32toh "uint32_t little32"
|
|||
|
.Ft uint64_t
|
|||
|
.Fn le64toh "uint64_t little64"
|
|||
|
.Ft uint16_t
|
|||
|
.Fn be16dec "const void *"
|
|||
|
.Ft uint32_t
|
|||
|
.Fn be32dec "const void *"
|
|||
|
.Ft uint64_t
|
|||
|
.Fn be64dec "const void *"
|
|||
|
.Ft uint16_t
|
|||
|
.Fn le16dec "const void *"
|
|||
|
.Ft uint32_t
|
|||
|
.Fn le32dec "const void *"
|
|||
|
.Ft uint64_t
|
|||
|
.Fn le64dec "const void *"
|
|||
|
.Ft void
|
|||
|
.Fn be16enc "void *" uint16_t
|
|||
|
.Ft void
|
|||
|
.Fn be32enc "void *" uint32_t
|
|||
|
.Ft void
|
|||
|
.Fn be64enc "void *" uint64_t
|
|||
|
.Ft void
|
|||
|
.Fn le16enc "void *" uint16_t
|
|||
|
.Ft void
|
|||
|
.Fn le32enc "void *" uint32_t
|
|||
|
.Ft void
|
|||
|
.Fn le64enc "void *" uint64_t
|
|||
|
.Sh <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
.Fn bswap16 ,
|
|||
|
.Fn bswap32
|
|||
|
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
.Fn bswap64
|
|||
|
<EFBFBD>ؿ<EFBFBD><EFBFBD>ϥХ<EFBFBD><EFBFBD>ȥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>줿<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֤<EFBFBD><EFBFBD>ޤ<EFBFBD><EFBFBD><EFBFBD>
|
|||
|
<EFBFBD>ӥå<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǥ<EFBFBD><EFBFBD><EFBFBD><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