]>
Commit | Line | Data |
---|---|---|
fea681da MK |
1 | .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) |
2 | .\" | |
93015253 | 3 | .\" %%%LICENSE_START(VERBATIM) |
fea681da MK |
4 | .\" Permission is granted to make and distribute verbatim copies of this |
5 | .\" manual provided the copyright notice and this permission notice are | |
6 | .\" preserved on all copies. | |
7 | .\" | |
8 | .\" Permission is granted to copy and distribute modified versions of this | |
9 | .\" manual under the conditions for verbatim copying, provided that the | |
10 | .\" entire resulting derived work is distributed under the terms of a | |
11 | .\" permission notice identical to this one. | |
c13182ef | 12 | .\" |
fea681da MK |
13 | .\" Since the Linux kernel and libraries are constantly changing, this |
14 | .\" manual page may be incorrect or out-of-date. The author(s) assume no | |
15 | .\" responsibility for errors or omissions, or for damages resulting from | |
16 | .\" the use of the information contained herein. The author(s) may not | |
17 | .\" have taken the same level of care in the production of this manual, | |
18 | .\" which is licensed free of charge, as they might when working | |
19 | .\" professionally. | |
c13182ef | 20 | .\" |
fea681da MK |
21 | .\" Formatted or processed versions of this manual, if unaccompanied by |
22 | .\" the source, must acknowledge the copyright and authors of this work. | |
4b72fb64 | 23 | .\" %%%LICENSE_END |
fea681da MK |
24 | .\" |
25 | .\" References consulted: | |
26 | .\" Linux libc source code | |
27 | .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) | |
28 | .\" 386BSD man pages | |
29 | .\" Modified Sat Jul 24 17:52:15 1993 by Rik Faith (faith@cs.unc.edu) | |
30 | .\" Modified 2001-12-15, aeb | |
460495ca | 31 | .TH SWAB 3 2015-08-08 "" "Linux Programmer's Manual" |
fea681da MK |
32 | .SH NAME |
33 | swab \- swap adjacent bytes | |
34 | .SH SYNOPSIS | |
35 | .nf | |
b80f966b | 36 | .BR "#define _XOPEN_SOURCE" " /* See feature_test_macros(7) */" |
fea681da | 37 | .B #include <unistd.h> |
68e4db0a | 38 | .PP |
fea681da MK |
39 | .BI "void swab(const void *" from ", void *" to ", ssize_t " n ); |
40 | .fi | |
41 | .SH DESCRIPTION | |
60a90ecd MK |
42 | The |
43 | .BR swab () | |
c6fa0841 MK |
44 | function copies |
45 | .I n | |
46 | bytes from the array pointed | |
47 | to by | |
48 | .I from | |
49 | to the array pointed to by | |
50 | .IR to , | |
51 | exchanging | |
c13182ef MK |
52 | adjacent even and odd bytes. |
53 | This function is used to exchange data | |
fea681da | 54 | between machines that have different low/high byte ordering. |
dd3568a1 | 55 | .PP |
c6fa0841 MK |
56 | This function does nothing when |
57 | .I n | |
58 | is negative. | |
59 | When | |
60 | .I n | |
61 | is positive and odd, it handles | |
62 | .I n\-1 | |
63 | bytes | |
fea681da | 64 | as above, and does something unspecified with the last byte. |
c6fa0841 MK |
65 | (In other words, |
66 | .I n | |
67 | should be even.) | |
47297adb | 68 | .SH RETURN VALUE |
60a90ecd MK |
69 | The |
70 | .BR swab () | |
71 | function returns no value. | |
4cdb0577 | 72 | .SH ATTRIBUTES |
e7e66cf8 PH |
73 | For an explanation of the terms used in this section, see |
74 | .BR attributes (7). | |
75 | .TS | |
76 | allbox; | |
77 | lb lb lb | |
78 | l l l. | |
79 | Interface Attribute Value | |
80 | T{ | |
4cdb0577 | 81 | .BR swab () |
e7e66cf8 PH |
82 | T} Thread safety MT-Safe |
83 | .TE | |
47297adb | 84 | .SH CONFORMING TO |
1ba33d69 | 85 | POSIX.1-2001, POSIX.1-2008, SVr4, 4.3BSD. |
47297adb | 86 | .SH SEE ALSO |
0a4f8b7b | 87 | .BR bstring (3) |