BSD 4_3_Tahoe release
[unix-history] / usr / src / man / man3 / 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.\"
ca67e7b4 5.\" @(#)bstring.3 6.3 (Berkeley) 11/18/87
76ce485e 6.\"
ca67e7b4 7.TH BSTRING 3 "November 18, 1987"
76ce485e
KM
8.UC 5
9.SH NAME
10bcopy, bcmp, bzero, ffs \- bit and byte string operations
11.SH SYNOPSIS
12.nf
100f1cee
KM
13.B bcopy(src, dst, length)
14.B char *src, *dst;
76ce485e
KM
15.B int length;
16.PP
17.B bcmp(b1, b2, length)
18.B char *b1, *b2;
19.B int length;
20.PP
21.B bzero(b, length)
22.B char *b;
23.B int length;
24.PP
25.B ffs(i)
26.B int i;
27.fi
28.SH DESCRIPTION
29The functions
30.IR bcopy ,
31.IR bcmp ,
32and
33.I bzero
34operate on variable length strings of bytes.
35They do not check for null bytes as the routines in
36.IR string (3)
37do.
38.PP
39.I Bcopy
40copies
41.I length
42bytes from string
100f1cee 43.I src
76ce485e 44to the string
100f1cee 45.IR dst .
76ce485e
KM
46.PP
47.I Bcmp
48compares byte string
49.I b1
50against byte string
51.IR b2 ,
52returning zero if they are identical,
53non-zero otherwise. Both strings are
54assumed to be
55.I length
56bytes long.
f2b516ea
KB
57.B Bcmp
58of
59.I length
60zero bytes always returns zero.
76ce485e
KM
61.PP
62.I Bzero
63places
64.I length
650 bytes in the string
66.IR b1 .
67.PP
ce7e12d3
KB
68\fIFfs\fP finds the first bit set in the argument passed it and returns
69the index of that bit. Bits are numbered starting at 1, from the right.
70A return value of 0 indicates the value passed is zero.
76ce485e
KM
71.SH BUGS
72The
76ce485e 73.I bcopy
100f1cee 74routine take parameters backwards from
76ce485e 75.IR strcpy .