Table of Contents
bswap, bswap_litend, bswap_bigend - (endian dependant) byte swapping
void bswap(void *data, int len, int cnt)
void bswap_litend(void *data, int len, int cnt)
void bswap_bigend(void *data, int len, int cnt)
bswap swaps the bytes in a word of length len, and does this
cnt times. For len=2,4,8 special optimized versions are written (see also
htonl(3)
and htons(3)
). bswap_litend and bswap_bigend are specific implementations
that swap the bytes to the native machine level, assuming data is little
resp. big endian. These two routines could thus result in a no-op.
The
following code ...
real x[100], w[100];
int i,n=100;
...
bswap(1NEMO)
, htonl(3)
, htons(3)
, ntohl(3)
, ntohs(3)
Peter
Teuben
~/src/kernel/cores bswap.c
20-sep-05 man written PJT
Table of Contents