Man page - libwget-bitmap(3)
Packages contains this manual
- libwget-console(3)
- libwget-utils(3)
- libwget-error(3)
- libwget-hash(3)
- libwget-net(3)
- libwget-stringmap(3)
- libwget-xml(3)
- libwget-dns(3)
- libwget-robots(3)
- libwget-base64(3)
- libwget-io(3)
- libwget-parse_sitemap(3)
- libwget-dns-caching(3)
- libwget-printf(3)
- libwget-bitmap(3)
- libwget-vector(3)
- libwget-ip(3)
- libwget-hashmap(3)
- libwget-mem(3)
- libwget-thread(3)
- libwget-parse_atom(3)
- libwget-xalloc(3)
- libwget-random(3)
- libwget-list(3)
apt-get install wget2-dev
Manual
libwget-bitmap
NAMESYNOPSIS
Data Structures
Macros
Functions
Detailed Description
Function Documentation
void wget_bitmap_set (wget_bitmap * b, unsigned n)
void wget_bitmap_clear (wget_bitmap * b, unsigned n)
bool wget_bitmap_get (const wget_bitmap * b, unsigned n)
int wget_bitmap_init (wget_bitmap ** b, unsigned bits)
void wget_bitmap_free (wget_bitmap ** b)
Author
NAME
libwget-bitmap - Bitmap management functions
SYNOPSIS
Data Structures
struct wget_bitmap_st
Macros
#define
bitmap_type
uint64_t
#define
bitmap_bits
(sizeof(bitmap_type) * 8)
#define
bitmap_shift
6
#define
map
(n) (((
wget_bitmap
*)b)->map[(n)
>> bitmap_shift])
#define
bit
(n) (((bitmap_type) 1) << ((n) &
(bitmap_bits - 1)))
Functions
void
wget_bitmap_set
(
wget_bitmap
*b, unsigned n)
void
wget_bitmap_clear
(
wget_bitmap
*b,
unsigned n)
bool
wget_bitmap_get
(const
wget_bitmap
*b,
unsigned n)
int
wget_bitmap_init
(
wget_bitmap
**b,
unsigned bits)
void
wget_bitmap_free
(
wget_bitmap
**b)
Detailed Description
Bitmap (bit array) implementation.
This is useful when you need a bitmap with more than 64 bits. Up to 64 bits you can use the C99 uint64_t as a standard C bitfield.
As a usage example, Wget2 uses bitmaps for options with lists of HTTP status codes, which have values of 100-699.
Function Documentation
void wget_bitmap_set (wget_bitmap * b, unsigned n)
Parameters
b
Bitmap to act on
n
Number of the bit to set (0-...)
Set the bit n in the bitmap b .
void wget_bitmap_clear (wget_bitmap * b, unsigned n)
Parameters
b
Bitmap to act on
n
Number of the bit to clear (0-...)
Clear the bit n in the bitmap b .
bool wget_bitmap_get (const wget_bitmap * b, unsigned n)
Parameters
b
Bitmap to read from
n
Number of the bit of interest (0-...)
Returns
0 if bit n is cleared or if n is out of range 1 if bit is set
Returns whether the bit n is set or not.
int wget_bitmap_init (wget_bitmap ** b, unsigned bits)
Parameters
b
Pointer to the
allocated bitmap
bits
Number of bits
Returns
A wget_error value
Allocates a bitmap with a capacity of bits . It must be freed by wget_bitmap_free() after usage.
void wget_bitmap_free (wget_bitmap ** b)
Parameters
b Pointer to bitmap to free
Frees and clears the bitmap pointed to by b .
Author
Generated automatically by Doxygen for wget2 from the source code.