Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

BSTRING(3)                           BSD                            BSTRING(3)



NAME
     bcopy, bcmp, bzero, ffs - bit and byte string operations

SYNOPSIS
     bcopy(src, dst, length)
     char *src, *dst;
     int length;

     bcmp(b1, b2, length)
     char *b1, *b2;
     int length;

     bzero(b, length)
     char *b;
     int length;

     ffs(i)
     int i;

DESCRIPTION
     The functions bcopy, bcmp, and bzero operate on variable-length strings
     of bytes.  They do not check for null bytes as the routines in string(3)
     do.

     bcopy copies length bytes from string src to the string dst.

     bcmp compares byte string b1 against byte string b2, returning 0 if they
     are identical, nonzero otherwise.  Both strings are assumed to be length
     bytes long.

     bzero places length 0 bytes in the string b1.

     ffs find the first bit set in the argument passed it and returns the
     index of that bit.  Bits are numbered starting at 1.  A return value of 0
     indicates the value passed is 0.

BUGS
     The bcopy routine take parameters backward from strcpy.  For example,

          bcopy (foo, bar, 3)

     copies foo to bar, while

          strcpy (foo, bar)

     copies bar to foo.

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