BSD 4_3 release
[unix-history] / usr / 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.\"
95f51977 5.\" @(#)bstring.3 6.1 (Berkeley) 5/15/85
76ce485e 6.\"
95f51977 7.TH BSTRING 3 "May 15, 1985"
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.
57.PP
58.I Bzero
59places
60.I length
610 bytes in the string
62.IR b1 .
63.PP
64.I Ffs
65find the first bit set in the argument passed it and
66returns the index of that bit. Bits are numbered
100f1cee 67starting at 1. A return value of 0 indicates the
76ce485e
KM
68value passed is zero.
69.SH BUGS
70The
76ce485e 71.I bcopy
100f1cee 72routine take parameters backwards from
76ce485e 73.IR strcpy .