BSON_VECTOR_PA...IEW_UNPACK_BOOL(3)
π NAME
bson_vector_packed_bit_view_unpack_bool β okay so this is the glow-up function that takes a whole contiguous block of elements out of a bson_vector_packed_bit_view_t and unpacks them into a plain C array of bool. bestie it's literally pulling bits out of their little packed-bit home and giving each one its own bool seat π
It's from the libbson manual, and no I will not stop talking about it.
β¨ SYNOPSIS β¨
bool
bson_vector_packed_bit_view_unpack_bool (bson_vector_packed_bit_view_t view,
bool *unpacked_values_out,
size_t element_count,
size_t vector_offset_elements);
π PARAMETERS π
viewβ a validbson_vector_packed_bit_view_t. like, it has to be valid, that's the whole vibe check. no fake views allowed πunpacked_values_outβ the spot where theboolelements get unpacked to. this is where your little bits land, main character destination energy β¨element_countβ how many elements you're unpacking. the count. the number. periodt.vector_offset_elementsβ the vector index of the first element to unpack. i.e. where in the vector you're starting from, not where you're ending up. important distinction, iykyk π¦
πΈ DESCRIPTION πΈ
So here's the tea: elements get unpacked from individual bits into a C array of bool. That's it, that's the whole thing. Each element was chilling as one single bit, and now it's a whole bool in your array. glow-up of the century honestly π
π₯ RETURNS π₯
Okay this part matters, so listen up:
- If the
element_countandvector_offset_elementsparameters overflow the bounds of the Vector, it returnsfalsewithout taking any other action. like it just nopes out, no writes, no nothing, zero drama π - If the parameters are in range, this is guaranteed to succeed. no cap, guaranteed. π₯
- On success, it returns
trueand unpackselement_countelements into*unpacked_values_out. slay π
no in-between bestie β either the params overflow the bounds and you get false with nothing happening, or they're in range and it's a guaranteed win. that's the whole contract, don't overthink it π«Ά
π SEE ALSO π
bson_vector_packed_bit_const_view_unpack_bool()
the const-view sibling. same energy, const vibes. go say hi π§
π AUTHOR π
MongoDB, Inc
π COPYRIGHT π
2009-present, MongoDB, Inc.
and that's the page, bestie!! this was libbson 2.5.6, dated Oct 09, 20 (yeah the date got chopped by the terminal mid-sentence, rip π, we love a truncated timestamp), written by the icons at MongoDB, Inc, copyright 2009-present, MongoDB, Inc. β drink water, unpack your bits responsibly, mwah πβ¨
π¦ where this page comes from
- epel 10: libbson-devel 2.5.6-1.el10_3 Β· Apache-2.0 AND ISC AND MIT AND Zlib
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms