.\" 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_READER_READ" "3" "Feb 22, 2024" "1.26.0" "libbson" .SH SYNOPSIS .INDENT 0.0 .INDENT 3.5 .sp .EX const bson_t * bson_reader_read (bson_reader_t *reader, bool *reached_eof); .EE .UNINDENT .UNINDENT .SH PARAMETERS .INDENT 0.0 .IP \(bu 2 \fBreader\fP: A \fI\%bson_reader_t\fP\&. .IP \(bu 2 \fBreached_eof\fP: A UNKNOWN. .UNINDENT .SH DESCRIPTION .sp The \fI\%bson_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 \fI\%bson_t\fP that should not be modified or freed. .SH EXAMPLE .INDENT 0.0 .INDENT 3.5 .sp .EX const bson_t *doc; bool reached_eof = false; while ((doc = bson_reader_read (reader, &reached_eof))) { /* do something */ } if (!reached_eof) { fprintf (stderr, \(dqFailed to read all documents.\en\(dq); } .EE .UNINDENT .UNINDENT .SH AUTHOR MongoDB, Inc .SH COPYRIGHT 2017-present, MongoDB, Inc .\" Generated by docutils manpage writer. .