1BSON_NEW_FROM_BUFFER(3)             libbson            BSON_NEW_FROM_BUFFER(3)
2
3
4

NAME

6       bson_new_from_buffer - bson_new_from_buffer()
7

SYNOPSIS

9          bson_t *
10          bson_new_from_buffer (uint8_t **buf,
11                                size_t *buf_len,
12                                bson_realloc_func realloc_func,
13                                void *realloc_func_ctx);
14

PARAMETERS

16       · buf:  An  out-pointer  to a buffer containing a serialized BSON docu‐
17         ment, or to NULL.
18
19       · buf_len: An out-pointer to the length of the buffer in bytes.
20
21       · realloc_func: Optional bson_realloc_func for reallocating the buffer.
22
23       · realloc_func_ctx: Optional pointer that will  be  passed  as  ctx  to
24         realloc_func.
25

DESCRIPTION

27       Creates a new bson_t using the data provided.
28
29       The  realloc_func, if provided, is called to resize buf if the document
30       is later expanded, for example by a call  to  one  of  the  bson_append
31       functions.
32
33       If  *buf  is initially NULL then it is allocated, using realloc_func or
34       the default allocator, and initialized with an empty BSON document, and
35       *buf_len is set to 5, the size of an empty document.
36

RETURNS

38       A newly-allocated bson_t on success, or NULL.
39

AUTHOR

41       MongoDB, Inc
42
44       2017-present, MongoDB, Inc
45
46
47
48
491.16.2                           Feb 25, 2020          BSON_NEW_FROM_BUFFER(3)
Impressum