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 | .\" | |
b095a144 | 5 | .\" @(#)bstring.3 6.5 (Berkeley) %G% |
76ce485e | 6 | .\" |
100f1cee | 7 | .TH BSTRING 3 "" |
76ce485e KM |
8 | .UC 5 |
9 | .SH NAME | |
10 | bcopy, 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 | |
31 | The functions | |
32 | .IR bcopy , | |
33 | .IR bcmp , | |
34 | and | |
35 | .I bzero | |
36 | operate on variable length strings of bytes. | |
37 | They do not check for null bytes as the routines in | |
38 | .IR string (3) | |
39 | do. | |
40 | .PP | |
41 | .I Bcopy | |
42 | copies | |
43 | .I length | |
44 | bytes from string | |
100f1cee | 45 | .I src |
76ce485e | 46 | to the string |
100f1cee | 47 | .IR dst . |
d0a528cc KB |
48 | The |
49 | .I src | |
50 | and | |
51 | .I dst | |
52 | strings may overlap. | |
76ce485e KM |
53 | .PP |
54 | .I Bcmp | |
55 | compares byte string | |
56 | .I b1 | |
57 | against byte string | |
58 | .IR b2 , | |
59 | returning zero if they are identical, | |
60 | non-zero otherwise. Both strings are | |
61 | assumed to be | |
62 | .I length | |
63 | bytes long. | |
f2b516ea KB |
64 | .B Bcmp |
65 | of | |
66 | .I length | |
67 | zero bytes always returns zero. | |
76ce485e KM |
68 | .PP |
69 | .I Bzero | |
70 | places | |
71 | .I length | |
72 | 0 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 |
76 | the index of that bit. Bits are numbered starting at 1, from the right. | |
77 | A return value of 0 indicates the value passed is zero. | |
76ce485e KM |
78 | .SH BUGS |
79 | The | |
76ce485e | 80 | .I bcopy |
100f1cee | 81 | routine take parameters backwards from |
76ce485e | 82 | .IR strcpy . |