1234567891011121314151617181920212223 |
- #include <unistd.h>
- #include <sys/types.h>
- #include <byteswap.h>
- void swab (const void *source, void *dest, ssize_t count)
- {
- const unsigned short *from = source, *from_end = from + (count >> 1);
- unsigned short junk;
- unsigned short *to = dest;
- while (from < from_end) {
-
- junk=*from++;
- *to++ = bswap_16 (junk);
- }
- }
|