Open System Services Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)

OSS Library Calls (s) swab(3)
NAME
swab - Swaps bytes in a byte array
LIBRARY
G-series native Guardian processes: system library
G-series native OSS processes: system library
H-series and J-series native Guardian processes: implicit libraries
H-series and J-series OSS processes: implicit libraries
SYNOPSIS
#include <unistd.h>
void swab(
const void *src,
void *dest,
ssize_t nbytes );
PARAMETERS
src Points to the location of the string to copy.
dest Points to the location to which the resulting string is copied.
nbytes Specifies the number of bytes to be copied. The nbytes parameter should have
an even value. When the nbytes parameter is odd, the swab( ) function uses
nbytes-1 instead and the disposition of the last byte is undefined. If nbytes is
negative, nothing is done.
DESCRIPTION
The swab( ) function copies the number of bytes specified by the nbytes parameter from the loca-
tion pointed to by the src parameter to the array pointed to by the dest parameter, exchanging
adjacent bytes. If copying takes place between objects that overlap, the behavior is undefined.
RETURN VALUES
The swab( ) function returns no values.
ERRORS
The swab( ) function returns no errors.
527187-017 Hewlett-Packard Company 6199