Endian-swap a given number of bytes
#include <unistd.h> void swab( const void * src, void * dest, ssize_t nbytes );
libc
Use the -l c option to qcc to link against this library. This library is usually included automatically.
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 copying takes place between objects that overlap, the behavior is undefined.
Safety: | |
---|---|
Cancellation point | No |
Interrupt handler | Yes |
Signal handler | Yes |
Thread | Yes |