.\" Man page generated from reStructuredText. . . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .TH "BSON_NEW_FROM_BUFFER" "3" "Feb 22, 2024" "1.26.0" "libbson" .SH SYNOPSIS .INDENT 0.0 .INDENT 3.5 .sp .EX bson_t * bson_new_from_buffer (uint8_t **buf, size_t *buf_len, bson_realloc_func realloc_func, void *realloc_func_ctx); .EE .UNINDENT .UNINDENT .SH PARAMETERS .INDENT 0.0 .IP \(bu 2 \fBbuf\fP: An out\-pointer to a buffer containing a serialized BSON document, or to NULL. .IP \(bu 2 \fBbuf_len\fP: An out\-pointer to the length of the buffer in bytes. .IP \(bu 2 \fBrealloc_func\fP: Optional \fI\%bson_realloc_func\fP for reallocating the buffer. .IP \(bu 2 \fBrealloc_func_ctx\fP: Optional pointer that will be passed as \fBctx\fP to \fBrealloc_func\fP\&. .UNINDENT .SH DESCRIPTION .sp Creates a new \fI\%bson_t\fP using the data provided. .sp The \fBrealloc_func\fP, if provided, is called to resize \fBbuf\fP if the document is later expanded, for example by a call to one of the \fBbson_append\fP functions. .sp If \fB*buf\fP is initially NULL then it is allocated, using \fBrealloc_func\fP or the default allocator, and initialized with an empty BSON document, and \fB*buf_len\fP is set to 5, the size of an empty document. .SH RETURNS .sp A newly\-allocated \fI\%bson_t\fP on success, or NULL. .SH AUTHOR MongoDB, Inc .SH COPYRIGHT 2017-present, MongoDB, Inc .\" Generated by docutils manpage writer. .