Commit | Line | Data |
---|---|---|
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 | |
10 | bcopy, 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 | |
29 | The functions | |
30 | .IR bcopy , | |
31 | .IR bcmp , | |
32 | and | |
33 | .I bzero | |
34 | operate on variable length strings of bytes. | |
35 | They do not check for null bytes as the routines in | |
36 | .IR string (3) | |
37 | do. | |
38 | .PP | |
39 | .I Bcopy | |
40 | copies | |
41 | .I length | |
42 | bytes from string | |
100f1cee | 43 | .I src |
76ce485e | 44 | to the string |
100f1cee | 45 | .IR dst . |
76ce485e KM |
46 | .PP |
47 | .I Bcmp | |
48 | compares byte string | |
49 | .I b1 | |
50 | against byte string | |
51 | .IR b2 , | |
52 | returning zero if they are identical, | |
53 | non-zero otherwise. Both strings are | |
54 | assumed to be | |
55 | .I length | |
56 | bytes long. | |
f2b516ea KB |
57 | .B Bcmp |
58 | of | |
59 | .I length | |
60 | zero bytes always returns zero. | |
76ce485e KM |
61 | .PP |
62 | .I Bzero | |
63 | places | |
64 | .I length | |
65 | 0 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 |
69 | the index of that bit. Bits are numbered starting at 1, from the right. | |
70 | A return value of 0 indicates the value passed is zero. | |
76ce485e KM |
71 | .SH BUGS |
72 | The | |
76ce485e | 73 | .I bcopy |
100f1cee | 74 | routine take parameters backwards from |
76ce485e | 75 | .IR strcpy . |