<?xml version="1.0"?>
<page xmlns="http://projectmallard.org/1.0/"
      type="topic"
      style="function"
      xmlns:api="http://projectmallard.org/experimental/api/"
      xmlns:ui="http://projectmallard.org/experimental/ui/"
      id="bson_init_static">
  <info>
    <link type="guide" xref="bson_t" group="function"/>
  </info>
  <title>bson_init_static()</title>

  <section id="synopsis">
    <title>Synopsis</title>
    <synopsis><code mime="text/x-csrc"><![CDATA[bool
bson_init_static (bson_t        *b,
                  const uint8_t *data,
                  size_t         length);
]]></code></synopsis>
  </section>

  <section id="parameters">
    <title>Parameters</title>
    <table>
      <tr><td><p>b</p></td><td><p>A <link xref="bson_t">bson_t</link>.</p></td></tr>
      <tr><td><p>data</p></td><td><p>A buffer to initialize with.</p></td></tr>
      <tr><td><p>length</p></td><td><p>The length of <code>data</code> in bytes.</p></td></tr>
    </table>
  </section>

  <section id="description">
    <title>Description</title>
    <p>The <link xref="bson_init_static">bson_init_static()</link> function shall shall initialize a read-only <link xref="bson_t">bson_t</link> 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 <link xref="bson_t">bson_t</link>.</p>
  </section>

  <section id="return">
    <title>Returns</title>
    <p><link xref="bson_init_static">bson_init_static()</link> will return <code>true</code> if the <link xref="bson_t">bson_t</link> was successfully initialized.</p>
  </section>

</page>
