BSTRING(3) C LIBRARY FUNCTIONS BSTRING(3) NAME bstring, bcopy, bcmp, bzero, ffs - bit and byte string operations SYNOPSIS void bcopy(b1, b2, length) char *b1, *b2; int length; int bcmp(b1, b2, length) char *b1, *b2; int length; void bzero(b, length) char *b; int length; int 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 _l_e_n_g_t_h bytes from string _b_1 to the string _b_2. Overlapping strings are handled correctly. bcmp() compares byte string _b_1 against byte string _b_2, returning zero if they are identical, non-zero otherwise. Both strings are assumed to be _l_e_n_g_t_h bytes long. bcmp() of length zero bytes always returns zero. bzero() places _l_e_n_g_t_h 0 bytes in the string _b. ffs() finds the first bit set in the argument passed it and returns the index of that bit. Bits are numbered starting at 1 from the right. A return value of zero indicates that the value passed is zero. NOTES The bcmp() and bcopy() routines take parameters backwards from strcmp() and strcpy(). SEE ALSO string(3) Sun Release 4.1 Last change: 23 November 1987 1