Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ swab(3) — SunOS 4.0

Media Vault

Software Library

Restoration Projects

Artifacts Sought

SWAB(3)  —  C LIBRARY FUNCTIONS

NAME

swab − swap bytes

SYNOPSIS

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-endian machines (such as Sun386i). 

nbytes should be even. 

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

Sun Release 4.0  —  Last change: 6 October 1987

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026