1BSON_INIT_STATIC(3) libbson BSON_INIT_STATIC(3)
2
3
4
6 bson_init_static - bson_init_static()
7
9 bool
10 bson_init_static (bson_t *b, const uint8_t *data, size_t length);
11
13 • b: A bson_t.
14
15 • data: A buffer to initialize with.
16
17 • length: The length of data in bytes.
18
20 The bson_init_static() function shall shall initialize a read-only
21 bson_t on the stack using the data provided. No copies of the data will
22 be made and therefore must remain valid for the lifetime of the bson_t.
23
24 The resulting bson_t has internal references and therefore must not be
25 copied to avoid dangling pointers in the copy.
26
28 Returns true if bson_t was successfully initialized, otherwise false.
29 The function can fail if data or length are invalid.
30
32 MongoDB, Inc
33
35 2017-present, MongoDB, Inc
36
37
38
39
401.20.0 Nov 18, 2021 BSON_INIT_STATIC(3)