Query: setbit
OS: netbsd
Section: 9
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
SETBIT(9) BSD Kernel Developer's Manual SETBIT(9)NAMEsetbit -- macros related to bitmapsSYNOPSIS#include <sys/param.h> void setbit(array, x); void clrbit(array, x); int isset(array, x); int isclr(array, x);DESCRIPTIONThe setbit family of macros operate with bitmaps, also known as bit arrays. In a nutshell, setbit() sets the bit x in array, clrbit() clears it, isset() tests whether x is set, and isclr() returns 1 if x is not set.EXAMPLESThe following example declares a buffer of 10 chars, treating it as an array of 80 bits: char buf[10]; ... setbit(buf, 12); /* set the fifth bit in the second byte */SEE ALSObitstring(3)CAVEATSThe number of valid bits in a given array is assumed to be multiple of CHAR_BIT, the number of bits for smallest object that is not a bit- field.BSDMarch 1, 2010 BSD
Related Man Pages |
---|
bitstring(3) - freebsd |
bit_alloc(3) - freebsd |
bit_test(3) - freebsd |
bit_set(3) - freebsd |
bitstr_size(3) - freebsd |
Similar Topics in the Unix Linux Community |
---|
Memory Leaks |
Grandpa returning to UNIX |
BSD Unix Toolbox: 1000+ Commands for FreeBSD, OpenBSD, and NetBSD |