1swab(3C)                 Standard C Library Functions                 swab(3C)
2
3
4

NAME

6       swab - swap bytes
7

SYNOPSIS

9       #include <stdlib.h>
10
11       void swab(const char *src, char *dest, ssize_t nbytes);
12
13
14   XPG4, SUS, SUSv2, SUSv3
15       #include <unistd.h>
16
17       void swab(const void *restrict src, void *restrict dest, ssize_t nbytes);
18
19

DESCRIPTION

21       The  swab()  function copies nbytes bytes, which are pointed to by src,
22       to the object pointed to  by  dest,  exchanging  adjacent  bytes.   The
23       nbytes  argument  should  be  even.  If nbytes is odd swab() copies and
24       exchanges nbytes−1 bytes and  the  disposition  of  the  last  byte  is
25       unspecified.  If  copying takes place between objects that overlap, the
26       behavior is undefined. If nbytes is negative, swab() does nothing.
27

ERRORS

29       No errors are defined.
30

ATTRIBUTES

32       See attributes(5) for descriptions of the following attributes:
33
34
35
36
37       ┌─────────────────────────────┬─────────────────────────────┐
38       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
39       ├─────────────────────────────┼─────────────────────────────┤
40       │Interface Stability          │Standard                     │
41       ├─────────────────────────────┼─────────────────────────────┤
42       │MT-Level                     │MT-Safe                      │
43       └─────────────────────────────┴─────────────────────────────┘
44

SEE ALSO

46       attributes(5), standards(5)
47
48
49
50SunOS 5.11                        1 Nov 2003                          swab(3C)
Impressum