[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]

Technical Reference: Base Operating System and Extensions , Volume 2


swab Subroutine

Purpose

Copies bytes.

Library

Standard C Library (libc.a)

Syntax

#include <unistd.h>


void swab ( From, To, NumberOfBytes)
const void *From;
void *To;
ssize_t NumberOfBytes;

Description

The swab subroutine copies the number of bytes pointed to by the NumberOfBytes parameter from the location pointed to by the From parameter to the array pointed to by the To parameter, exchanging adjacent even and odd bytes.

The NumberOfBytes parameter should be even and nonnegative. If the NumberOfBytes parameter is odd and positive, the swab subroutine uses NumberOfBytes -1 instead. If the NumberOfBytes parameter is negative, the swab subroutine does nothing.

Parameters


From Points to the location of data to be copied.
To Points to the array to which the data is to be copied.
NumberOfBytes Specifies the number of even and nonnegative bytes to be copied.

Implementation Specifics

This subroutine is part of Base Operating System (BOS) Runtime.

Related Information

The memccpy, memchr, memcmp, memmove, or memset subroutine, string (strlen, strchr, strrchr, strpbrk, strspn, strcspn, strstr, or strtok Subroutine) subroutine.

List of Interfaces for Input and Output Handling in AIX 5L Version 5.1 System Management Guide: Operating System and Devices.

Input and Output Handling Programmer's Overview in AIX 5L Version 5.1 General Programming Concepts: Writing and Debugging Programs.


[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]