.\" Man page generated from reStructuredText. . .TH "BSON_READER_READ" "3" "Jun 04, 2021" "1.17.6" "libbson" .SH NAME bson_reader_read \- bson_reader_read() . .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 const bson_t * bson_reader_read (bson_reader_t *reader, bool *reached_eof); .ft P .fi .UNINDENT .UNINDENT .SH PARAMETERS .INDENT 0.0 .IP \(bu 2 \fBreader\fP: A \fBbson_reader_t\fP\&. .IP \(bu 2 \fBreached_eof\fP: A UNKNOWN. .UNINDENT .SH DESCRIPTION .sp The \fBbson_reader_read()\fP function shall read the next document from the underlying file\-descriptor or buffer. .sp If there are no further documents or a failure was detected, then NULL is returned. .sp If we reached the end of the sequence, \fBreached_eof\fP is set to true. .sp To detect an error, check for NULL and \fBreached_of\fP is false. .SH RETURNS .sp A \fBbson_t\fP that should not be modified or freed. .SH EXAMPLE .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C const bson_t *doc; bool reached_eof = false; while ((doc = bson_reader_read (reader, &reached_eof))) { /* do something */ } if (!reached_eof) { fprintf (stderr, "Failed to read all documents.\en"); } .ft P .fi .UNINDENT .UNINDENT .SH AUTHOR MongoDB, Inc .SH COPYRIGHT 2017-present, MongoDB, Inc .\" Generated by docutils manpage writer. .