-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbfsetbit.3.in
28 lines (28 loc) · 1.57 KB
/
bfsetbit.3.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
.TH bfsetbit 3 "%RELEASE_DATE%" "bitfield %VERSION%" "Bit array manipulation library"
.SH NAME
bfsetbit, bfclearbit, bfgetbit, bftogglebit \- manipulate one bit in a bit array.
.SH SYNOPSIS
.nf
.B "#include <bitfield.h>
.sp
.BI "void bfsetbit(struct bitfield *"instance ", const unsigned int "bit ");
.BI "void bfclearbit(struct bitfield *"instance ", const unsigned int "bit ");
.BI "int bfgetbit(const struct bitfield *"instance ", const unsigned int "bit ");
.BI "void bftogglebit(struct bitfield *"instance ", const unsigned int "bit ");
.fi
.SH DESCRIPTION
A bit array is represented by a "struct bitfield". It has two elements: an array of unsigned long integers \fIfield\fR and an unsigned integer \fIsize\fR.
.sp
The \fBbfsetbit()\fR function takes a pointer to bitfield \fIinstance\fR and an integer \fIbit\fR, and sets bit number \fIbit\fR (i.e. fills it with a unit).
.sp
The \fBbfclearbit()\fR function takes a pointer to bitfield \fIinstance\fR and an integer \fIbit\fR, and clears bit number \fIbit\fR (i.e. fills it with a zero).
.sp
The \fBbfgetbit()\fR function takes a pointer to bitfield \fIinstance\fR and an integer \fIbit\fR, and returns the state if bit number \fIbit\fR (i.e. 1 if the bit is set and 0 otherwise).
.sp
The \fBbftogglebit()\fR function takes a pointer to bitfield \fIinstance\fR and an integer \fIbit\fR, and toggles the state if bit number \fIbit\fR (i.e. sets the bit if it was clear and clears it if it was set).
.sp
.SH "SEE ALSO"
For the full list of bitfield functions and their descriptions, see manual page for
.BR bitfield (3).
.SH AUTHOR
Vitalie CIUBOTARU