unixdev.net


Switch to SpeakEasy.net DSL

The Modular Manual Browser

Home Page
Manual: (SunOS-4.1.3)
Page:
Section:
Apropos / Subsearch:
optional field

SWAB(3)                    Library Functions Manual                    SWAB(3)



NAME
       swab - swap bytes

SYNOPSIS
       void
       swab(from, to, nbytes)
       char *from, *to;

DESCRIPTION
       swab()  copies  nbytes bytes pointed to by from to the position pointed
       to by to, exchanging adjacent even and odd bytes.   It  is  useful  for
       carrying binary data between high-ender machines (IBM 360's, MC68000's,
       etc) and low-end machines (such as Sun386i systems).

       nbytes should be even and positive.  If nbytes  is  odd  and  positive,
       swab()  uses  nbytes  -  1 instead.  If nbytes is negative, swab() does
       nothing.

       The from and to addresses should not overlap in portable programs.



                                6 October 1987                         SWAB(3)