bstring(3)
NAME
bcopy, bcmp, bzero, ffs − bit and byte string operations
SYNTAX
int bcopy(b1, b2, length)
char *b1, *b2;
int length;
int bcmp(b1, b2, length)
char *b1, *b2;
int length;
int bzero(b1, length)
char *b1;
int length;
int ffs(i)
int i;
DESCRIPTION
The bcopy, bcmp, and bzero subroutines operate on variable length strings of bytes. They do not check for null bytes as do the routines in string(3).
The bcopy subroutine copies length bytes from string b1 to the string b2.
The bcmp subroutine compares byte string b1 against byte string b2. Both strings are assumed to be length bytes long.
The bzero subroutine places length 0 bytes in the string b1.
The ffs subroutine finds the first bit set in i, and returns the index of that bit. Bits are numbered starting at 1.
RESTRICTIONS
The bcmp and bcopy subroutines take parameters backwards from those of strcmp and strcpy.
RETURN VALUE
If unsuccessful, bcmp returns a non-zero value. If i is zero, ffs returns a −1.