Files
seta75D ff309bfe1c Init
2021-10-11 18:37:13 -03:00

90 lines
2.0 KiB
Groff

.\" @(#)bstring.3 1.1 94/10/31 SMI; from UCB 4.2
.TH BSTRING 3 "23 November 1987"
.SH NAME
bstring, bcopy, bcmp, bzero, ffs \- bit and byte string operations
.SH SYNOPSIS
.nf
.B void
.B bcopy(b1, b2, length)
.B char \(**b1, \(**b2;
.B int length;
.LP
.B int bcmp(b1, b2, length)
.B char \(**b1, \(**b2;
.B int length;
.LP
.B void
.B bzero(b, length)
.B char \(**b;
.B int length;
.LP
.B int ffs(i)
.B int i;
.fi
.IX "bcopy()" "" "\fLbcopy()\fP \(em copy byte strings"
.IX "byte string functions" bcopy() "" \fLbcopy()\fP
.IX "copy" "byte strings \(em \fLbcopy()\fP"
.IX "bcmp()" "" "\fLbcmp()\fP \(em compare byte strings"
.IX "byte string functions" bcmp() "" \fLbcmp()\fP
.IX "compare" "byte strings \(em \fLbcmp()\fP"
.IX "bzero()" "" "\fLbzero()\fP \(em zero byte strings"
.IX "byte string functions" bzero() "" \fLbzero()\fP
.IX "zero byte strings \(em bzero()" "" "zero byte strings \(em \fLbzero()\fP"
.IX "ffs()" "" "\fLffs()\fP \(em find first one bit"
.IX "bit string functions \(em \fLffs()\fP"
.IX find "first one bit \(em \fLffs()\fP"
.SH DESCRIPTION
.LP
The functions
.BR bcopy ,
.BR bcmp ,
and
.B bzero(\|)
operate on variable length strings of bytes. They do not check for
null bytes as the routines in
.BR string (3)
do.
.LP
.B bcopy(\|)
copies
.I length
bytes from string
.I b1
to the string
.IR b2 .
Overlapping strings are handled correctly.
.LP
.B bcmp(\|)
compares byte string
.I b1
against byte string
.IR b2 ,
returning zero if they are identical, non-zero otherwise.
Both strings are assumed to be
.I length
bytes long.
.B bcmp(\|)
of length zero bytes always returns zero.
.LP
.B bzero(\|)
places
.I length
0 bytes in the string
.IR b .
.LP
.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.
.SH NOTES
The
.B bcmp(\|)
and
.B bcopy(\|)
routines take parameters backwards from
.B strcmp(\|)
and
.BR strcpy(\|) .
.SH SEE ALSO
.BR string (3)