bson_new_from_buffer(3)

bson_new_from_buffer3

Usage

bson_t *
bson_new_from_buffer (uint8_t **buf,
                      size_t *buf_len,
                      bson_realloc_func realloc_func,
                      void *realloc_func_ctx);

Parameters

•

buf: An out-pointer to a buffer containing a serialized BSON document, or to NULL.

•

buf_len: An out-pointer to the length of the buffer in bytes.

•

realloc_func: Optional bson_realloc_func for reallocating the buffer.

•

realloc_func_ctx: Optional pointer that will be passed as ctx to realloc_func.

Overview

Creates a new bson_t using the data provided.

The realloc_func, if provided, is called to resize buf if the document is later expanded, for example by a call to one of the bson_append functions.

If *buf is initially NULL then it is allocated, using realloc_func or the default allocator, and initialized with an empty BSON document, and *buf_len is set to 5, the size of an empty document.

Returns

A newly-allocated bson_t on success, or NULL.

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.