date and time created 90/05/15 14:01:13 by bostic
[unix-history] / usr / src / lib / libc / string / bstring.3
CommitLineData
76ce485e
KM
1.\" Copyright (c) 1983 Regents of the University of California.
2.\" All rights reserved. The Berkeley software License Agreement
3.\" specifies the terms and conditions for redistribution.
4.\"
b095a144 5.\" @(#)bstring.3 6.5 (Berkeley) %G%
76ce485e 6.\"
100f1cee 7.TH BSTRING 3 ""
76ce485e
KM
8.UC 5
9.SH NAME
10bcopy, bcmp, bzero, ffs \- bit and byte string operations
11.SH SYNOPSIS
12.nf
b095a144 13.B void
100f1cee
KM
14.B bcopy(src, dst, length)
15.B char *src, *dst;
76ce485e
KM
16.B int length;
17.PP
18.B bcmp(b1, b2, length)
19.B char *b1, *b2;
20.B int length;
21.PP
b095a144 22.B void
76ce485e
KM
23.B bzero(b, length)
24.B char *b;
25.B int length;
26.PP
27.B ffs(i)
28.B int i;
29.fi
30.SH DESCRIPTION
31The functions
32.IR bcopy ,
33.IR bcmp ,
34and
35.I bzero
36operate on variable length strings of bytes.
37They do not check for null bytes as the routines in
38.IR string (3)
39do.
40.PP
41.I Bcopy
42copies
43.I length
44bytes from string
100f1cee 45.I src
76ce485e 46to the string
100f1cee 47.IR dst .
d0a528cc
KB
48The
49.I src
50and
51.I dst
52strings may overlap.
76ce485e
KM
53.PP
54.I Bcmp
55compares byte string
56.I b1
57against byte string
58.IR b2 ,
59returning zero if they are identical,
60non-zero otherwise. Both strings are
61assumed to be
62.I length
63bytes long.
f2b516ea
KB
64.B Bcmp
65of
66.I length
67zero bytes always returns zero.
76ce485e
KM
68.PP
69.I Bzero
70places
71.I length
720 bytes in the string
73.IR b1 .
74.PP
ce7e12d3
KB
75\fIFfs\fP finds the first bit set in the argument passed it and returns
76the index of that bit. Bits are numbered starting at 1, from the right.
77A return value of 0 indicates the value passed is zero.
76ce485e
KM
78.SH BUGS
79The
76ce485e 80.I bcopy
100f1cee 81routine take parameters backwards from
76ce485e 82.IR strcpy .