BSON_APPEND_VE...KED_BIT_UNINIT(3)

πŸ“¦
version 2.5.6 Β· 3 versions
, in epel 10

πŸ’… BSON_APPEND_VE...KED_BIT_UNINIT(3) β€” libbson bestie era ✨

okay so this is the libbson manual page for BSON_APPEND_VECTOR_PACKED_BIT_UNINIT(3), and it’s lowkey a β€œyou allocate it, you fill it” situation. no cap. 🫢


✨ SYNOPSIS ✨

#define BSON_APPEND_VECTOR_PACKED_BIT_UNINIT(b, key, count, view) \
   bson_append_vector_packed_bit_uninit (b, key, (int) strlen (key), count, view)

bool
bson_append_vector_packed_bit_uninit (bson_t *bson,
                                      const char *key,
                                      int key_length,
                                      size_t element_count,
                                      bson_vector_packed_bit_view_t *view_out);

πŸŽ€ PARAMETERS πŸŽ€

  • bson β€” a bson_t. the main character we’re appending to πŸ’–
  • key β€” an ASCII C string holding the name of the field. yes, ASCII, bestie.
  • key_length β€” the length of key in bytes, or -1 to let strlen() figure out the length for you ✨
  • element_count β€” number of elements to allocate space for. that’s the count, periodt.
  • view_out β€” receives a bson_vector_packed_bit_view_t with uninitialized elements. not me handing you uninitialized elements πŸ’€

🌸 DESCRIPTION 🌸

Appends a new field to bson by allocating a Vector with the indicated number of packed_bit elements. the elements will be uninitialized. so on success, the caller must write every element in the Vector if the resulting bson_t is to be used. literally every single one, iykyk. 🧚

The view written to *view_out is only valid until bson is otherwise modified or freed. so don’t get attached, bestie β€” it’s giving temporary main character energy 😭


πŸ”₯ RETURNS πŸ”₯

Returns true if the operation was applied successfully. The function fails if appending the array grows bson larger than INT32_MAX. that’s the limit, no cap.


πŸ‘‘ AUTHOR πŸ‘‘

MongoDB, Inc


2009-present, MongoDB, Inc.


and that’s the whole vibe: libbson version 2.5.6, dated Oct 09, 202 (the original footer is literally getting eaten by the title after that 😭), MongoDB, Inc., 2009-present. slay, you made it to the end πŸ’œ

πŸ“¦ where this page comes from