Back to index

glibc  2.9
Functions
swab.c File Reference
#include <unistd.h>

Go to the source code of this file.

Functions

void swab (const void *bfrom, void *bto, ssize_t n)

Function Documentation

void swab ( const void *  bfrom,
void *  bto,
ssize_t  n 
)

Definition at line 22 of file swab.c.

{
  const char *from = (const char *) bfrom;
  char *to = (char *) bto;

  n &= ~((ssize_t) 1);
  while (n > 1)
    {
      const char b0 = from[--n], b1 = from[--n];
      to[n] = b0;
      to[n + 1] = b1;
    }
}