libwget-bitmap(3) | Library Functions Manual | libwget-bitmap(3) |
libwget-bitmap - Bitmap management functions
struct wget_bitmap_st
#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)))
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)
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.
Parameters
Set the bit n in the bitmap b.
Parameters
Clear the bit n in the bitmap b.
Parameters
Returns
Returns whether the bit n is set or not.
Parameters
Returns
Allocates a bitmap with a capacity of bits. It must be freed by wget_bitmap_free() after usage.
Parameters
Frees and clears the bitmap pointed to by b.
Generated automatically by Doxygen for wget2 from the source code.
Version 2.1.0 | wget2 |