libwget-bitmap(3)
π libwget-bitmap(3) π
okay bestie, welcome to the libwget-bitmap page from the Library Functions Manual β yes it's a manual page, yes we're making it cute, and yes every single flag, macro and signature is staying exactly where it belongs. no cap. π
β¨ NAME β¨
libwget-bitmap β bitmap management functions π
Like, it's the whole vibe of managing bitmaps. That's the job. That's the girlboss.
π 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)
#define bit(n)
β 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 πΈ
It's a bitmap (aka bit array) implementation. iconic behavior honestly.
Bestie, here's when you need her: this is useful when you need a bitmap with more than 64 bits. Up to 64 bits you can just use the C99 uint64_t as a standard C bitfield and call it a day. but if you want more? she's right there. π«Ά
As a usage example, Wget2 uses bitmaps for options with lists of HTTP status codes, which have values of 100-699. so yeah, real ones use it.
π Macro Definition Documentation π
π #define map( n)
Value:
(((wget_bitmap *)b)->map[(n) >> bitmap_shift])
π #define bit( n)
Value:
(((bitmap_type) 1) << ((n) & (bitmap_bits - 1)))
π₯ Function Documentation π₯
π void wget_bitmap_set (wget_bitmap * b, unsigned n)
Parameters
bβ Bitmap to act onnβ Number of the bit to set (0-...)
Set the bit n in the bitmap b. that's it, that's the whole function, and she ate. π
β¨ void wget_bitmap_clear (wget_bitmap * b, unsigned n)
Parameters
bβ Bitmap to act onnβ Number of the bit to clear (0-...)
Clear the bit n in the bitmap b. unsetting, but make it fashion. π
π bool wget_bitmap_get (const wget_bitmap * b, unsigned n)
Parameters
bβ Bitmap to read fromnβ 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. literally just a vibe check on one single bit. π¦
π§ int wget_bitmap_init (wget_bitmap ** b, unsigned bits)
Parameters
bβ Pointer to the allocated bitmapbitsβ 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.
bestie. do not forget the free. she is not self-cleaning. π
π void wget_bitmap_free (wget_bitmap ** b)
Parameters
bβ Pointer to bitmap to free
Frees and clears the bitmap pointed to by b. clean up your room, queen. π
π Author π
Generated automatically by Doxygen for wget2 from the source code. not a human, just a robot doing her little tasks. π€π
and that's the whole page, periodt. π this beauty ships with wget2, Version 2.3.0 β mwah, take care of her, and don't leak the bitmap. πβ¨
π¦ where this page comes from
- fedora 44: wget2-devel 2.3.0-1.fc44
- fedora 44: wget2-devel 2.3.0-1.fc44
- fedora 44: wget2-devel 2.3.0-3.fc44 Β· GPL-3.0-or-later AND LGPL-3.0-or-later AND GFDL-1.3-or-later
- fedora 44: wget2-devel 2.3.0-3.fc44 Β· GPL-3.0-or-later AND LGPL-3.0-or-later AND GFDL-1.3-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms