.\" Man page generated from reStructuredText. . .TH "BSON_INIT_STATIC" "3" "Jun 04, 2021" "1.17.6" "libbson" .SH NAME bson_init_static \- bson_init_static() . .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 .. .SH SYNOPSIS .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C bool bson_init_static (bson_t *b, const uint8_t *data, size_t length); .ft P .fi .UNINDENT .UNINDENT .SH PARAMETERS .INDENT 0.0 .IP \(bu 2 \fBb\fP: A \fBbson_t\fP\&. .IP \(bu 2 \fBdata\fP: A buffer to initialize with. .IP \(bu 2 \fBlength\fP: The length of \fBdata\fP in bytes. .UNINDENT .SH DESCRIPTION .sp The \fBbson_init_static()\fP function shall shall initialize a read\-only \fBbson_t\fP 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 \fBbson_t\fP\&. .sp The resulting \fIbson_t\fP has internal references and therefore must not be copied to avoid dangling pointers in the copy. .SH RETURNS .sp Returns \fBtrue\fP if \fBbson_t\fP was successfully initialized, otherwise \fBfalse\fP\&. The function can fail if \fBdata\fP or \fBlength\fP are invalid. .SH AUTHOR MongoDB, Inc .SH COPYRIGHT 2017-present, MongoDB, Inc .\" Generated by docutils manpage writer. .