Warning: main(/www/www/htdocs/style/globals.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/s/swab.html on line 1

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/globals.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/s/swab.html on line 1

Warning: main(/www/www/htdocs/style/header.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/s/swab.html on line 8

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/header.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/s/swab.html on line 8

swab()

Endian-swap a given number of bytes

Synopsis:

#include <unistd.h>

void swab( const void * src,
           void * dest, 
           ssize_t nbytes );

Arguments:

src
A pointer to the buffer that you want to copy the bytes from.
dest
A pointer to the buffer where you want the function to copy the bytes.
nbytes
The number of bytes that you want to copy and swap.

Library:

libc

Use the -l c option to qcc to link against this library. This library is usually included automatically.

Description:

The swab() function copies nbytes bytes, pointed to by src, to the object pointed to by dest, exchanging adjacent bytes. The nbytes argument should be even.

If nbytes is: Then:
Odd nbytes-1 bytes are copied and exchanged. The disposition of the last byte is unspecified.
Negative swab() does nothing.

If copying takes place between objects that overlap, the behavior is undefined.

Classification:

POSIX 1003.1 XSI

Safety:
Cancellation point No
Interrupt handler Yes
Signal handler Yes
Thread Yes

See also:

ENDIAN_SWAP32(), ENDIAN_SWAP64()


Warning: main(/www/www/htdocs/style/footer.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/s/swab.html on line 141

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/footer.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/s/swab.html on line 141