]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/swab.3
All pages: Remove the 5th argument to .TH
[thirdparty/man-pages.git] / man3 / swab.3
CommitLineData
fea681da
MK
1.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
2.\"
5fbde956 3.\" SPDX-License-Identifier: Linux-man-pages-copyleft
fea681da
MK
4.\"
5.\" References consulted:
6.\" Linux libc source code
7.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
8.\" 386BSD man pages
9.\" Modified Sat Jul 24 17:52:15 1993 by Rik Faith (faith@cs.unc.edu)
10.\" Modified 2001-12-15, aeb
45186a5d 11.TH SWAB 3 2021-03-22 "Linux man-pages (unreleased)"
fea681da
MK
12.SH NAME
13swab \- swap adjacent bytes
4ee3f37e
AC
14.SH LIBRARY
15Standard C library
8fc3b2cf 16.RI ( libc ", " \-lc )
fea681da
MK
17.SH SYNOPSIS
18.nf
b80f966b 19.BR "#define _XOPEN_SOURCE" " /* See feature_test_macros(7) */"
fea681da 20.B #include <unistd.h>
68e4db0a 21.PP
cd2b76c7
AC
22.BI "void swab(const void *restrict " from ", void *restrict " to \
23", ssize_t " n );
fea681da
MK
24.fi
25.SH DESCRIPTION
60a90ecd
MK
26The
27.BR swab ()
c6fa0841
MK
28function copies
29.I n
30bytes from the array pointed
31to by
32.I from
33to the array pointed to by
34.IR to ,
35exchanging
c13182ef
MK
36adjacent even and odd bytes.
37This function is used to exchange data
fea681da 38between machines that have different low/high byte ordering.
dd3568a1 39.PP
c6fa0841
MK
40This function does nothing when
41.I n
42is negative.
43When
44.I n
45is positive and odd, it handles
46.I n\-1
47bytes
fea681da 48as above, and does something unspecified with the last byte.
c6fa0841
MK
49(In other words,
50.I n
51should be even.)
47297adb 52.SH RETURN VALUE
60a90ecd
MK
53The
54.BR swab ()
55function returns no value.
4cdb0577 56.SH ATTRIBUTES
e7e66cf8
PH
57For an explanation of the terms used in this section, see
58.BR attributes (7).
c466875e
MK
59.ad l
60.nh
e7e66cf8
PH
61.TS
62allbox;
c466875e 63lbx lb lb
e7e66cf8
PH
64l l l.
65Interface Attribute Value
66T{
4cdb0577 67.BR swab ()
e7e66cf8
PH
68T} Thread safety MT-Safe
69.TE
c466875e
MK
70.hy
71.ad
72.sp 1
3113c7f3 73.SH STANDARDS
1ba33d69 74POSIX.1-2001, POSIX.1-2008, SVr4, 4.3BSD.
47297adb 75.SH SEE ALSO
0a4f8b7b 76.BR bstring (3)