swab(3C) swab(3C)
NAME
swab - swap bytes
SYNOPSIS
#include <unistd.h>
void swab(const void *src, void *dest, ssizet nbytes);
DESCRIPTION
swab() copies nbytes bytes pointed to by src to the array pointed to
by dest, exchanging adjacent even and odd bytes. nbytes should be even
and non-negative. If nbytes is odd, swab() uses nbytes -1 instead, and
the disposition of the last byte is unspecified.
If copying takes place between objects that overlap, the behavior is
undefined. If nbytes is negative, swab() does nothing.
Page 1 Reliant UNIX 5.44 Printed 11/98