bson_init_static(3)

bson_init_static3

Usage

bool
bson_init_static (bson_t *b, const uint8_t *data, size_t length);

Parameters

•

b: A bson_t.

•

data: A buffer to initialize with.

•

length: The length of data in bytes.

Overview

The bson_init_static() function shall initialize a read-only bson_t on the stack using the data provided. No copies of the data will be made and therefore must remain valid for the lifetime of the bson_t.

The resulting bson_t has internal references and therefore must not be copied to avoid dangling pointers in the copy.

Returns

Returns true if bson_t was successfully initialized, otherwise false. The function can fail if data or length are invalid.

Releases

5 releases since Debian 9 (Stretch); the text changed 4 times.

  1. 9
  2. 10
  3. 11
  4. 12
  5. 13

Author

MongoDB, Inc

From libbson-doc 1.30.4-1+deb13u3 in Debian 13 (Trixie). Parsed by carta from the page's man source.