source: trunk/minix/man/man3/bstring.3@ 11

Last change on this file since 11 was 9, checked in by Mattia Monga, 14 years ago

Minix 3.1.2a

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