3 <<swab>>---swap adjacent bytes
7 void swab(const void *<[in]>, void *<[out]>, ssize_t <[n]>);
10 This function copies <[n]> bytes from the memory region
11 pointed to by <[in]> to the memory region pointed to by
12 <[out]>, exchanging adjacent even and odd bytes.
15 <<swab>> requires no supporting OS subroutines.
25 const char *from
= b1
;
28 for (ptr
= 1; ptr
< length
; ptr
+= 2)
35 if (ptr
== length
) /* I.e., if length is odd, */
36 to
[ptr
-1] = 0; /* then pad with a NUL. */