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

Technical Reference: Base Operating System and Extensions, Volume 1


bcopy, bcmp, bzero or ffs Subroutine

Purpose

Performs bit and byte string operations.

Library

Standard C Library (libc.a)

Syntax

#include <strings.h>

void bcopy (Source, Destination, Length)
const void *Source,
char *Destination;
size_t Length;

int bcmp (String1, String2, Length)
const void *String1, *String2;
size_t Length;

void bzero (String,Length)
char *String;
int Length;

int ffs (Index)
int Index;

Description

Note: The bcopy subroutine takes parameters backwards from the strcpy subroutine.

The bcopy, bcmp, and bzero subroutines operate on variable length strings of bytes. They do not check for null bytes as do the string routines.

The bcopy subroutine copies the value of the Length parameter in bytes from the string in the Source parameter to the string in the Destination parameter.

The bcmp subroutine compares the byte string in the String1 parameter against the byte string of the String2 parameter, returning a zero value if the two strings are identical and a nonzero value otherwise. Both strings are assumed to be Length bytes long.

The bzero subroutine zeroes out the string in the String parameter for the value of the Length parameter in bytes.

The ffs subroutine finds the first bit set in the Index parameter passed to it and returns the index of that bit. Bits are numbered starting at 1. A return value of 0 indicates that the value passed is 0.

Implementation Specifics

These subroutines are part of Base Operating System (BOS) Runtime.

Related Information

The memcmp, memccpy, memchr, memcpy, memmove, memset (memccpy, memchr, memcmp, memcpy, memset or memmove Subroutine) subroutines, strcat, strncat, strxfrm, strcpy, strncpy, or strdup subroutine, strcmp, strncmp, strcasecmp, strncasecmp, or strcoll subroutine, strlen, strchr, strrchr, strpbrk, strspn, strcspn, strstr, or strtok subroutine, swab subroutine.

List of String Manipulation Subroutines and Subroutines, Example Programs, and Libraries in AIX 5L Version 5.1 General Programming Concepts: Writing and Debugging Programs.


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