- Swab (programming)
swab is a function in the
C programming language that swaps the contents of two areas of bytes in the memory. As far as traceable, "swab" is a contraction of "swap byte". It is not a standard ISO C library function, so its use is not portable.The
swab()
function is useful for preparing blocks of data for further processing, in situations where the data blocks have been sent through a network arranged innetwork byte order , and must be rearranged into nativebyte order (or vice versa). This deals specifically with data blocks that are composed of 2-byte (16-bit ) words that must be rearranged so that they have the properendianness appropriate for the local system.
Wikimedia Foundation. 2010.