Line | |
---|
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 | .\"
|
---|
5 | .\" @(#)bstring.3 6.1 (Berkeley) 5/15/85
|
---|
6 | .\"
|
---|
7 | .TH BSTRING 3 "May 15, 1985"
|
---|
8 | .UC 5
|
---|
9 | .SH NAME
|
---|
10 | bstring, bcopy, bcmp, bzero, ffs \- bit and byte string operations
|
---|
11 | .SH SYNOPSIS
|
---|
12 | .nf
|
---|
13 | .ft B
|
---|
14 | #include <sys/types.h>
|
---|
15 | #include <string.h>
|
---|
16 | #include <unistd.h>
|
---|
17 |
|
---|
18 | void bcopy(const void *\fIsrc\fP, void *\fIdst\fP, size_t \fIlength\fP)
|
---|
19 | int bcmp(const void *\fIb1\fP, const void *\fIb2\fP, size_t \fIlength\fP)
|
---|
20 | void bzero(void *\fIdst\fP, size_t \fIlength\fP)
|
---|
21 | int ffs(int \fIi\fP)
|
---|
22 | .ft R
|
---|
23 | .fi
|
---|
24 | .SH DESCRIPTION
|
---|
25 | The functions
|
---|
26 | .BR bcopy ,
|
---|
27 | .BR bcmp ,
|
---|
28 | and
|
---|
29 | .B bzero
|
---|
30 | operate on variable length strings of bytes.
|
---|
31 | They do not check for null bytes as the routines in
|
---|
32 | .BR string (3)
|
---|
33 | do.
|
---|
34 | .PP
|
---|
35 | .B Bcopy
|
---|
36 | copies
|
---|
37 | .I length
|
---|
38 | bytes from string
|
---|
39 | .I src
|
---|
40 | to the string
|
---|
41 | .IR dst .
|
---|
42 | .PP
|
---|
43 | .B Bcmp
|
---|
44 | compares byte string
|
---|
45 | .I b1
|
---|
46 | against byte string
|
---|
47 | .IR b2 ,
|
---|
48 | returning zero if they are identical,
|
---|
49 | non-zero otherwise. Both strings are
|
---|
50 | assumed to be
|
---|
51 | .I length
|
---|
52 | bytes long.
|
---|
53 | .PP
|
---|
54 | .B Bzero
|
---|
55 | places
|
---|
56 | .I length
|
---|
57 | 0 bytes in the string
|
---|
58 | .IR b1 .
|
---|
59 | .PP
|
---|
60 | .B Ffs
|
---|
61 | find the first bit set in the argument passed it and
|
---|
62 | returns the index of that bit. Bits are numbered
|
---|
63 | starting at 1. A return value of 0 indicates the
|
---|
64 | value passed is zero.
|
---|
65 | .SH BUGS
|
---|
66 | The
|
---|
67 | .BR bcopy ,
|
---|
68 | .BR bcmp ,
|
---|
69 | and
|
---|
70 | .BR bzero
|
---|
71 | functions are obsolete; new code should use
|
---|
72 | .BR memmove ,
|
---|
73 | .BR memcmp ,
|
---|
74 | and
|
---|
75 | .BR memset
|
---|
76 | respectively.
|
---|
77 | .PP
|
---|
78 | The
|
---|
79 | .B bcopy
|
---|
80 | routine takes parameters backwards from
|
---|
81 | .BR memcpy ,
|
---|
82 | .BR memmove ,
|
---|
83 | and
|
---|
84 | .BR strcpy .
|
---|
Note:
See
TracBrowser
for help on using the repository browser.